public class Synapse
extends java.lang.Object
Constructor and Description |
---|
Synapse(Network newParent,
Neuron source,
Neuron target,
SynapseUpdateRule learningRule)
Construct a synapse using a source and target neuron, and a specified
learning rule and parent network
|
Synapse(Network newParent,
Neuron source,
Neuron target,
SynapseUpdateRule learningRule,
Synapse templateSynapse)
Construct a synapse using a source and target neuron, and a specified
learning rule.
|
Synapse(Network newParent,
Synapse synapse)
Copy a synapse with a specified new parent.
|
Synapse(Neuron source,
Neuron target)
Construct a synapse using a source and target neuron, defaulting to
ClampedSynapse and assuming the parent of the source neuron is the parent
of this synapse.
|
Synapse(Neuron source,
Neuron target,
double initialStrength)
Construct a synapse with a specified initial strength.
|
Synapse(Neuron source,
Neuron target,
SynapseUpdateRule learningRule)
Construct a synapse using a source and target neuron, and a specified
learning rule.
|
Synapse(Neuron source,
Neuron target,
SynapseUpdateRule learningRule,
Network parent)
Construct a synapse using a source and target neuron, and a specified
learning rule.
|
Synapse(Synapse s)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
calcPSR()
For spiking source neurons, returns the spike-responder's value times the
synapse strength.
|
double |
calcWeightedSum()
For non-spiking neurons returns the weighted sum, i.e.
|
void |
checkBounds()
If weight value is above or below its bounds set it to those bounds.
|
double |
clip(double value)
Utility function for use in learning rules.
|
static Synapse |
copyTemplateSynapse(Synapse s)
Makes a deep copy of a template synapse (one with no source or target).
|
void |
decay(double decayPercent)
Decay this synapse by the indicated percentage.
|
void |
decodeNumericByteArray(java.nio.ByteBuffer byteValues) |
void |
decrementWeight()
Decrement this weight by increment.
|
void |
forceSetStrength(double wt) |
int |
getDelay() |
java.lang.String |
getId() |
double |
getIncrement() |
SynapseUpdateRule |
getLearningRule() |
double |
getLowerBound() |
Network |
getNetwork()
Convenience method for getting a reference to the parent root network.
|
byte[] |
getNumericValuesAsByteArray() |
SynapseGroup |
getParentGroup() |
Network |
getParentNetwork() |
double |
getPsr() |
static java.util.List<SynapseUpdateRule> |
getRuleList(java.util.Collection<Synapse> synapseCollection)
A method which takes in a collection of synapses and returns a list of
their update rules in the order in which they appear in the original
collection, if that collection supports a consistent order.
|
Neuron |
getSource() |
SpikeResponder |
getSpikeResponder() |
double |
getStrength() |
Synapse |
getSymmetricSynapse()
Returns symmetric synapse if there is one, null otherwise.
|
Neuron |
getTarget() |
static Synapse |
getTemplateSynapse()
Returns a "template" synapse.
|
static Synapse |
getTemplateSynapse(SynapseUpdateRule rule)
Returns a template synapse with a specified learning rule.
|
java.lang.String |
getToolTipText()
Returns string for tool tip or short description.
|
java.lang.String |
getType()
The name of the learning rule of the synapse; it's "type".
|
double |
getUpperBound() |
void |
incrementWeight()
Increment this weight by increment.
|
void |
initSpikeResponder()
Set a default spike responder if the source neuron is a spiking neuron,
else set the spikeResponder to null.
|
Synapse |
instantiateTemplateSynapse(Neuron source,
Neuron target,
Network parent)
A template synapse is a synapse that has no proper references, but is
used for setting properties.
|
boolean |
isEnabled()
Whether this synapse is enabled or not.
|
boolean |
isFrozen() |
void |
postUnmarshallingInit()
Called after a synapse is de-serialized, to repopulate fan-in and fan-out
lists.
|
void |
randomize()
Randomize this weight to a value between its upper and lower bounds.
|
void |
randomizeSymmetric()
Randomizes this synapse and sets the symmetric analogue to the same
value.
|
void |
reinforce()
Increase the absolute value of this weight by increment amount.
|
void |
setDelay(int dly)
Delay manager.
|
void |
setEnabled(boolean enabled)
A better name than setSendWeightedInput.
|
void |
setFrozen(boolean frozen) |
void |
setId(java.lang.String id) |
void |
setIncrement(double d)
Sets the amount to increment neuron.
|
void |
setLearningRule(SynapseUpdateRule newLearningRule)
Change this synapse's learning rule.
|
void |
setLowerBound(double d)
Sets the lower synapse bound.
|
void |
setParentGroup(SynapseGroup parentGroup) |
void |
setPsr(double psr) |
void |
setSpikeResponder(SpikeResponder sr) |
void |
setStrength(double wt)
Sets the strength of the synapse.
|
void |
setUpperBound(double d)
Sets the upper synapse bound.
|
java.lang.String |
toString() |
void |
update()
Update this synapse using its current learning rule.
|
void |
weaken()
Decrease the absolute value of this weight by increment amount.
|
public Synapse(Neuron source, Neuron target)
source
- source neurontarget
- target neuronpublic Synapse(Neuron source, Neuron target, double initialStrength)
source
- source neurontarget
- target neuroninitialStrength
- initial strength for synapsepublic Synapse(Network newParent, Neuron source, Neuron target, SynapseUpdateRule learningRule)
newParent
- new parent network for this synapse.source
- source neurontarget
- target neuronlearningRule
- update rule for this synapsepublic Synapse(Neuron source, Neuron target, SynapseUpdateRule learningRule)
source
- source neurontarget
- target neuronlearningRule
- update rule for this synapsepublic Synapse(Network newParent, Neuron source, Neuron target, SynapseUpdateRule learningRule, Synapse templateSynapse)
newParent
- new parent network for this synapse. Used when copying
and pasting to new network.source
- source neurontarget
- target neuronlearningRule
- update rule for this synapsetemplateSynapse
- synapse with parameters to copypublic Synapse(Neuron source, Neuron target, SynapseUpdateRule learningRule, Network parent)
source
- source neurontarget
- target neuronlearningRule
- update rule for this synapseparent
- parent network for this synapse.public Synapse(Network newParent, Synapse synapse)
newParent
- new parent networksynapse
- synapse to copypublic Synapse(Synapse s)
s
- Synapse to used as a template for constructing a new synapse.public static Synapse copyTemplateSynapse(Synapse s)
s
- the synapse to copypublic void initSpikeResponder()
public void update()
public double calcPSR()
public double calcWeightedSum()
public java.lang.String getType()
public Neuron getSource()
public Neuron getTarget()
public final double getStrength()
public void setStrength(double wt)
wt
- Strength valuepublic void forceSetStrength(double wt)
wt
- the value to set the strength of the synapse topublic double getUpperBound()
public void setUpperBound(double d)
d
- boundpublic double getLowerBound()
public void setLowerBound(double d)
d
- boundpublic double getIncrement()
public void setIncrement(double d)
d
- Increment amountpublic void incrementWeight()
public void decrementWeight()
public void reinforce()
public void weaken()
public void randomizeSymmetric()
public java.lang.String getToolTipText()
public Synapse getSymmetricSynapse()
public void randomize()
public void checkBounds()
public double clip(double value)
value
- Value to be checkedpublic java.lang.String getId()
public void setId(java.lang.String id)
id
- The id to set.public SpikeResponder getSpikeResponder()
public void setSpikeResponder(SpikeResponder sr)
sr
- The spikeResponder to set.public void setDelay(int dly)
dly
- Amount of delaypublic int getDelay()
public java.lang.String toString()
toString
in class java.lang.Object
public Network getParentNetwork()
public void setEnabled(boolean enabled)
enabled
- true if enabled, false otherwise.public boolean isEnabled()
public Network getNetwork()
public SynapseUpdateRule getLearningRule()
public void setLearningRule(SynapseUpdateRule newLearningRule)
newLearningRule
- the learningRule to setpublic static Synapse getTemplateSynapse()
instantiateTemplateSynapse
public static Synapse getTemplateSynapse(SynapseUpdateRule rule)
rule
- the learning rule.instantiateTemplateSynapse
public static java.util.List<SynapseUpdateRule> getRuleList(java.util.Collection<Synapse> synapseCollection)
synapseCollection
- The collection of synapses whose update rules we
want to query.public Synapse instantiateTemplateSynapse(Neuron source, Neuron target, Network parent)
source
- source neurontarget
- target neuronparent
- parent networkpublic SynapseGroup getParentGroup()
public void setParentGroup(SynapseGroup parentGroup)
parentGroup
- the parentGroup to setpublic void decay(double decayPercent)
decayPercent
- decay percentpublic boolean isFrozen()
public void setFrozen(boolean frozen)
frozen
- sets whether or not this synapses strength will be frozenpublic double getPsr()
public void setPsr(double psr)
psr
- set the post-synaptic responsepublic byte[] getNumericValuesAsByteArray()
public void decodeNumericByteArray(java.nio.ByteBuffer byteValues)
public void postUnmarshallingInit()