20 #ifndef SUPERNN_TRAINING_HPP
21 #define SUPERNN_TRAINING_HPP
58 unsigned max_epochs = 1000) = 0;
77 virtual double delta(
Network &net,
unsigned l,
unsigned n);
116 virtual unsigned train(
Network &net,
const Data &data,
double dmse,
unsigned max_epochs) = 0;
151 virtual void update_eta(
double mse,
double last_mse);
162 virtual unsigned train(
Network &net,
const Data &data,
double dmse = 0,
unsigned max_epochs = 1000);
173 virtual unsigned train(
Network &net,
const Data &data,
double dmse = 0,
unsigned max_epochs = 1000);
188 virtual unsigned train(
Network &net,
const Data &data,
double dmse = 0,
unsigned max_epochs = 1000);
238 unsigned train(
Network &net,
const Data &data,
double dmse = 0,
unsigned max_epochs = 100);
252 double delta(
Network &net,
unsigned l,
unsigned n,
unsigned m);
259 void get_weights(
const Network &net);
266 void set_weights(
Network &net)
const;
274 void calc_jacobian_transp_line(
Network &net,
unsigned m);
282 void update_hessian_gradient(
double err);
288 void update_weights(
Network &net);
298 bool update_mu(
double mse,
double last_mse);
321 unsigned k = 10,
double dmse = 0,
unsigned max_epochs = 1000);
340 const SuperNN::Data &validation,
int step_size = 1,
int max_stuck = 20,
int max_epochs = 1000);
double eta_df
Learning rate decrease factor (must be <= 1)
virtual void check(const Network &net, const Data &data) const
Checks if the dimensions match and if the training algorithm can be used with a given network and dat...
void prepare(Network &net)
Prepares the trainer and a neural network for training.
Modified improved resilient backpropagation algorithm.
virtual unsigned train(Network &net, const Data &data, double dmse=0, unsigned max_epochs=1000)
Adjusts the synaptic weight of an artificial neural network in order to minimize the error (MSE for s...
Abstract class that provides the calculation of the error derivatives and the error accumulation...
virtual void prepare(Network &net)
Prepares the trainer and a neural network for training.
Incremental backpropagation.
unsigned early_stopping(TrainingAlgorithm &algo, Network &net, const Data &training, const SuperNN::Data &validation, int step_size=1, int max_stuck=20, int max_epochs=1000)
Trains an artificial neural network by using early stopping in order to avoid over-fitting.
virtual void derror_acc(Network &net)
Accumulates the error partial derivative in respect to the weights, for each connection of the neural...
double delta_zero
Initial weight change.
virtual void update_weights(Network &net)
Updates the weights, using the partial error derivative sign change as guide.
virtual void update_eta(double mse, double last_mse)
Calculates the new learning rate (and updates it), based on the mean squared error last change...
virtual void update_weights(Network &net, double factor=1)
Updates the weights using the accumulated error partial derivative calculated by derror_acc().
Improved resilient backpropagation algorithm.
double eta_max
Maximum learning rate.
double delta_if
Weight change increase factor.
virtual unsigned train(Network &net, const Data &data, double dmse=0, unsigned max_epochs=1000)
Adjusts the synaptic weight of an artificial neural network in order to minimize the error (MSE for s...
virtual unsigned train(Network &net, const Data &data, double dmse=0, unsigned max_epochs=1000)
Adjusts the synaptic weight of an artificial neural network in order to minimize the error (MSE for s...
double delta_df
Weight change decrease factor.
virtual void prepare(Network &net)
Prepares the trainer and a neural network for training.
double eta_min
Minimum learning rate.
virtual ~TrainingAlgorithm()
Neuron by Neuron algorithm.
Base class for the standard backpropagation algorithm.
double eta_if
Learning rate increase factor (must be >= 1)
virtual double delta(Network &net, unsigned l, unsigned n)
Calculates the local error gradient for each neuron.
double delta(Network &net, unsigned l, unsigned n)
Calculates the local error gradient for each neuron.
double eta
Initial learning rate.
Artificial neural network structure that supports arbitrary feedforward topologies, like multilayer perceptrons and fully connected cascade networks.
unsigned train(Network &net, const Data &data, double dmse=0, unsigned max_epochs=100)
Adjusts the synaptic weight of an artificial neural network in order to minimize the error (MSE for s...
virtual void clear_derror_acc(Network &net)
Clears the accumulated error partial derivatives.
virtual unsigned train(Network &net, const Data &data, double dmse, unsigned max_epochs)=0
Adjusts the synaptic weight of an artificial neural network in order to minimize the error (MSE for s...
Data used in training, validation and testing.
double delta_max
Maximum weight change.
double k_fold_error(TrainingAlgorithm &algo, const SuperNN::Network &net, const Data &data, unsigned k=10, double dmse=0, unsigned max_epochs=1000)
Estimates the performance of a neural network for an independent data set by using k-fold cross valid...
double delta_min
Minimum weight change.
virtual unsigned train(Network &net, const Data &data, double dmse=0, unsigned max_epochs=1000)=0
Adjusts the synaptic weight of an artificial neural network in order to minimize the error (MSE for s...