public class Synapse extends Object implements Writable
Synapse class connects two neurons with each other. When propagating an activation signal, the
weight of the synapse is multiplied with the activation value of the input neurons activation. The result is then added
to the output neurons weighted sum to compute the output activation value. In contrast to a conventional neural network
synapses in Aika do not just propagate the activation value from one neuron to the next, but also structural information
like the text range and the relational id (e.g. word position) and also the interpretation to which the input
activation belongs. To determine in which way the structural information should be propagated synapses in Aika possess
a few more properties.
The properties relativeRid and absoluteRid determine either the relative difference between
the rid of the input activation and the rid of the output activation or require a fixed rid as input.
The properties range match, range mapping and range output manipulate the ranges. The range match determines whether the input range begin or end is required to be equal, greater than or less than the range of the output activation. The range mapping can be used to map for example an input range end to an output range begin. Usually this simply maps begin to begin and end to end. The range output property is a boolean flag which determines whether the input range should be propagated to the output activation.
Furthermore, the property isRecurrent specifies if this synapse is a recurrent feedback link. Recurrent
feedback links can be either negative or positive depending on the weight of the synapse. Recurrent feedback links
kind of allow to use future information as inputs of a current neuron. Aika allows this by making assumptions about
the recurrent input neuron. The class SearchNode modifies these assumptions until the best interpretation
for this document is found.
| Modifier and Type | Class and Description |
|---|---|
static class |
Synapse.Builder
The
Builder class is just a helper class which is used to initialize a neuron. |
static class |
Synapse.State |
| Modifier and Type | Field and Description |
|---|---|
double |
bias |
double |
biasDelta |
int |
committedInDoc |
static double |
CONJUNCTION_THRESHOLD |
int |
createdInDoc |
static double |
DISJUNCTION_THRESHOLD |
DistanceFunction |
distanceFunction |
Writable |
extension |
Integer |
id |
boolean |
identity |
boolean |
inactive |
Neuron |
input |
static Comparator<Synapse> |
INPUT_SYNAPSE_COMP |
boolean |
isConjunction |
boolean |
isDisjunction |
boolean |
isRecurrent |
double |
limit |
double |
limitDelta |
Neuron |
output |
static int |
OUTPUT |
static Comparator<Synapse> |
OUTPUT_SYNAPSE_COMP |
Map<Integer,Relation> |
relations |
boolean |
toBeDeleted |
static int |
VARIABLE |
double |
weight
The weight of this synapse.
|
double |
weightDelta
The weight delta of this synapse.
|
| Constructor and Description |
|---|
Synapse() |
Synapse(Neuron input,
Neuron output,
Integer id) |
| Modifier and Type | Method and Description |
|---|---|
static Synapse |
createOrLookup(Document doc,
Integer synapseId,
Neuron inputNeuron,
Neuron outputNeuron) |
boolean |
exists() |
double |
getMaxInputValue() |
double |
getNewBias() |
double |
getNewWeight() |
Relation |
getRelationById(Integer id) |
boolean |
isConjunction(Synapse.State state) |
boolean |
isDisjunction(Synapse.State state) |
boolean |
isNegative() |
void |
link() |
boolean |
linksAnyOutput() |
Set<Integer> |
linksOutput() |
static Synapse |
read(DataInput in,
Model m) |
void |
readFields(DataInput in,
Model m)
Deserialize the fields of this object from
in. |
void |
relink() |
String |
toString() |
void |
unlink() |
void |
update(Document doc,
double weight,
double bias,
double limit) |
void |
updateDelta(Document doc,
double weightDelta,
double biasDelta,
double limitDelta) |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
public static final int OUTPUT
public static final int VARIABLE
public static double DISJUNCTION_THRESHOLD
public static double CONJUNCTION_THRESHOLD
public static final Comparator<Synapse> INPUT_SYNAPSE_COMP
public static final Comparator<Synapse> OUTPUT_SYNAPSE_COMP
public Neuron input
public Neuron output
public Integer id
public boolean isRecurrent
public boolean identity
public DistanceFunction distanceFunction
public Writable extension
public boolean inactive
public double weight
public double weightDelta
public double bias
public double biasDelta
public double limit
public double limitDelta
public boolean toBeDeleted
public boolean isConjunction
public boolean isDisjunction
public int createdInDoc
public int committedInDoc
public void link()
public void relink()
public void unlink()
public double getMaxInputValue()
public boolean exists()
public boolean isConjunction(Synapse.State state)
public boolean isDisjunction(Synapse.State state)
public void updateDelta(Document doc, double weightDelta, double biasDelta, double limitDelta)
public void update(Document doc, double weight, double bias, double limit)
public boolean isNegative()
public void write(DataOutput out) throws IOException
Writableout.write in interface Writableout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in, Model m) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.IOExceptionpublic static Synapse read(DataInput in, Model m) throws IOException
IOExceptionpublic static Synapse createOrLookup(Document doc, Integer synapseId, Neuron inputNeuron, Neuron outputNeuron)
public double getNewWeight()
public double getNewBias()
public boolean linksAnyOutput()
Copyright © 2018. All rights reserved.