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 |
NavigableMap<Integer,Synapse> |
inputSynapsesById |
ReadWriteLock |
lock |
static Neuron |
MAX_NEURON |
static Neuron |
MIN_NEURON |
| 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,
Range r)
Propagate an input activation into the network.
|
void |
addSynapse(Document doc,
Synapse.Builder input) |
void |
addSynapse(Synapse.Builder input) |
Activation |
getActivation(Document doc,
Range r,
boolean onlyFinal) |
Collection<Activation> |
getActivations(Document doc,
boolean onlyFinal)
getFinalActivations is a convenience method to retrieve all activations of the given neuron that
are part of the final interpretation. |
String |
getLabel() |
Synapse |
getSynapseById(int synapseId) |
boolean |
init(Document doc,
double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
List<Synapse.Builder> inputs) |
static Neuron |
init(Document doc,
Neuron n,
double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
List<Synapse.Builder> inputs)
Initializes a neuron with the given bias.
|
static Neuron |
init(Document doc,
Neuron n,
double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
static Neuron |
init(Document doc,
Neuron n,
double bias,
INeuron.Type type,
INeuron.LogicType logicType,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
boolean |
init(double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
List<Synapse.Builder> inputs)
Initializes a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
List<Synapse.Builder> inputs)
Initializes a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
INeuron.Type type,
INeuron.LogicType logicType,
List<Synapse.Builder> inputs)
Creates a neuron with the given bias.
|
static Neuron |
init(Neuron n,
double bias,
INeuron.Type type,
INeuron.LogicType logicType,
Synapse.Builder... inputs)
Creates a neuron with the given bias.
|
static void |
registerPassiveInputNeuron(Neuron n,
PassiveInputFunction f) |
void |
removeInMemoryInputSynapse(Synapse s) |
void |
removeInMemoryOutputSynapse(Synapse s) |
String |
toString() |
public static final Neuron MIN_NEURON
public static final Neuron MAX_NEURON
public ReadWriteLock lock
public NavigableMap<Integer,Synapse> inputSynapsesById
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, Range r)
doc - The current documentr - The rangepublic Activation addInput(Document doc, Activation.Builder inputAct)
doc - The current documentinputAct - public static Neuron init(Neuron n, double bias, INeuron.Type type, INeuron.LogicType logicType, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Document doc, Neuron n, double bias, INeuron.Type type, INeuron.LogicType logicType, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Neuron n, double bias, ActivationFunction activationFunction, INeuron.Type type, INeuron.LogicType logicType, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Document doc, Neuron n, double bias, ActivationFunction activationFunction, INeuron.Type type, INeuron.LogicType logicType, Synapse.Builder... inputs)
n - bias - inputs - public static Neuron init(Neuron n, double bias, INeuron.Type type, INeuron.LogicType logicType, List<Synapse.Builder> inputs)
n - bias - inputs - public static Neuron init(Neuron n, double bias, ActivationFunction activationFunction, INeuron.Type type, INeuron.LogicType logicType, List<Synapse.Builder> inputs)
n - bias - inputs - public static Neuron init(Document doc, Neuron n, double bias, ActivationFunction activationFunction, INeuron.Type type, INeuron.LogicType logicType, List<Synapse.Builder> inputs)
n - bias - inputs - public boolean init(double bias,
ActivationFunction activationFunction,
INeuron.Type type,
INeuron.LogicType logicType,
List<Synapse.Builder> inputs)
bias - inputs - public boolean init(Document doc, double bias, ActivationFunction activationFunction, INeuron.Type type, INeuron.LogicType logicType, List<Synapse.Builder> inputs)
public void addSynapse(Synapse.Builder input)
public void addSynapse(Document doc, Synapse.Builder input)
public static void registerPassiveInputNeuron(Neuron n, PassiveInputFunction f)
public Synapse getSynapseById(int synapseId)
public Collection<Activation> getActivations(Document doc, boolean onlyFinal)
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 Activation getActivation(Document doc, Range r, boolean onlyFinal)
public void addInMemoryInputSynapse(Synapse s)
public void removeInMemoryInputSynapse(Synapse s)
public void addInMemoryOutputSynapse(Synapse s)
public void removeInMemoryOutputSynapse(Synapse s)
Copyright © 2018. All rights reserved.