class RWeight: public Weight

This class implements the special weight required in recurrent neural networks to implement the BPTS algorithm. These weights can create duplicates of themselves, and their gradient value is calculated as the sum of the gradient values of the duplicates.


None public


Default constructor, calls Weight(), and inizializes the duplicates set to the empty set.
RWeight(double x)
Calls Weight(double x), and inizializes the duplicates set to the empty set.
CWeight *spawn()
Creates a duplicate of this weight, keeping track of it in the duplicates set.
bool mourn(CWeight *c)
Acknowledges the destruction of a duplicate by removing its pointer from the duplicates set. Returns false if the pointer is not present in the set.
double gradient()
Returns the gradient element relative to this weight, that is, the sum of gradient elements computed by all the duplicates currently present in the duplicates set.