class RecNeuralNet: public Graph

This class implements a generic (acylic) recurrent neural network, whose input is a labeled graph. It works much like a regular neural network, but uses BPTS instead of plain BP to calculate gradients. For this to work, the weights must be instances of RWeight. Also, (these conditions are not yet checked), the size of VI_R should be (at least, but there's no point in making it larger) equal to the size of VO_R times the maximum indegree of the input graphs.

Attributes:

std::vector<InputTerminal*> VI_L
The local input terminals, which get their values from the labels of nodes in the input graph.
std::vector<Neuron*> VI_R
The recurrent input terminals, they should be created as Neuron(id,one).
std::vector<Neuron*> VO_L
The local output neurons.
std::vector<Neuron*> VO_R
The recurrent output neurons, whose output get fed into the recurrent inputs.

Methods:

void setInput(const LabelGraph &str) throw (length_error)
Sets the network's input to the given graph. Unfolding of the network is performed at this stage. No check is performed
void setInput(const LabelNode &node) throw (length_error)
Can be called only after having set the input with the previous method. Allows to notify the network of the change on one label without redoing all the unfolding. No check is performed
void setInput(const LabelNode &node, const std::vector<double> &inV) throw (length_error)
Can be called only after having set the input with the first setInput() method. Allows to change the perceived label on the given node to be the given vector. No check is performed
void setDelta(const LabelNode &node, const std::vector<double> &deltaV) throw (length_error)
Sets the "delta" value relative to the local outputs of the given node to the given vector. No check is performed
void setRDelta(const LabelNode &node, const std::vector<double> &deltaV) throw (length_error)
Sets the "delta" value relative to the recurrent outputs of the given node to the given vector. Should only be used on "root" nodes.No check is performed
void value(const LabelNode &node, std::vector<double> *outV) throw (length_error)
Sets the given vector to the local outputs of the given node. No check is performed
void valueR(const LabelNode &node, std::vector<double> *outV) throw (length_error)
Sets the given vector to the recurrent outputs of the given node. No check is performed
void clean()
Removes all internal objects allocated after the unfolding, making the network ready for another input structure. It gets called automatically by setInput(const LabelGraph&).

Streamers:

ostream& operator<<(ostream &o,const RecNeuralNet &n)
Writes a representation of the network to the given stream. Uses writeNodes<>() and writeLinks<>(). The network is written in its folded state.
istream& operator>>(istream &i,RecNeuralNet &n)
Reads back a representation of a network from the given stream. Uses readNodes<>() and readLinks<>(), with NeuronInserter, ITInserter and LinkInserter.