public class INeuron extends AbstractNode<Neuron> implements Comparable<INeuron>
INeuron class represents a internal neuron implementation in Aikas neural network and is connected to other neurons through
input synapses and output synapses. The activation value of a neuron is calculated by computing the weighted sum
(input act. value * synapse weight) of the input synapses, adding the bias to it and sending the resulting value
through a transfer function (the upper part of tanh).
The neuron does not store its activations by itself. The activation objects are stored within the
logic nodes. To access the activations of this neuron simply use the member variable node or use
the method getFinalActivations(Document doc) to ge the final activations of this neuron.
| Modifier and Type | Class and Description |
|---|---|
static class |
INeuron.NormWeight |
static class |
INeuron.ThreadState
The
ThreadState is a thread local data structure containing the activations of a single document for
a specific logic node. |
static class |
INeuron.Type |
| Modifier and Type | Field and Description |
|---|---|
ActivationFunction |
activationFunction |
String |
activationFunctionKey |
static boolean |
ALLOW_WEAK_NEGATIVE_WEIGHTS |
double |
bias |
double |
biasDelta |
double |
biasSum |
double |
biasSumDelta |
TreeMap<Synapse,Synapse> |
inputSynapses |
String |
label |
ReadWriteLock |
lock |
static int |
MAX_SELF_REFERENCING_DEPTH |
double |
maxRecurrentSum |
double |
metaBias |
double |
negDirSum |
double |
negRecSum |
Provider<OrNode> |
node |
TreeMap<Synapse.Key,Provider<InputNode>> |
outputNodes |
TreeMap<Synapse,Synapse> |
outputSynapses |
String |
outputText |
double |
posDirSum |
double |
posRecSum |
Writable |
statistic |
INeuron.ThreadState[] |
threads |
static double |
TOLERANCE |
INeuron.Type |
type |
static double |
WEIGHT_TOLERANCE |
lastUsedDocumentId, provider| Constructor and Description |
|---|
INeuron(Model m) |
INeuron(Model m,
String label) |
INeuron(Model m,
String label,
String outputText) |
| Modifier and Type | Method and Description |
|---|---|
Activation |
addInput(Document doc,
Activation.Builder input)
Propagate an input activation into the network.
|
void |
clearActivations() |
void |
clearActivations(Document doc) |
void |
clearActivations(int threadId) |
int |
compareTo(INeuron n) |
void |
computeBounds(Activation act) |
Activation.State |
computeWeight(int round,
Activation act) |
Collection<Activation> |
getActivations(Document doc) |
Collection<Activation> |
getAllActivations(Document doc) |
Collection<Activation> |
getFinalActivations(Document doc)
getFinalActivations is a convenience method to retrieve all activations of the given neuron that
are part of the final interpretation. |
Activation |
getFirstActivation(Document doc) |
INeuron.ThreadState |
getThreadState(int threadId,
boolean create) |
void |
linkNeuronRelations(Document doc,
Activation act)
Sets the incoming and outgoing links between neuron activations.
|
void |
propagateAddedActivation(Document doc,
Activation act) |
void |
reactivate() |
void |
readFields(DataInput in,
Model m)
Deserialize the fields of this object from
in. |
static INeuron |
readNeuron(DataInput in,
Neuron p) |
void |
remove() |
void |
suspend() |
String |
toString() |
String |
toStringWithSynapses() |
static boolean |
update(Model m,
int threadId,
Neuron pn,
double biasDelta,
Collection<Synapse> modifiedSynapses) |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
read, setModifiedpublic static boolean ALLOW_WEAK_NEGATIVE_WEIGHTS
public static double WEIGHT_TOLERANCE
public static double TOLERANCE
public static int MAX_SELF_REFERENCING_DEPTH
public String label
public INeuron.Type type
public String outputText
public volatile double bias
public volatile double biasDelta
public volatile double biasSum
public volatile double biasSumDelta
public volatile double metaBias
public volatile double posDirSum
public volatile double negDirSum
public volatile double negRecSum
public volatile double posRecSum
public volatile double maxRecurrentSum
public Writable statistic
public ActivationFunction activationFunction
public String activationFunctionKey
public TreeMap<Synapse.Key,Provider<InputNode>> outputNodes
public ReadWriteLock lock
public INeuron.ThreadState[] threads
public INeuron(Model m)
public INeuron.ThreadState getThreadState(int threadId, boolean create)
public Activation addInput(Document doc, Activation.Builder input)
doc - The current documentinput - public void remove()
public void propagateAddedActivation(Document doc, Activation act)
public void computeBounds(Activation act)
public Activation.State computeWeight(int round, Activation act)
public void linkNeuronRelations(Document doc, Activation act)
doc - act - public Collection<Activation> getActivations(Document doc)
public Activation getFirstActivation(Document doc)
public void clearActivations()
public void clearActivations(Document doc)
public void clearActivations(int threadId)
public int compareTo(INeuron n)
compareTo in interface Comparable<INeuron>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 void suspend()
suspend in class AbstractNode<Neuron>public void reactivate()
reactivate in class AbstractNode<Neuron>public static boolean update(Model m, int threadId, Neuron pn, double biasDelta, Collection<Synapse> modifiedSynapses)
public static INeuron readNeuron(DataInput in, Neuron p) throws IOException
IOExceptionpublic String toStringWithSynapses()
public Collection<Activation> getFinalActivations(Document doc)
getFinalActivations is a convenience method to retrieve all activations of the given neuron that
are part of the final interpretation. Before calling this method, the doc.process() needs to
be called first.doc - The current documentpublic Collection<Activation> getAllActivations(Document doc)
Copyright © 2018. All rights reserved.