public class SpikingNeuralNet extends NeuralNet
The class SpikingNeuralNet represents a spiking neural network. A SpikingNeuralNet
supports neuron models that explicitly model the neurons potential and spike generation. Use base
classes SpikingNeuron and SpikingLink to construct a spiking neural network.
A SpikingNeuralNetwork has following responsibilities:
To use a SpikingNeuralNetwork perform following steps:
NeuralNet SpikeSetSpikeSet.setInputSpikes(Neuron, List)setInput(SpikeSet)innervate()
The network offers two different modes that define the scheduling strategy for the spikes.
The network output is independent of the selected mode. The current mode is indicated
by the return value of getRealTimeMode().
In default mode, once the network is innervated, all calculations are performed as soon as
the necessary information is available. There is no relation between the real time
and the firing time of the spike, indicated by its timestamp. However, if a call to
setRealTimeMode() sets the network to real-time mode before it is innervated,
a spike with firing time t is approximately propagated t milliseconds
after the network was innervated.
FEEDFORWARD, filter, inputNeurons, layers, links, maxCycles, neurons, outputNeurons, props, RECURRENT, topology, trainer, UNKNOWN, zeroInputAfterFirstCycle| Constructor and Description |
|---|
SpikingNeuralNet()
Create a new, empty
SpikingNeuralNet. |
| Modifier and Type | Method and Description |
|---|---|
void |
addLink(Link link)
Adds a link.
|
void |
addNeuron(Neuron neuron)
Add a neuron to our list.
|
void |
fromXML(org.jdom2.Element element)
Loads the network attributes from XML.
|
double |
getLatestSpikeTime()
Returns the latest spike time of the spikes currently in the buffer.
|
boolean |
hasMoreSpikes()
Checks if currently there are unprocessed spikes.
|
void |
innervate()
Innervates the network by calling
innervate(double) with infinite execution time. |
void |
innervate(double timeLimit)
Innervate the network, i.e.
|
boolean |
isActive()
Checks if the scheduler thread is active.
|
boolean |
isRealTimeMode()
Return whether real-time mode is activated.
|
static SpikingNeuralNet |
load(java.io.File file,
IOFilter filter)
Loads a SpikingNeuralNet from the given file using the set file filter.
|
boolean |
removeLink(Link link)
remove a link from our network.
|
boolean |
removeNeuron(Neuron neuron)
Removes a neuron and updates the associated links, but no link lists.
|
void |
replaceLink(Link oldLink,
Link newLink)
replace a link with another.
|
void |
replaceNeuron(Neuron oldNeuron,
Neuron newNeuron)
Replace a neuron with another.
|
void |
resume()
Resume scheduling and propagating spikes.
|
void |
setInput(SpikeSet inputs)
Set the firing times for the input neurons as defined in the specified
SpikeSet. |
void |
setRealTimeMode(boolean realTime)
Set whether the network should run in real-time mode.
|
void |
stop()
Stop scheduling and propagating spikes.
|
addLayer, clone, getFilter, getHiddenNeuronCount, getInputNeuron, getInputNeuronCount, getLink, getLinkCount, getLinkID, getMaxCycles, getNeuron, getNeuronCount, getNeuronID, getNeuronIndex, getOutput, getOutputNeuron, getOutputNeuronCount, getOutputNeuronIndex, getTopology, getTrainer, getZeroInputAfterFirstCycle, linkNet, randomize, save, setFilter, setInput, setInput, setMaxCycles, setTopology, setTrainer, setZeroInputAfterFirstCycle, toString, toXMLpublic void innervate()
innervate(double) with infinite execution time.public void innervate(double timeLimit)
isActive() to check the state of the network. There could be a
lock, if the network does not generate any more spikes, before reaching the time limit. Please, use
hasMoreSpikes() ()} to check this situation.timeLimit - the upper limit for the firing times [ms] of the generated spikespublic void stop()
public void resume()
public boolean isActive()
resume().public boolean hasMoreSpikes()
public double getLatestSpikeTime()
public void setInput(SpikeSet inputs)
SpikeSet.
If a specific input neuron should not generate any spikes, SpikeSet.getInputSpikes(Neuron)
should return null or an empty list for the specific input neuron. Note that the global buffer is
cleared before adding the spikes, so as to avoid confusion with potential old spikes.inputs - the firing times for the input neuronspublic boolean isRealTimeMode()
true if real-time mode is activatedpublic void setRealTimeMode(boolean realTime)
public void addNeuron(Neuron neuron)
NeuralNetpublic void replaceNeuron(Neuron oldNeuron, Neuron newNeuron)
NeuralNetreplaceNeuron in class NeuralNetpublic boolean removeNeuron(Neuron neuron)
NeuralNetremoveNeuron in class NeuralNetpublic void replaceLink(Link oldLink, Link newLink)
NeuralNetNOTE: The solution may look a bit complicated, but this is prepared for Special, extended links.
replaceLink in class NeuralNetpublic boolean removeLink(Link link)
NeuralNetNOTE: The Link is always disconnected before removing from the neurons using Link.disconnect() .
Also please note that there is no removeLink(int index) method, because the link needs to be looked up anyway, to disconnect it.
removeLink in class NeuralNetLink.disconnect()public static SpikingNeuralNet load(java.io.File file, IOFilter filter) throws java.io.IOException
file - file to load the network fromjava.io.IOException