public class SpikingNeuron extends Neuron
Base class for spike generating neurons in a SpikingNeuralNet. Provides an implementation
of the Integrate-and-Fire model. The form of the generated spikes is described by the activation
function. The default spike form is the Spike function which models spikes of biological neurons.
A SpikingNeuron generates a spike when its potential reaches a predefined threshold
from below. The potential of a spiking neuron u at time t is a function of the
spike history of u. The spike history of u at time t is the set of all spikes
fired and received by neuron u up to t.
When the potential of a SpikingNeuron reaches the threshold from below, the neuron creates a
new SpikeEvent that contains the time stamp in which the threshold was crossed, the form of the spike
and its origin and target. The generated spikes are stored and propagated by the SpikingNeuralNet
to which the neuron belongs.
Although any Function f can be set as activation function, it is recommended that
f meets one of the following properties:
f has a root at 0, a single maximum > 0 at max,
is monotonically increasing in [0, max] and monotonically decreasing in [max, infinity], converging to 0
f has a root at 0, a single maximum > 0 at max,
is monotonically increasing in [0, max], monotonically decreasing in [max, min] where f(min) < 0
and monotonically increasing in [min, infinity] converging to 0
| Modifier and Type | Field and Description |
|---|---|
protected double |
maxLookAhead
Current upper bound of the time interval searched for threshold intersections
|
protected NeuronPotential |
neuronPotential
Function describing the neuron potential
|
errorSignal, externalInput, input, inputNeuron, layer, linkInput, links, output, outputNeuron, position, usingBiasactivationFn, name, NO_ID, weight| Constructor and Description |
|---|
SpikingNeuron()
Create a new
SpikingNeuron with default spike form and a threshold of 15mV. |
SpikingNeuron(boolean inputNeuron,
boolean outputNeuron,
boolean usingBias)
Create a {new @code SpikingNeuron} with default spike form.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculate()
Handle the most recent event scheduled by the
SpikingNeuralNet to which this neuron belongs. |
SpikingNeuron |
clone()
Returns a semi-deep clone of this neuron.
|
void |
fire(double time)
Generate a new spike with the specified firing time.
|
void |
fromXML(org.jdom2.Element element)
Reads attributes from XML tree.
|
double |
getThreshold()
Returns the firing threshold.
|
void |
process(SpikeEvent event,
double lookAhead)
Update this neurons spike history with the specified event.
|
void |
randomize()
Calls
super.randomize() and randomizes the threshold value within [0.0, 30.0). |
void |
randomize(double minValue,
double maxValue)
Calls
super.randomize(double, double) and randomizes the threshold value within the given bounds. |
void |
record(SpikeSet destination,
double from,
double to)
Start recording the timestamps of spikes fired by this neuron to the specified
SpikeSet;
Ignore any timestamps outside the specified time interval. |
void |
recordStart(SpikeSet destination)
Start recording the timestamps of spikes fired by this neuron to the specified
SpikeSet. |
void |
recordStop()
Stop recording the timestamps of spikes fired by this neuron.
|
void |
reset()
Clears the spike history of this SpikingNeuron.
|
void |
setActivationFn(Function form)
Set the function that is used to describe the form of the spikes fired by this neuron.
|
void |
setBuffer(SpikeEventBuffer buffer)
Set a reference to the global buffer that holds all spikes generated inside the
SpikingNeuralNet to which this neuron belongs. |
void |
setThreshold(double threshold)
Sets the firing threshold potential.
|
java.lang.String |
toString()
Returns a string representation of the neuron.
|
org.jdom2.Element |
toXML(org.jdom2.Element element)
Writes attributes to XML tree.
|
addLinkInput, addToBias, compareTo, getBias, getErrorSignal, getExternalInput, getInput, getInputLink, getInputLinkCount, getLayer, getLink, getLinkCount, getLinkInput, getLinks, getLinkTo, getOutput, getOutputLink, getOutputLinkCount, getPosition, isHiddenNeuron, isInputNeuron, isOutputNeuron, isUsingBias, propagateOutput, setBias, setErrorSignal, setExternalInput, setInput, setInputNeuron, setLayer, setLinkInput, setOutput, setOutputNeuron, setPosition, setUsingBiasaddGradient, addToWeight, getAccu, getActivationFn, getGradient, getID, getLastGradient, getName, getUniqueID, getWeight, isTrainable, setAccu, setGradient, setID, setLastGradient, setName, setTrainable, setWeightprotected NeuronPotential neuronPotential
protected double maxLookAhead
public SpikingNeuron()
SpikingNeuron with default spike form and a threshold of 15mV.public SpikingNeuron(boolean inputNeuron,
boolean outputNeuron,
boolean usingBias)
inputNeuron - true if this neuron is an input neuron of the SpikingNeuralNet it is added tooutputNeuron - true if this neuron is an output neuron of the SpikingNeuralNet it is added tousingBias - true if this neuron should use a biaspublic SpikingNeuron clone()
Neuronpublic double getThreshold()
public void setThreshold(double threshold)
threshold - the value [mV]public void randomize()
super.randomize() and randomizes the threshold value within [0.0, 30.0).public void randomize(double minValue,
double maxValue)
super.randomize(double, double) and randomizes the threshold value within the given bounds.public void fire(double time)
time - the firing time of the new spikepublic void calculate()
SpikingNeuralNet to which this neuron belongs.
Event handling comprises updating the spike history and predicting the next spike fired by this neuron.public void process(SpikeEvent event, double lookAhead)
event - the event to processlookAhead - the upper bound of the search interval for the next spikepublic void record(SpikeSet destination, double from, double to)
SpikeSet;
Ignore any timestamps outside the specified time interval.
Spikes fired prior to the invocation of this method are not recorded, even
if their timestamp falls inside the specified interval.destination - the SpikeSet used to store the recorded timestampsfrom - the lower inclusive bound of the time intervalto - the upper exclusive bound of the time intervalpublic void recordStart(SpikeSet destination)
SpikeSet.
Spikes fired prior to the invocation of this method are not recordeddestination - the SpikeSet used to store the recorded timestampspublic void recordStop()
public void reset()
public void setBuffer(SpikeEventBuffer buffer)
SpikingNeuralNet to which this neuron belongs.public void setActivationFn(Function form)
setActivationFn in class BrainPartform - the function describing the spike formpublic void fromXML(org.jdom2.Element element)
public org.jdom2.Element toXML(org.jdom2.Element element)