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 |
| Modifier and Type | Field and Description |
|---|---|
double |
activationSum |
double |
bias |
TreeMap<Synapse,Synapse> |
inputSynapses |
boolean |
isBlocked |
String |
label |
ReadWriteLock |
lock |
static int |
MAX_SELF_REFERENCING_DEPTH |
double |
maxRecurrentSum |
double |
negDirSum |
double |
negRecSum |
Provider<OrNode> |
node |
boolean |
noTraining |
int |
numberOfActivations |
TreeMap<Synapse.Key,Provider<InputNode>> |
outputNodes |
double |
posRecSum |
static double |
TOLERANCE |
static double |
WEIGHT_TOLERANCE |
lastUsedDocumentId, provider| Constructor and Description |
|---|
INeuron(Model m) |
INeuron(Model m,
String label) |
INeuron(Model m,
String label,
boolean isBlocked,
boolean noTraining) |
| Modifier and Type | Method and Description |
|---|---|
Activation |
addInput(Document doc,
int begin,
int end,
Integer rid,
InterprNode o,
double value)
Propagate an input activation into the network.
|
static INeuron |
addSynapse(Model m,
int threadId,
Neuron pn,
double biasDelta,
Synapse s) |
double |
avgActivation() |
int |
compareTo(INeuron n) |
void |
computeBounds(Activation act) |
void |
computeErrorSignal(Document doc,
Activation act) |
Activation.State |
computeWeight(int round,
Activation act,
SearchNode sn,
Document doc) |
void |
count(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. |
Synapse |
getInputSynapse(Synapse s) |
static Neuron |
init(Model m,
int threadId,
Neuron pn,
double bias,
Set<Synapse> inputs) |
void |
linkNeuronRelations(Document doc,
Activation act)
Sets the incoming and outgoing links between neuron activations.
|
void |
propagateAddedActivation(Document doc,
Activation act) |
void |
propagateRemovedActivation(Document doc,
NodeActivation act) |
void |
publish() |
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 |
removeInput(Document doc,
int begin,
int end,
Integer rid,
InterprNode o) |
static double |
sigmoid(double x) |
void |
suspend() |
String |
toString() |
String |
toStringWithSynapses() |
void |
train(Document doc,
Activation targetAct,
double learnRate,
TrainConfig.SynapseEvaluation se) |
static double |
transferFunction(double x) |
static void |
unlinkNeuronRelations(Document doc,
Activation act) |
void |
unpublish() |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
readpublic static double WEIGHT_TOLERANCE
public static double TOLERANCE
public static int MAX_SELF_REFERENCING_DEPTH
public String label
public volatile double bias
public volatile double negDirSum
public volatile double negRecSum
public volatile double posRecSum
public volatile double maxRecurrentSum
public TreeMap<Synapse.Key,Provider<InputNode>> outputNodes
public boolean isBlocked
public boolean noTraining
public volatile double activationSum
public volatile int numberOfActivations
public ReadWriteLock lock
public INeuron(Model m)
public Activation addInput(Document doc, int begin, int end, Integer rid, InterprNode o, double value)
doc - The current documentbegin - The range beginend - The range endrid - The relational id (e.g. the word position)o - The interpretation nodevalue - The activation value of this input activationpublic void removeInput(Document doc, int begin, int end, Integer rid, InterprNode o)
public double avgActivation()
public void publish()
public void unpublish()
public void remove()
public void propagateAddedActivation(Document doc, Activation act)
public void propagateRemovedActivation(Document doc, NodeActivation act)
public void computeBounds(Activation act)
public Activation.State computeWeight(int round, Activation act, SearchNode sn, Document doc)
public void computeErrorSignal(Document doc, Activation act)
public void train(Document doc, Activation targetAct, double learnRate, TrainConfig.SynapseEvaluation se)
public static double transferFunction(double x)
public static double sigmoid(double x)
public void count(Document doc)
public void linkNeuronRelations(Document doc, Activation act)
doc - act - public static void unlinkNeuronRelations(Document doc, Activation act)
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 INeuron addSynapse(Model m, int threadId, Neuron pn, double biasDelta, Synapse s)
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 documentCopyright © 2017. All rights reserved.