The Physiologist's Friend Simulation API

ch.unizh.ini.friend.simulation.cells
Class IntegrateFireCell

java.lang.Object
  extended by ch.unizh.ini.friend.simulation.AbstractAcceptsInput
      extended by ch.unizh.ini.friend.simulation.cells.AbstractCell
          extended by ch.unizh.ini.friend.simulation.cells.AbstractSpikingCell
              extended by ch.unizh.ini.friend.simulation.cells.IntegrateFireCell
All Implemented Interfaces:
AcceptsInput, SpikingCell, ServesOutput, Updateable, Serializable
Direct Known Subclasses:
GanglionCell

public class IntegrateFireCell
extends AbstractSpikingCell

Implementation of a spiking cell with an integrate-and-fire spike mechanism. The cells sums its inputs at each time step, resulting in a membrane potential. If the potential exceeds the threshold, it is reset on the next update to 0. Calling isSpike() duing this time step will show that the cell is emitting a spike. The cell's potential is clamped on the negative side by the potasium reversal potential, so that the cell cannot be infinitely inhibited. Thus the cell can recover quickly from massive inhibition. The cell has a passive leak to the resting potential (zero) whose time constant is leakTime.

The analog output of a spiking neuron is computed as the instantaneous spike rate -- the reciprocal of the time between the last two spikes. There are three caveats:

The output variables are double-buffered so that each simulation step only sees the last potential, not the one that will become the new one after update() is called.

Version:
$Revision: 1.25 $
Author:
Christof Marti/Tobi Delbruck
See Also:
Updateable, Serialized Form

Field Summary
protected static float INPUT_WEIGHT
          The default input weight.
protected  float integrationPotential
          The currently integrated membrane potential.
 float leakTime
          The leak time constant in seconds.
protected  float maxRate
          the maximum spike rate, measured in spikes/SPIKE_RATE_TIME_SCALE.
protected  boolean newSpike
          Encodes whether the cell will make a spike after the next update().
protected  float potasiumReversal
          Potasium reversal potential.
protected  boolean spike
          Encodes whether the cell is making a spike now.
static float SPIKE_RATE_TIME_SCALE
          spike rate time scale in seconds.
protected  float spikeRateMeasurementWindow
          spike rate measurement time window in seconds.
protected  float threshold
          The threshold where the cell will fire.
 
Fields inherited from class ch.unizh.ini.friend.simulation.cells.AbstractCell
newValue, value
 
Fields inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
inputs
 
Constructor Summary
IntegrateFireCell()
          Creates a new instance with currently no inputs.
IntegrateFireCell(Collection inputs)
          Creates a new instance with the given collections of inputs.
IntegrateFireCell(int n)
          Creates a new instance with currently no inputs and with the given initial capacity.
IntegrateFireCell(ServesOutput input)
          Creates a new instance with the given input.
 
Method Summary
 void compute(float dt)
          Computes the new state of this component of the simulation.
 float getLeakTime()
          Getter for property leakTime.
 float getMaxRate()
          Getter for property maxRate.
 float getPotasiumReversal()
           
 float getSpikeRateMeasurementWindow()
          Getter for property spikeRateMeasurementWindow.
 float getThreshold()
          Getter for property threshold.
 boolean isSpike()
          is the cell making a spike now?
 void setLeakTime(float leakTime)
          Setter for property leakTime.
 void setMaxRate(float maxRate)
          Setter for property maxRate.
 void setPotasiumReversal(float r)
           
 void setSpikeRateMeasurementWindow(float spikeRateMeasurementWindow)
          Setter for property spikeRateMeasurementWindow.
 void setThreshold(float threshold)
          Setter for property threshold.
 void update()
          Updates the actual state to the newly computed - aka double-buffering.
 
Methods inherited from class ch.unizh.ini.friend.simulation.cells.AbstractSpikingCell
factory, factory, factory, factory, getComplexCellInstance, getDSSimpleCellInstance, getEvenSimpleCellInstance, getOddSimpleCellInstance
 
Methods inherited from class ch.unizh.ini.friend.simulation.cells.AbstractCell
output
 
Methods inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
averageInputs, cloneObject, connectOneToAll, connectOneToOne, getCollectionInstance, getInput, getInputs, integrateInputs, setInput, setInputs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leakTime

public float leakTime
The leak time constant in seconds.


INPUT_WEIGHT

protected static final float INPUT_WEIGHT
The default input weight. (14.0f)

See Also:
Constant Field Values

threshold

protected float threshold
The threshold where the cell will fire.


potasiumReversal

protected float potasiumReversal
Potasium reversal potential. The cell potential will not go below this value. This is the lower power rail of the cell. It prevents the cell from becoming infinitely hyperpolarized.


SPIKE_RATE_TIME_SCALE

public static final float SPIKE_RATE_TIME_SCALE
spike rate time scale in seconds. The AbstractCell.output() of the cell is the rate of spikes per this time. This scale can be used to normalize spike rates to near-unity values. (Value is 0.019999999552965164f.)

See Also:
Constant Field Values

spikeRateMeasurementWindow

protected float spikeRateMeasurementWindow
spike rate measurement time window in seconds. The spike rate is measured with a fading memory of this duration.


spike

protected boolean spike
Encodes whether the cell is making a spike now.


newSpike

protected boolean newSpike
Encodes whether the cell will make a spike after the next update().


integrationPotential

protected float integrationPotential
The currently integrated membrane potential.


maxRate

protected float maxRate
the maximum spike rate, measured in spikes/SPIKE_RATE_TIME_SCALE.

Constructor Detail

IntegrateFireCell

public IntegrateFireCell()
Creates a new instance with currently no inputs.


IntegrateFireCell

public IntegrateFireCell(int n)
Creates a new instance with currently no inputs and with the given initial capacity.

Parameters:
n - Number of initial capacity for inputs.

IntegrateFireCell

public IntegrateFireCell(Collection inputs)
Creates a new instance with the given collections of inputs.

Parameters:
inputs - The collection of inputs.

IntegrateFireCell

public IntegrateFireCell(ServesOutput input)
Creates a new instance with the given input.

Parameters:
input - The input.
Method Detail

setPotasiumReversal

public void setPotasiumReversal(float r)
Parameters:
r - the reversal potential value, default is -0.3
See Also:
potasiumReversal

getPotasiumReversal

public float getPotasiumReversal()
Returns:
the reversal potential
See Also:
potasiumReversal

compute

public void compute(float dt)
Computes the new state of this component of the simulation. The membrane potential's inputs (the result of AbstractAcceptsInput.integrateInputs()) are multiplied by the time step dt and summed to the present potential; the sum is multiplied by exp(-dt/leakTime). If the membrane exceeds threshold it is reset to zero. The potential is clamped to a miniumum of potasiumReversal.

If the cell has spiked (gone past threshold), it will show up after the next update(). This spike will last one cycle. The spike will not be visible during the present cycle.

The instantaneous spike rate is computed as

        float instantaneousRate=SPIKE_RATE_TIME_SCALE/(time-lastSpikeTime+Float.MIN_VALUE);
        if(instantaneousRate>maxRate) instantaneousRate=maxRate;
        newValue = rateMeasurementFilter.filter(instantaneousRate,dt);
    
rateMeasurementFilter is an instance of LowPassFilter with time constant spikeRateMeasurementWindow. newValue then becomes the value returned as the cell's AbstractCell.output()

Parameters:
dt - The time that has passed since the last invocation in seconds.

update

public void update()
Updates the actual state to the newly computed - aka double-buffering.

Specified by:
update in interface Updateable
Overrides:
update in class AbstractCell

isSpike

public boolean isSpike()
is the cell making a spike now?

Returns:
true if the cell just made a spike
See Also:
AbstractCell.output()

getSpikeRateMeasurementWindow

public float getSpikeRateMeasurementWindow()
Getter for property spikeRateMeasurementWindow.

Returns:
Value of property spikeRateMeasurementWindow.

setSpikeRateMeasurementWindow

public void setSpikeRateMeasurementWindow(float spikeRateMeasurementWindow)
Setter for property spikeRateMeasurementWindow.

Parameters:
spikeRateMeasurementWindow - New value of property spikeRateMeasurementWindow.

getMaxRate

public float getMaxRate()
Getter for property maxRate.

Returns:
Value of property maxRate.

setMaxRate

public void setMaxRate(float maxRate)
Setter for property maxRate.

Parameters:
maxRate - New value of property maxRate.

getThreshold

public float getThreshold()
Getter for property threshold.

Returns:
Value of property threshold.

setThreshold

public void setThreshold(float threshold)
Setter for property threshold.

Parameters:
threshold - New value of property threshold.

getLeakTime

public float getLeakTime()
Getter for property leakTime.

Returns:
Value of property leakTime.

setLeakTime

public void setLeakTime(float leakTime)
Setter for property leakTime.

Parameters:
leakTime - New value of property leakTime.

http://www.ini.unizh.ch/~tobi/friend