public class INeuron extends AbstractNode<Neuron,Activation> 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.ActKey |
static class |
INeuron.LogicType |
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 |
static boolean |
ALLOW_WEAK_NEGATIVE_WEIGHTS |
static Comparator<INeuron.ActKey> |
BEGIN_COMP |
double |
bias |
double |
biasDelta |
double |
biasSum |
double |
biasSumDelta |
static Comparator<INeuron.ActKey> |
END_COMP |
TreeMap<Synapse,Synapse> |
inputSynapses |
boolean |
isMeta |
String |
label |
ReadWriteLock |
lock |
INeuron.LogicType |
logicType |
double |
metaBias |
double |
negDirSum |
double |
negRecSum |
Provider<OrNode> |
node |
int |
numberOfInputSynapses |
int |
numDisjunctiveSynapses |
Provider<InputNode> |
outputNode |
Map<Integer,Relation> |
outputRelations |
TreeMap<Synapse,Synapse> |
outputSynapses |
String |
outputText |
PassiveInputFunction |
passiveInputFunction |
TreeMap<Synapse,Synapse> |
passiveInputSynapses |
double |
posDirSum |
double |
posPassiveSum |
double |
posRecSum |
double |
requiredSum |
Writable |
statistic |
INeuron.ThreadState[] |
threads |
static double |
TOLERANCE |
INeuron.Type |
type |
static double |
WEIGHT_TOLERANCE |
lastUsedDocumentId, modified, 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 |
changeBias(double bd) |
void |
clearActivations() |
void |
clearActivations(Document doc) |
void |
clearActivations(int threadId) |
int |
compareTo(INeuron n) |
Activation |
getActivation(Document doc,
Range r,
boolean onlyFinal) |
Collection<Activation> |
getActivations(Document doc,
boolean onlyFinal) |
double |
getNewBiasSum() |
INeuron.ThreadState |
getThreadState(int threadId,
boolean create) |
boolean |
isPassiveInputNeuron() |
void |
propagate(Activation act)
Propagate an activation to the next node or the next neuron that is depending on the current node.
|
void |
reactivate() |
void |
readFields(DataInput in,
Model m)
Deserialize the fields of this object from
in. |
static INeuron |
readNeuron(DataInput in,
Neuron p) |
void |
register(Activation act) |
void |
registerPassiveInputSynapse(Synapse s) |
void |
remove() |
void |
setBias(double b) |
void |
suspend() |
String |
toString() |
String |
toStringWithSynapses() |
static boolean |
update(int threadId,
Document doc,
Neuron pn,
Double bias,
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 String label
public INeuron.Type type
public INeuron.LogicType logicType
public String outputText
public volatile double bias
public volatile double biasDelta
public volatile double biasSum
public volatile double biasSumDelta
public volatile double posDirSum
public volatile double negDirSum
public volatile double negRecSum
public volatile double posRecSum
public volatile double posPassiveSum
public volatile double requiredSum
public volatile double metaBias
public volatile boolean isMeta
public volatile int numDisjunctiveSynapses
public Writable statistic
public ActivationFunction activationFunction
public int numberOfInputSynapses
public ReadWriteLock lock
public PassiveInputFunction passiveInputFunction
public INeuron.ThreadState[] threads
public static final Comparator<INeuron.ActKey> BEGIN_COMP
public static final Comparator<INeuron.ActKey> END_COMP
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 propagate(Activation act)
AbstractNodepropagate in class AbstractNode<Neuron,Activation>public Collection<Activation> getActivations(Document doc, boolean onlyFinal)
public Activation getActivation(Document doc, Range r, boolean onlyFinal)
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,Activation>public void reactivate()
reactivate in class AbstractNode<Neuron,Activation>public void setBias(double b)
public void changeBias(double bd)
public double getNewBiasSum()
public void register(Activation act)
public static boolean update(int threadId,
Document doc,
Neuron pn,
Double bias,
Collection<Synapse> modifiedSynapses)
public static INeuron readNeuron(DataInput in, Neuron p) throws IOException
IOExceptionpublic boolean isPassiveInputNeuron()
public void registerPassiveInputSynapse(Synapse s)
public String toStringWithSynapses()
Copyright © 2018. All rights reserved.