⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aureservoir.py

📁 一个人工神经网络的程序。 文档等说明参见http://aureservoir.sourceforge.net/
💻 PY
📖 第 1 页 / 共 3 页
字号:
    def getDelays(*args):        """        getDelays(self, double wmtx)        throw (        AUExcept) query the trained delays in delay&sum readout See:  class        SimFilterDS and copies the data into a C-style matrix        Memory of the C array must be allocated before!        Parameters:        -----------        wmtx:  matrix with delay form neurons+inputs to all outputs size =        (output x neurons+inputs)         """        return _aureservoir.DoubleESN_getDelays(*args)    def setInitAlgorithm(*args):        """        setInitAlgorithm(self, InitAlgorithm alg=INIT_STD)        setInitAlgorithm(self)        throw (        AUExcept) set initialization algorithm         """        return _aureservoir.DoubleESN_setInitAlgorithm(*args)    def setTrainAlgorithm(*args):        """        setTrainAlgorithm(self, TrainAlgorithm alg=TRAIN_LEASTSQUARE)        setTrainAlgorithm(self)        throw (        AUExcept) set training algorithm         """        return _aureservoir.DoubleESN_setTrainAlgorithm(*args)    def setSimAlgorithm(*args):        """        setSimAlgorithm(self, SimAlgorithm alg=SIM_STD)        setSimAlgorithm(self)        throw (        AUExcept) set simulation algorithm         """        return _aureservoir.DoubleESN_setSimAlgorithm(*args)    def setSize(*args):        """        setSize(self, int neurons=10)        setSize(self)        throw ( AUExcept)        set reservoir size (nr of neurons)         """        return _aureservoir.DoubleESN_setSize(*args)    def setInputs(*args):        """        setInputs(self, int inputs=1)        setInputs(self)        throw (        AUExcept) set nr of inputs to the reservoir         """        return _aureservoir.DoubleESN_setInputs(*args)    def setOutputs(*args):        """        setOutputs(self, int outputs=1)        setOutputs(self)        throw (        AUExcept) set nr of outputs from the reservoir         """        return _aureservoir.DoubleESN_setOutputs(*args)    def setNoise(*args):        """        setNoise(self, double noise)        throw ( AUExcept)        set noise level for training/simulation algorithm        Parameters:        -----------        noise:  with uniform distribution within [-noise|+noise]         """        return _aureservoir.DoubleESN_setNoise(*args)    def setInitParam(*args):        """        setInitParam(self, InitParameter key, double value=0.)        setInitParam(self, InitParameter key)        set initialization parameter         """        return _aureservoir.DoubleESN_setInitParam(*args)    def setReservoirAct(*args):        """        setReservoirAct(self, ActivationFunction f=ACT_TANH)        setReservoirAct(self)        throw (        AUExcept) set reservoir activation function         """        return _aureservoir.DoubleESN_setReservoirAct(*args)    def setOutputAct(*args):        """        setOutputAct(self, ActivationFunction f=ACT_LINEAR)        setOutputAct(self)        throw (        AUExcept) set output activation function         """        return _aureservoir.DoubleESN_setOutputAct(*args)    def setWin(*args):        """        setWin(self, double inmtx)        throw ( AUExcept)        set input weight matrix C-style interface (neurons x inputs) (data        will be copied into a FLENS matrix)        Parameters:        -----------        inmtx:  pointer to win matrix in row major storage         """        return _aureservoir.DoubleESN_setWin(*args)    def setW(*args):        """        setW(self, double inmtx)        throw ( AUExcept) set        reservoir weight matrix C-style interface (neurons x neurons) (data        will be copied into a FLENS matrix)        Parameters:        -----------        inmtx:  pointer to a dense reservoir matrix in row major storage         """        return _aureservoir.DoubleESN_setW(*args)    def setWback(*args):        """        setWback(self, double inmtx)        throw ( AUExcept)        set feedback weight matrix C-style interface (neurons x outputs) (data        will be copied into a FLENS matrix)        Parameters:        -----------        inmtx:  pointer to wback matrix in row major storage         """        return _aureservoir.DoubleESN_setWback(*args)    def setWout(*args):        """        setWout(self, double inmtx)        throw ( AUExcept)        set output weight matrix C-style interface (outputs x neurons+inputs)        (data will be copied into a FLENS matrix)        Parameters:        -----------        inmtx:  pointer to wout matrix in row major storage         """        return _aureservoir.DoubleESN_setWout(*args)    def setX(*args):        """        setX(self, double invec)        throw ( AUExcept) set        internal state vector C-style interface (size = neurons) (data will be        copied into a FLENS matrix)        Parameters:        -----------        invec:  pointer to state vector         """        return _aureservoir.DoubleESN_setX(*args)    def setLastOutput(*args):        """        setLastOutput(self, double last)        throw (        AUExcept) set last output, stored by the simulation algorithm needed        in singleStep simulation with feedback        Parameters:        -----------        last:  vector with size = outputs         """        return _aureservoir.DoubleESN_setLastOutput(*args)DoubleESN_swigregister = _aureservoir.DoubleESN_swigregisterDoubleESN_swigregister(DoubleESN)class SingleESN(_object):    """    class for a basic Echo State Network    This class implements a basic Echo State Network as described in    articles by Herbert Jaeger on the following page: See:    http://www.scholarpedia.org/article/Echo_State_Network  The template    argument T can be float or double. Single Precision (float) saves    quite some computation time.    The "echo state" approach looks at RNNs from a new angle. Large RNNs    are interpreted as "reservoirs" of complex, excitable dynamics.    Output units "tap" from this reservoir by linearly combining the    desired output signal from the rich variety of excited reservoir    signals. This idea leads to training algorithms where only the    network-to-output connection weights have to be trained. This can be    done with known, highly efficient linear regression algorithms. from    See:  http://www.faculty.iu-bremen.de/hjaeger/esn_research.html    C++ includes: esn.h     """    __swig_setmethods__ = {}    __setattr__ = lambda self, name, value: _swig_setattr(self, SingleESN, name, value)    __swig_getmethods__ = {}    __getattr__ = lambda self, name: _swig_getattr(self, SingleESN, name)    __repr__ = _swig_repr    def __init__(self, *args):         """        __init__(self) -> SingleESN        __init__(self, SingleESN src) -> SingleESN        Copy Constructor.         """        this = _aureservoir.new_SingleESN(*args)        try: self.this.append(this)        except: self.this = this    __swig_destroy__ = _aureservoir.delete_SingleESN    __del__ = lambda self : None;    def init(*args):        """        init(self)        throw ( AUExcept)        Initialization Algorithm for an Echo State Network See:  class        InitBase         """        return _aureservoir.SingleESN_init(*args)    def resetState(*args):        """        resetState(self)        resets the internal state vector x of the reservoir to zero         """        return _aureservoir.SingleESN_resetState(*args)    def adapt(*args):        """        adapt(self, float inmtx) -> double        throw ( AUExcept)        C-style Reservoir Adaptation Algorithm Interface (data will be copied        into a FLENS matrix) At the moment this is only the Gaussian-IP        reservoir adaptation method for tanh neurons. See:  "Adapting        reservoirs to get Gaussian distributions" by David Verstraeten,        Benjamin Schrauwen and Dirk Stroobandt        Parameters:        -----------        inmtx:  matrix of input values (inputs x timesteps), the reservoir        will be adapted by this number of timesteps.        mean value of differences between all parameters before and after        adaptation, can be used to see if learning still makes an progress.         """        return _aureservoir.SingleESN_adapt(*args)    def train(*args):        """        train(self, float inmtx, float outmtx, int washout)        throw ( AUExcept)        C-style Training Algorithm Interface (data will be copied into a FLENS        matrix) See:  class TrainBase        Parameters:        -----------        inmtx:  input matrix in row major storage (usual C array) (inputs x        timesteps)        outmtx:  output matrix in row major storage (outputs x timesteps) for        teacher forcing        washout:  washout time in samples, used to get rid of the transient        dynamics of the network starting state         """        return _aureservoir.SingleESN_train(*args)    def simulate(*args):        """        simulate(self, float inmtx, float outmtx)        throw ( AUExcept)        C-style Simulation Algorithm Interface with some additional error        checking. (data will be copied into a FLENS matrix) See:  class        SimBase        Parameters:        -----------        inmtx:  input matrix in row major storage (usual C array) (inputs x        timesteps)        outmtx:  output matrix in row major storage (outputs x timesteps),        Data must be already allocated!         """        return _aureservoir.SingleESN_simulate(*args)    def simulateStep(*args):        """        simulateStep(self, float invec, float outvec)        throw (        AUExcept) C-style Simulation Algorithm Interface, for single step        simulation See:  class SimBase         """        return _aureservoir.SingleESN_simulateStep(*args)    def setBPCutoff(*args):        """        setBPCutoff(self, float f1vec, float f2vec)        throw (        AUExcept) Set lowpass/highpass cutoff frequencies for bandpass style        neurons " (C-style Interface).        Parameters:        -----------        f1:  vector with lowpass cutoff for all neurons (size = neurons)        f2:  vector with highpass cutoffs (size = neurons)         """        return _aureservoir.SingleESN_setBPCutoff(*args)    def setIIRCoeff(*args):        """        setIIRCoeff(self, float bmtx, float amtx, int series=1)        setIIRCoeff(self, float bmtx, float amtx)        throw (        AUExcept) sets the IIR-Filter coefficients, like Matlabs filter        object.        Parameters:        -----------        B:  matrix with numerator coefficient vectors (m x nb) m ... nr of        parallel filters (neurons) nb ... nr of filter coefficients        A:  matrix with denominator coefficient vectors (m x na) m ... nr of        parallel filters (neurons) na ... nr of filter coefficients        seris:  nr of serial IIR filters, e.g. if series=2 the coefficients B        and A will be divided in its half and calculated with 2 serial IIR        filters         """        return _aureservoir.SingleESN_setIIRCoeff(*args)    def post(*args):        """        post(self)        posts current parameters to stdout 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -