Package network.aika.neuron
Class Synapse<S extends Synapse,I extends Neuron & Axon,O extends Neuron<?,OA>,L extends Link<S,IA,OA>,IA extends Activation,OA extends Activation>
java.lang.Object
network.aika.neuron.Synapse<S,I,O,L,IA,OA>
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
ConjunctiveSynapse
,DisjunctiveSynapse
public abstract class Synapse<S extends Synapse,I extends Neuron & Axon,O extends Neuron<?,OA>,L extends Link<S,IA,OA>,IA extends Activation,OA extends Activation>
extends Object
implements Writable
- Author:
- Lukas Molzberger
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected double
protected double
protected double
protected NeuronProvider
protected NeuronProvider
protected SampleSpace
protected S
protected DoubleField
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
allowPropagate
(Activation act) void
applyMovingAverage
(double alpha) protected boolean
checkCommonLinkingPreConditions
(IA iAct, OA oAct) boolean
checkLinkingPreConditions
(IA iAct, OA oAct) boolean
protected boolean
boolean
checkTemplateLinkingPreConditions
(IA iAct, OA oAct) void
abstract L
createLink
(IA input, OA output) void
forAllLinks
(Thought t, Consumer<Link> c) abstract List<Transition>
double
getFrequency
(Sign is, Sign os, double n) getInput()
getModel()
double
getProbability
(Sign si, Sign so, double n, boolean addCurrentInstance) abstract List<Transition>
double
getSurprisal
(Sign si, Sign so, Range range, boolean addCurrentInstance) byte
protected void
instantiateTemplate
(I input, O output) boolean
boolean
boolean
boolean
isOfTemplate
(Synapse templateSynapse) boolean
boolean
boolean
boolean
isZero()
boolean
linkExists
(IA iAct, OA oAct) void
void
static Synapse
void
readFields
(DataInput in, Model m) Deserialize the fields of this object fromin
.void
setAllowTraining
(boolean allowTraining) void
setFrequency
(Sign is, Sign os, double f) void
abstract void
void
void
setWeight
(double w) toString()
transition
(BindingSignal from, Direction dir, boolean propagate) void
void
abstract void
updateWeight
(L l, double delta) protected void
weightUpdate
(double u) void
write
(DataOutput out) Serialize the fields of this object toout
.
-
Field Details
-
input
-
output
-
template
-
weight
-
sampleSpace
-
frequencyIPosOPos
protected double frequencyIPosOPos -
frequencyIPosONeg
protected double frequencyIPosONeg -
frequencyINegOPos
protected double frequencyINegOPos -
allowTraining
protected boolean allowTraining
-
-
Constructor Details
-
Synapse
public Synapse()
-
-
Method Details
-
getLooseLinkingRange
-
allowLooseLinking
public boolean allowLooseLinking() -
isRecurrent
public boolean isRecurrent() -
checkRelatedBindingSignal
-
checkLinkingPreConditions
-
checkCommonLinkingPreConditions
-
linkExists
-
checkTemplateLinkingPreConditions
-
checkTemplateInductionThreshold
-
transition
-
getPropagateTransitions
-
getCheckTransitions
-
setModified
public abstract void setModified() -
allowPropagate
-
setInput
-
setOutput
-
instantiateTemplate
-
createLink
-
initFromTemplate
-
setWeight
public void setWeight(double w) -
updateWeight
-
isAllowTraining
public boolean isAllowTraining() -
setAllowTraining
public void setAllowTraining(boolean allowTraining) -
isTemplate
public boolean isTemplate() -
getTemplate
-
getTemplateInfo
-
isOfTemplate
-
getTemplateSynapseId
public byte getTemplateSynapseId() -
isInputLinked
public boolean isInputLinked() -
linkInput
public void linkInput() -
unlinkInput
public void unlinkInput() -
isOutputLinked
public boolean isOutputLinked() -
linkOutput
public void linkOutput() -
unlinkOutput
public void unlinkOutput() -
getPInput
-
getPOutput
-
getInput
-
getOutput
-
getSampleSpace
-
getFrequency
-
setFrequency
-
applyMovingAverage
public void applyMovingAverage(double alpha) -
count
-
getModel
-
getSurprisal
-
getProbability
-
getWeight
-
isZero
public boolean isZero() -
isNegative
public boolean isNegative() -
weightUpdate
protected void weightUpdate(double u) -
forAllLinks
-
write
Description copied from interface:Writable
Serialize the fields of this object toout
.- Specified by:
write
in interfaceWritable
- Parameters:
out
-DataOuput
to serialize this object into.- Throws:
IOException
-
read
- Throws:
IOException
-
readFields
Description copied from interface:Writable
Deserialize the fields of this object fromin
.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFields
in interfaceWritable
- Parameters:
in
-DataInput
to deseriablize this object from.- Throws:
IOException
-
toString
-