|
Neural Network Software | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.practicalstudies.neural.Neuron
A framework class representing a neuron in an artificial neural network.
Node,
WeightedConnection| Constructor Summary | |
Neuron(Adder adder,
ActivationFunction activationFunction)
Constructor. |
|
| Method Summary | |
int |
addInputConnection(WeightedConnection inputConnection)
Add an input connection to this neuron. |
int |
addOutputConnection(WeightedConnection outputConnection)
Add an output connection to this neuron. |
double |
calculateActivation()
Calculate the output of this neuron. |
void |
clearInputConnections()
Remove all input connections from this neuron. |
void |
clearOutputConnections()
Remove all output connections from this neuron. |
WeightedConnection |
getInputConnection(int index)
Return a specific input connection to this neuron. |
java.util.List |
getInputConnections()
Returns a List of WeightedConnections which are the input connections
to this neuron. |
int |
getNumberInputConnections()
Returns the number of input connections to this neuron. |
int |
getNumberOutputConnections()
Returns the number of output connections from this neuron. |
double |
getOutput()
Return the output of this neuron. |
WeightedConnection |
getOutputConnection(int index)
Return a specific output connection to this neuron. |
java.util.List |
getOutputConnections()
Returns a List of WeightedConnections which are the output connections
to this neuron. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Neuron(Adder adder,
ActivationFunction activationFunction)
adder - an Adder object for summing inputs to this neuronactivationFunction - an ActivationFunction for calculating
the output of this neuron based on the inputs| Method Detail |
public final int getNumberInputConnections()
getNumberInputConnections in interface Nodepublic final void clearInputConnections()
clearInputConnections in interface Nodepublic int addInputConnection(WeightedConnection inputConnection)
addInputConnection in interface NodeinputConnection - a WeightedConnection that will serve as an
additional input connection to this neuron
public WeightedConnection getInputConnection(int index)
getInputConnection in interface Nodeindex - the ordinal number of the input connection, based on the order in which connections were
to this neuron
WeightedConnection representing the connection requestedpublic java.util.List getInputConnections()
WeightedConnections which are the input connections
to this neuron.
getInputConnections in interface Nodepublic final int getNumberOutputConnections()
getNumberOutputConnections in interface Nodepublic final void clearOutputConnections()
clearOutputConnections in interface Nodepublic int addOutputConnection(WeightedConnection outputConnection)
addOutputConnection in interface NodeoutputConnection - a WeightedConnection that will serve as an
additional output connection to this node
public WeightedConnection getOutputConnection(int index)
getOutputConnection in interface Nodeindex - the ordinal number of the output connection, based on the order in which connections were
to this neuron
WeightedConnection representing the connection requestedpublic java.util.List getOutputConnections()
WeightedConnections which are the output connections
to this neuron.
getOutputConnections in interface Nodepublic double calculateActivation()
Calculate the output of this neuron.
This method performs three actions:
Adder associated with this neuron to calculate the neuron's input;ActivationFunction associated with this neuron to
calculate the neuron's output; and,getOutput
method.
public double getOutput()
Return the output of this neuron.
This method will not calculate the output; {@link #calculateActivation() calculateActivation should be called first to ensure that the output is correct. This method exists to avoid the need for repetitive (possibly costly) calculation of the output.
getOutput in interface Node
|
PracticalStudies.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||