|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.nengo.model.plasticity.impl.CompositePlasticityRule
public class CompositePlasticityRule
A PlasticityRule that delegates to underlying spike-based and rate-based rules. This enables switching between rate and spiking modes in simulations with plasticity. The spike-based rule is used whenever activity at both the plastic termination and at least one origin are of type SpikeOutput. If either none of the origins has spiking activity, or the plastic termination doesn't receive spiking input, or both, then the rate-based rule is used. The type of input to other (potentially modulatory) terminations is not considered.
Note that using this class introduces substantial overhead. It may be worthwhile to switch rules manually, or to handle both types explicitly in a custom rule implementation.
TODO: test
Nested Class Summary | |
---|---|
static class |
CompositePlasticityRule.NullRule
A null plasticity rule that always returns zeros from getDerivative(). |
Constructor Summary | |
---|---|
CompositePlasticityRule()
Defaults to NullRule s. |
|
CompositePlasticityRule(PlasticityRule spikeRule,
PlasticityRule realRule)
|
Method Summary | |
---|---|
PlasticityRule |
clone()
|
float[][] |
getDerivative(float[][] transform,
InstantaneousOutput input,
float time)
|
PlasticityRule |
getRealRule()
|
PlasticityRule |
getSpikeRule()
|
void |
reset(boolean randomize)
|
void |
setModTerminationState(java.lang.String name,
InstantaneousOutput state,
float time)
Provides potentially modulatory input to the rule. |
void |
setOriginState(java.lang.String name,
InstantaneousOutput state,
float time)
Provides state or functional output, which may serve as an indication of postsynaptic activity (used in Hebbian learning). |
void |
setRealRule(PlasticityRule rule)
|
void |
setSpikeRule(PlasticityRule rule)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositePlasticityRule(PlasticityRule spikeRule, PlasticityRule realRule)
spikeRule
- Rule to use when both inputs and outputs are spikingrealRule
- Rule to use when either input or output is real-valuedpublic CompositePlasticityRule()
NullRule
s.
Method Detail |
---|
public void reset(boolean randomize)
reset
in interface Resettable
randomize
- True indicates that the object should be reset to a
randomly selected initial state (the object must be aware of the
distribution from which to draw from). False indicates that the
object should be reset to a fixed initial state (which it must
also know). Some objects may not support randomization of the initial
state, in which case a fixed state will be used in either case.Resettable.reset(boolean)
public PlasticityRule getSpikeRule()
public void setSpikeRule(PlasticityRule rule)
rule
- Rule to use when both inputs and outputs are spikingpublic PlasticityRule getRealRule()
public void setRealRule(PlasticityRule rule)
rule
- Rule to use when either input or output is real-valuedpublic float[][] getDerivative(float[][] transform, InstantaneousOutput input, float time)
getDerivative
in interface PlasticityRule
transform
- The present transformation matrix of a Terminationinput
- The present input to the Terminationtime
- Simulation time at which input arrives at site of plasticity
PlasticityRule.getDerivative(float[][], ca.nengo.model.InstantaneousOutput, float)
public void setOriginState(java.lang.String name, InstantaneousOutput state, float time)
PlasticityRule
setOriginState
in interface PlasticityRule
name
- The name of a DecodedOrigin from the ensemblestate
- The present value of output from the named Origintime
- Simulation time at which state arrives at site of plasticityPlasticityRule.setOriginState(java.lang.String, ca.nengo.model.InstantaneousOutput, float)
public void setModTerminationState(java.lang.String name, InstantaneousOutput state, float time)
PlasticityRule
setModTerminationState
in interface PlasticityRule
name
- The name of a DecodedTermination onto the ensemblestate
- The present value of output from the named Termination (may differ
from its input in terms of dynamics and dimension)time
- Simulation time at which state arrives at site of plasticityca.nengo.model.plasticity.PlasticityRule#setTerminationState(java.lang.String, ca.nengo.model.InstantaneousOutput, float)
public PlasticityRule clone() throws java.lang.CloneNotSupportedException
clone
in interface PlasticityRule
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |