simbad.piconode.core.node
Class NeuralNetwork

java.lang.Object
  extended by simbad.piconode.core.node.Node
      extended by simbad.piconode.core.node.ConnectedNode
          extended by simbad.piconode.core.node.ModularNode
              extended by simbad.piconode.core.node.Module
                  extended by simbad.piconode.core.node.Network
                      extended by simbad.piconode.core.node.NeuralNetwork
All Implemented Interfaces:
java.io.Serializable, XmlRepresentation
Direct Known Subclasses:
FeedForwardNeuralNetwork, RecurrentNeuralNetwork, SelfOrganizingMap

public abstract class NeuralNetwork
extends Network
implements XmlRepresentation, java.io.Serializable

The NeuralNetwork class provides the minimal basis to define a neural network module.

See Also:
Serialized Form

Field Summary
protected  ActivationFunction _activationFunctionForArcsFromBiasNeuron
           
protected  java.util.ArrayList _allNeuronsUnorderedList
           
protected  java.util.ArrayList _biasArcList
           
protected  Neuron _biasNeuron
           
protected  boolean _containsBiasNeuron
           
protected  boolean _init
           
protected  java.util.ArrayList _inputNeuronsList
           
protected  java.util.ArrayList _outputNeuronsList
           
 
Fields inherited from class simbad.piconode.core.node.Network
_arcList, _nodeList
 
Fields inherited from class simbad.piconode.core.node.ConnectedNode
_incomingArcsList, _outgoingArcsList
 
Fields inherited from class simbad.piconode.core.node.Node
_name, nGene
 
Constructor Summary
NeuralNetwork()
          create a new network with no bias neuron.
NeuralNetwork(ActivationFunction __activationFunctionForArcsFromBiasNeuron)
          Create a new network that contains a bias neuron.
 
Method Summary
protected  void addBiasNeuron()
          Add a bias neuron and connect it to all node in the network
 boolean containsBiasNeuron()
           
 void displayInformation()
          display information on the neural network (structure, weight, learnable nodes, input and output values)
protected  WeightedArc getBiasArcAt(int __index)
           
 int getBiasArcListSize()
          return the number of Arcs *only* from bias neuron (may be useful when loading/saving weights (e.g.
protected  int getInputNeuronListSize()
           
protected  ConnectedNode getNodeAt(int __index)
           
protected  int getNodeListSize()
           
 int getNumberOfAllArcs()
          return the totat number of arcs including both standard arcs *and* "bias" arcs for which the source neuron is the bias neuron
 NeuronalNode getOutputNeuronAt(int __index)
          return a specific output neuron
 int getOutputNeuronListSize()
          return a list that contains all output neurons values
 java.util.ArrayList getWeightsFromAllArcs()
          return a list with weights values from *all* arcs (i.e.
 java.util.ArrayList getWeightsFromBiasArcs()
          get values for arcs for which the source is the bias neuron (useful for evolution (update arcs values through evolutionary process))
 java.util.ArrayList getWeightsFromStdArcs()
          return only values for arcs *excepting* those from the biased neuron - useful for evolution (update arcs values through evolutionary process)
 void registerArc(ConstrainedArc __arc)
          register a "standard" arc into the network.
protected  void registerBiasArc(WeightedArc __arc)
           
 void registerInputNeuron(NeuronalNode __neuron)
          specify an input neuron.
protected  void registerNode(ConnectedNode __neuron)
           
 void registerOutputNeuron(NeuronalNode __neuron)
          specify an output neuron.
 void setAllArcsWeightValues(java.util.ArrayList __list)
           
 void setBiasArcsWeightValues(java.util.ArrayList __valuesList)
          set values for arcs for which the source *is* the bias neuron (useful for evolution (update arcs values through evolutionary process))
 void setStdArcsWeightValues(java.util.ArrayList __valuesList)
          set values for arcs *excepting* arcs that are from the biased neuron - useful for evolution (update arcs values through evolutionary process)
 void stepModule()
          Perform one step on the whole Network.
 java.lang.String toXml()
          Thomas Darde TER NNEDITOR Provides an xml representation of this element Xml DTD is defined in visual piconode
 
Methods inherited from class simbad.piconode.core.node.Network
getArcAt, getArcListSize, updateGenotype
 
Methods inherited from class simbad.piconode.core.node.Module
getInputRegister, getInputRegisterSize, getOldOutputRegister, getOldOutputRegisterSize, getOutputRegister, getOutputRegisterSize, setInputRegister, setInputRegisterSize, setOldOutputRegister, setOldOutputRegisterSize, setOutputRegister, setOutputRegisterSize, step
 
Methods inherited from class simbad.piconode.core.node.ModularNode
isUpdated, setUpdated
 
Methods inherited from class simbad.piconode.core.node.ConnectedNode
addIncomingArc, addOutgoingArc, getIncomingArcAt, getIncomingArcsList, getIncomingArcsListSize, getOutgoingArcAt, getOutgoingArcsList, getOutgoingArcsListSize
 
Methods inherited from class simbad.piconode.core.node.Node
getName, getNGene, setName, setNGene, step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_outputNeuronsList

protected java.util.ArrayList _outputNeuronsList

_inputNeuronsList

protected java.util.ArrayList _inputNeuronsList

_biasNeuron

protected Neuron _biasNeuron

_containsBiasNeuron

protected boolean _containsBiasNeuron

_activationFunctionForArcsFromBiasNeuron

protected ActivationFunction _activationFunctionForArcsFromBiasNeuron

_biasArcList

protected java.util.ArrayList _biasArcList

_init

protected boolean _init

_allNeuronsUnorderedList

protected java.util.ArrayList _allNeuronsUnorderedList
Constructor Detail

NeuralNetwork

public NeuralNetwork()
create a new network with no bias neuron.


NeuralNetwork

public NeuralNetwork(ActivationFunction __activationFunctionForArcsFromBiasNeuron)
Create a new network that contains a bias neuron. Activation function for arcs from bias neuron is given as parameter.

Parameters:
__activationFunctionFromBiasNeuron -
Method Detail

addBiasNeuron

protected void addBiasNeuron()
Add a bias neuron and connect it to all node in the network


registerBiasArc

protected void registerBiasArc(WeightedArc __arc)

getBiasArcAt

protected WeightedArc getBiasArcAt(int __index)

containsBiasNeuron

public boolean containsBiasNeuron()

getInputNeuronListSize

protected int getInputNeuronListSize()

getNodeListSize

protected int getNodeListSize()
Overrides:
getNodeListSize in class Network

getNodeAt

protected ConnectedNode getNodeAt(int __index)
Overrides:
getNodeAt in class Network

getNumberOfAllArcs

public int getNumberOfAllArcs()
return the totat number of arcs including both standard arcs *and* "bias" arcs for which the source neuron is the bias neuron

Returns:

getWeightsFromAllArcs

public java.util.ArrayList getWeightsFromAllArcs()
return a list with weights values from *all* arcs (i.e. std+bias)

Returns:

setAllArcsWeightValues

public void setAllArcsWeightValues(java.util.ArrayList __list)

getBiasArcListSize

public int getBiasArcListSize()
return the number of Arcs *only* from bias neuron (may be useful when loading/saving weights (e.g. for evolution))

Returns:

getOutputNeuronListSize

public int getOutputNeuronListSize()
return a list that contains all output neurons values


getOutputNeuronAt

public NeuronalNode getOutputNeuronAt(int __index)
return a specific output neuron

Parameters:
__index -
Returns:

registerInputNeuron

public void registerInputNeuron(NeuronalNode __neuron)
specify an input neuron.


registerOutputNeuron

public void registerOutputNeuron(NeuronalNode __neuron)
specify an output neuron.

Parameters:
__neuron -

registerArc

public void registerArc(ConstrainedArc __arc)
register a "standard" arc into the network. in the special case of a neural network - arcs from the bias neuron are automaticaly registered Thus, the user should not explicitly register "bias" arc.

Overrides:
registerArc in class Network
Parameters:
__arc -

setStdArcsWeightValues

public void setStdArcsWeightValues(java.util.ArrayList __valuesList)
set values for arcs *excepting* arcs that are from the biased neuron - useful for evolution (update arcs values through evolutionary process)

Parameters:
__valuesList -

getWeightsFromStdArcs

public java.util.ArrayList getWeightsFromStdArcs()
return only values for arcs *excepting* those from the biased neuron - useful for evolution (update arcs values through evolutionary process)

Returns:

setBiasArcsWeightValues

public void setBiasArcsWeightValues(java.util.ArrayList __valuesList)
set values for arcs for which the source *is* the bias neuron (useful for evolution (update arcs values through evolutionary process))

Parameters:
__valuesList -

getWeightsFromBiasArcs

public java.util.ArrayList getWeightsFromBiasArcs()
get values for arcs for which the source is the bias neuron (useful for evolution (update arcs values through evolutionary process))

Parameters:
__valuesList -

displayInformation

public void displayInformation()
display information on the neural network (structure, weight, learnable nodes, input and output values)

Overrides:
displayInformation in class Network

registerNode

protected void registerNode(ConnectedNode __neuron)
Overrides:
registerNode in class Network

stepModule

public void stepModule()
Perform one step on the whole Network.

Specified by:
stepModule in class Module

toXml

public java.lang.String toXml()
Description copied from class: Network
Thomas Darde TER NNEDITOR Provides an xml representation of this element Xml DTD is defined in visual piconode

Specified by:
toXml in interface XmlRepresentation
Overrides:
toXml in class Network