BaseNeuralNet Class Reference

The Base Neural Network Class. More...

Inheritance diagram for BaseNeuralNet:

Inheritance graph
[legend]
Collaboration diagram for BaseNeuralNet:

Collaboration graph
[legend]
List of all members.

Constructors

 BaseNeuralNet ()
 ~BaseNeuralNet ()

Interface

void addCluster (Cluster *c, bool isInput=false, bool isOutput=false)
void addInputCluster (Cluster *c)
void addOutputCluster (Cluster *c)
bool removeCluster (Cluster *c)
void markAsInput (Cluster *c)
void markAsOutput (Cluster *c)
void unmark (Cluster *c)
void unmarkAll ()
bool isIsolated (Cluster *c) const
const ClusterVecclusters () const
const ClusterVecinputClusters () const
const ClusterVecoutputClusters () const
const ClusterVechiddenClusters () const
void addLinker (Linker *l)
bool removeLinker (Linker *)
const LinkerVeclinkers () const
const LinkerVeclinkers (Cluster *c, bool out=false) const
void setOrder (Updatable *updatables[], u_int dim)
void setOrder (const UpdatableVec &)
const UpdatableVecorder () const
void step ()
void randomize (Real min, Real max)
template<class PointerTo>
PointerTo byName (const char *aName, PointerTo &aPointer)
UpdatablegetByName (const char *)
bool find (const Cluster *) const
bool find (const Linker *) const
bool find (const Updatable *) const
BaseNeuralNetclone () const

Protected Attributes

ClusterVec clustersv
ClusterVec inclusters
ClusterVec outclusters
ClusterVec hidclusters
LinkerVec linkersv
ClustersMap clsMap
IdsMap clsIdsMap
LinkVecMap inLinks
LinkVecMap outLinks
LinkersMap lksMap
UpdatableVec ups

Detailed Description

The BaseNeuralNetwork class can seen as a simple container of Clusters and Linkers
The relationship among Clusters and Linkers must be specified by cluster and linker constructors;


Constructor & Destructor Documentation

BaseNeuralNet (  ) 

Construct an empty neural network

~BaseNeuralNet (  ) 

Destructor


Member Function Documentation

void addCluster ( Cluster c,
bool  isInput = false,
bool  isOutput = false 
)

Add a Cluster into the neural network
If isInput is true then the Cluster will be considered as an Input Cluster of this network
If isOutput is true then the Cluster will be considered as an Output Cluster of this network

void addInputCluster ( Cluster c  )  [inline]

Add a Cluster and mark it as Input
Behave exactly the same of addCluster( c, true, false )

void addOutputCluster ( Cluster c  )  [inline]

Add a Cluster and mark it as Output
Behave exactly the same of addCluster( c, false, true )

bool removeCluster ( Cluster c  ) 

Remove a Cluster from the network

void markAsInput ( Cluster c  ) 

Mark a Cluster as an Input Cluster of this network

void markAsOutput ( Cluster c  ) 

Mark a Cluster as an Output Cluster of this network

void unmark ( Cluster c  ) 

Eliminate the marks from Cluster passed

Warning:
if a Cluster have two marker (Input and Output marks) then both marker are removed

void unmarkAll (  ) 

Eliminate the marks from all Cluster present in this networks

bool isIsolated ( Cluster c  )  const

Return true if there isn't Linkers connected with Cluster c

const ClusterVec& clusters (  )  const

Returns the vector of Clusters contained

const ClusterVec& inputClusters (  )  const

Returns the vector of Input Clusters contained

const ClusterVec& outputClusters (  )  const

Returns the vector of Output Clusters contained

const ClusterVec& hiddenClusters (  )  const

Returns the vector of Hidden Clusters contained (i.e. UnMarked Clusters)

void addLinker ( Linker l  ) 

Add Linker

bool removeLinker ( Linker  ) 

Remove Linker

const LinkerVec& linkers (  )  const

Returns the array of Linkers contained

const LinkerVec& linkers ( Cluster c,
bool  out = false 
) const

If out is true, return the Linkers outgoing from Cluster c, otherwise return incoming Linkers

void setOrder ( Updatable updatables[],
u_int  dim 
)

Set the order

void setOrder ( const UpdatableVec  ) 

Set the order

const UpdatableVec& order (  )  const [inline]

Return the order

void step (  )  [inline]

Step

void randomize ( Real  min,
Real  max 
)

This randomize the free parameters of the all elements of the neural net
This method call randomize method of every Cluster and Linker inserted

Parameters:
min is the lower-bound of random number generator desired
max is the upper-bound of random number generator desired

PointerTo byName ( const char *  aName,
PointerTo &  aPointer 
) [inline]

Search into the net for the presence of an Updatable with name aName; on success set the pointer aPointer and return it, otherwise it set aPointer to zero and return zero.
This allow to use it both into an if-statement and an assignment:

  BiasedCluster* bias1;
  BiasedCluster* bias2;
  if ( byName("aName", bias1 ) ) {
      //--- ok, there is a BiasedCluster with name "aName"
      //--- now bias1 points to the BiasedCluster with name "aName"
  } else {
      //--- error, there is no BiasedCluster with that name
      //--- now bias1 is NULL
  }
  //--- you can also use it for assignment:
  bias2 = byName("aName", bias1);

Updatable* getByName ( const char *   ) 

Return the Updatable with the name specified
Returns NULL-pointer if there's no updatable object whit the name specified

Warning:
return the first that finds. If you have named different Updatables with same name there no way to retrieve all of them with this methods... call them with unique name ;-)

bool find ( const Cluster  )  const

Return true if the Cluster is in this net

bool find ( const Linker  )  const

Return true if the Linker is in this net

bool find ( const Updatable  )  const

Return true if the Updatable object is in this net

BaseNeuralNet* clone (  )  const [virtual]

Clone this BaseNeuralNet

Implements Clonable.


Member Data Documentation

ClusterVec clustersv [protected]

Clusters

ClusterVec inclusters [protected]

Input Clusters

ClusterVec outclusters [protected]

Output Clusters

ClusterVec hidclusters [protected]

unmarked Clusters

LinkerVec linkersv [protected]

Linkers

ClustersMap clsMap [protected]

map name -> Cluster*

IdsMap clsIdsMap [protected]

map Cluster* -> indexes where it is into vectors

LinkVecMap inLinks [protected]

mappa dei linkers entranti (cluster -> vettore linkers entranti)

LinkVecMap outLinks [protected]

map of outgoing linkers (cluster -> vettore linkers uscenti)

LinkersMap lksMap [protected]

map name -> Cluster*

UpdatableVec ups [protected]

Array of Updateables ordered as specified


The documentation for this class was generated from the following file:
BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!