Skip to content

LSTMBackPropagator Class

This class is responsible for backpropagating the associated LSTM neural network according to it's set optimizer. It is heavily modified and in places completely changed in order to work with LSTM systems.

LSTMBackPropagator .new(NeuralNetwork neuralNetwork) Creates and returns the LSTMBackPropagator with the given !neuralNetwork!.
void :Reset() Resets all saved gradients and costs.

Caution

:CalculateCosts() must be used at least once before :Learn()

void :Learn() Uses the calculated costs up to this point and the associated network's optimizer to backpropagate the network parameters. :Reset() is called when finished.

Tuple :CalculateCost(dictionary inputValues,dictionary correctOutputValues) Calculates the cost values for each node when the network is ran with !inputValues! and the output is compared to the given !correctOutputValues!. This function can be called multiple times before :Learn() as it will simply average the cost values over time.// dictionary CostValues, dictionary outputValues

Inherited from BackPropagator:

Only unchanged and unmodified functions are listed below.

dictionary :GetCost() Returns the cost values for the BackPropagator. See :Reset()'s code if you want to know the structure as it is for internal use.// {Outputs = dictionary, Activations = dictionary}
number :GetTotalCost() Takes the square cost of every output node and adds it all up to calculate the total cost number and returns it. This is the prime indicator for how well the network is training with backpropagation.