public class Neuron extends Provider<INeuron>
Neuron class is a proxy implementation for the real neuron implementation in the class INeuron.
Aika uses the provider pattern to store and reload rarely used neurons or logic nodes.Provider.SuspensionMode| Modifier and Type | Field and Description |
|---|---|
NavigableMap<Synapse,Synapse> |
inMemoryInputSynapses |
NavigableMap<Synapse,Synapse> |
inMemoryOutputSynapses |
ReadWriteLock |
lock |
| Constructor and Description |
|---|
Neuron(Model m,
INeuron n) |
Neuron(Model m,
int id) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInMemoryInputSynapse(Synapse s) |
void |
addInMemoryOutputSynapse(Synapse s) |
Activation |
addInput(Document doc,
Activation.Builder inputAct)
Propagate an input activation into the network.
|
Activation |
addInput(Document doc,
int begin,
int end)
Propagate an input activation into the network.
|
Activation |
addInput(Document doc,
int begin,
int end,
Integer relationalId)
Propagate an input activation into the network.
|
void |
addSynapse(Document doc,
Synapse.Builder input) |
void |
addSynapse(Synapse.Builder input) |
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. |
String |
getLabel() |
boolean |
init(Document doc,
double bias,
String activationFunctionKey,
INeuron.Type type,
Collection<Synapse.Builder> inputs) |
static Neuron |
init(Document doc,
Neuron n,
double bias,
INeuron.Type type,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
static Neuron |
init(Document doc,
Neuron n,
double bias,
String activationFunctionKey,
INeuron.Type type,
Collection<Synapse.Builder> inputs)
Initializes a neuron with the given bias.
|
static Neuron |
init(Document doc,
Neuron n,
double bias,
String activationFunctionKey,
INeuron.Type type,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
boolean |
init(double bias,
String activationFunctionKey,
INeuron.Type type,
Collection<Synapse.Builder> inputs)
Initializes a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
INeuron.Type type,
Collection<Synapse.Builder> inputs)
Creates a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
INeuron.Type type,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
String activationFunctionKey,
INeuron.Type type,
Collection<Synapse.Builder> inputs)
Initializes a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
String activationFunctionKey,
INeuron.Type type,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
void |
removeInMemoryInputSynapse(Synapse s) |
void |
removeInMemoryOutputSynapse(Synapse s) |
public ReadWriteLock lock
public NavigableMap<Synapse,Synapse> inMemoryInputSynapses
public NavigableMap<Synapse,Synapse> inMemoryOutputSynapses
public String getLabel()
public Activation addInput(Document doc, int begin, int end)
doc - The current documentbegin - The range beginend - The range endpublic Activation addInput(Document doc, int begin, int end, Integer relationalId)
doc - The current documentbegin - The range beginend - The range endrelationalId - public Activation addInput(Document doc, Activation.Builder inputAct)
doc - The current documentinputAct - public static Neuron init(Neuron n, double bias, INeuron.Type type, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Document doc, Neuron n, double bias, INeuron.Type type, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Neuron n, double bias, String activationFunctionKey, INeuron.Type type, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Document doc, Neuron n, double bias, String activationFunctionKey, INeuron.Type type, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Neuron n, double bias, INeuron.Type type, Collection<Synapse.Builder> inputs)
n - bias - inputs - public static Neuron init(Neuron n, double bias, String activationFunctionKey, INeuron.Type type, Collection<Synapse.Builder> inputs)
n - bias - inputs - public static Neuron init(Document doc, Neuron n, double bias, String activationFunctionKey, INeuron.Type type, Collection<Synapse.Builder> inputs)
n - bias - inputs - public boolean init(double bias,
String activationFunctionKey,
INeuron.Type type,
Collection<Synapse.Builder> inputs)
bias - inputs - public boolean init(Document doc, double bias, String activationFunctionKey, INeuron.Type type, Collection<Synapse.Builder> inputs)
public void addSynapse(Synapse.Builder input)
public void addSynapse(Document doc, Synapse.Builder input)
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. getFinalActivations requires that the doc.process() method has been called first.doc - The current documentpublic void addInMemoryInputSynapse(Synapse s)
public void removeInMemoryInputSynapse(Synapse s)
public void addInMemoryOutputSynapse(Synapse s)
public void removeInMemoryOutputSynapse(Synapse s)
Copyright © 2018. All rights reserved.