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

📄 fastneuron.h

📁 此代码经过大量使用
💻 H
字号:
/***************************************************************************                          fastneuron.h  -  description                             -------------------    begin                : Tue Jan 22 2002    copyright            : (C) 2002 by Matt Grover    email                : mgrover@amygdala.org ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#ifndef FASTNEURON_H#define FASTNEURON_H#include <amygdala/neuron.h>/** @class FastNeuron fastneuron.h amygdala/fastneuron.h  * @brief FastNeuron implements a neuron model with a PSP that  * has no rise time and an exponential decay.  *  * Both the inhibitory  * and excitatory PSPs have the form \f[ U = exp\left(\frac{-t}{\tau_m}\right) \f]  * Only the membrane time constant is used for this neuron, the synaptic time  * constant is assumed to be 0 regardless of how it is set through the API.  * @see Neuron, AlphaNeuron, BasicNeuron  * @author Matt Grover  */class FastNeuron : public Neuron  {public:     /** @param neuronId A unique, positive integer that is used     *  to identify the neuron. */	FastNeuron(AmIdInt neuronId);	virtual ~FastNeuron();    /** Fill a lookup table and return     * a pointer to the first element. Neuron::SetTableDimensions()     * should be called first.     * This is an internal function and should only be called     * by FunctionLookup. This function will be made private or removed     * completely for Amygdala 0.4.     * @param index The index of the table to be initialized.     * @return A pointer to the lookup table (an array of floats). */    virtual float* InitializeLookupTable(int index);    /** This is an internal function and should only be called     * by FunctionLookup.  This function will be either removed     * or made private for Amygdala 0.4.     * @return An array containing any values used to generate     * the lookup tables that were set at runtime.     * @param index     * @param numParams Number of unique parameters (variables) needed     * to generate the lookup table associated with index. */    virtual float* GetTableParams(int index, int& numParams);    /** return "FastNeuron".  this is needed for xml tags. */    virtual const char* ClassId() { return "FastNeuron"; }protected:    // Functions:    /** Send a spike to this Neuron.   When spikes are     * grouped, this function will only be called once per step, but     * it can be called multiple times otherwise.     * This should only be called from other Neurons or the Network.     * @param inSynapse The synapses that the incoming spikes are crossing.     * (locations of the weights).     * @param inTime Time of input (microseconds).     * @param numSyn Number of synapses that are receiving     * input during the current time step.  The default value     * of 0 indicates that spikes are not being grouped together     * and only a single spike is being passed.     * @see Neuron::SendSpike(), Network::SendDelayedSpikes(). */    virtual void InputSpike(SynapseItr& inSynapse,                            AmTimeInt inTime,                            unsigned int numSyn = 0);    /** Query funcRef to see if a lookup table has already     * been generated for an identical neuron and retrieve     * a pointer to the table if it has.     * This is an internal function and should not be called     * by library users.     * @param funcRef Pointer to a FunctionLookup object. */    virtual int SetLookupTables(FunctionLookup* funcRef);    /** Fill the lookup table corresponding to index.     * Two tables are used in this class -- a PostSynaptic potential     * table and a table holding values for the derivative of the     * potential.     * @param index Index number of table to be populated. */    virtual int FillLookupTables(int index);    /** Determine the maximum value of a weight for this neuron and     * set maxScaledWeight to this value. This will be used     * as the multiplication factor to convert to and from the     * normalized weight values that are used in the public     * interface.     * <P>NOTE: This function will be deprecated in version 0.4     * if favor of normalizing PSP curves rather than recalculating     * normalized weights. */    virtual void SetMaxScaledWeight();private:    /** Calculate the value of the PSP function     * for a given time.     * @param calcTime Relative time of input (time since start of     * the curve.     * @param pspElement Pointer to the table element that will     * hold the calculated value. */    inline void PspKernel(float calcTime, float* pspElement);    /*     * Tables used to cache value of PSP function     * for each time step (number of steps cached is specified by     * pspLSize)     */    float* pspLookup;    /*     * Index into the begining point of inputHist.  This is used     * to avoid parsing over old and non-contributing input.     */    unsigned int histBgnIdx;    /*     * The inverse of the step size.  Used in input spike     * rather than dividing by stepSize as an optimization.     */    float stepSizeInv;};#endif

⌨️ 快捷键说明

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