Fido
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | Protected Attributes | List of all members
net::Trainer Class Referenceabstract

Trains neural networks. More...

#include <Trainer.h>

Inherited by net::SGDTrainer.

Public Member Functions

virtual double train (net::NeuralNet *network, const std::vector< std::vector< double > > &input, const std::vector< std::vector< double > > &correctOutput)=0
 Trains a neural network on a training set. More...
 
virtual void store (std::ofstream *output)=0
 Stores a Trainer object using specified stream. More...
 
std::vector< std::vector
< std::vector< std::vector
< double > > > > 
getGradients ()
 
std::vector< std::vector
< std::vector< std::vector
< double > > > > 
getWeightChanges ()
 
std::vector< std::vector
< std::vector< double > > > 
getInitialWeights ()
 
std::vector< std::vector
< std::vector< double > > > 
getFinalWeights ()
 

Protected Attributes

std::vector< std::vector
< std::vector< std::vector
< double > > > > 
gradients
 
std::vector< std::vector
< std::vector< std::vector
< double > > > > 
weightChanges
 
std::vector< std::vector
< std::vector< double > > > 
initialWeights
 
std::vector< std::vector
< std::vector< double > > > 
finalWeights
 

Detailed Description

Trains neural networks.

Member Function Documentation

std::vector< std::vector< std::vector<double> > > net::Trainer::getFinalWeights ( )
inline
std::vector< std::vector< std::vector< std::vector<double> > > > net::Trainer::getGradients ( )
inline
std::vector< std::vector< std::vector<double> > > net::Trainer::getInitialWeights ( )
inline
std::vector< std::vector< std::vector< std::vector<double> > > > net::Trainer::getWeightChanges ( )
inline
virtual void net::Trainer::store ( std::ofstream *  output)
pure virtual

Stores a Trainer object using specified stream.

Parameters
outputpointer to the output stream which the neural network will be written to

Implemented in net::SGDTrainer, net::Backpropagation, and net::Adadelta.

virtual double net::Trainer::train ( net::NeuralNet network,
const std::vector< std::vector< double > > &  input,
const std::vector< std::vector< double > > &  correctOutput 
)
pure virtual

Trains a neural network on a training set.

Edits the weights of the neural network until its error in predicting the correctOutput of each input reaches the value of targetErrorLevel or the number of training cycles reaches the value of maximumIterations.

Parameters
networkthe neural network to be trained
inputa vector of neural network inputs; each element in input, should have a corresponding output in correctOutput
correctOutputnetwork is trained to output an element of correctOutput when fed a corresponding element of the input vector

Implemented in net::SGDTrainer.

Member Data Documentation

std::vector< std::vector< std::vector<double> > > net::Trainer::finalWeights
protected
std::vector< std::vector< std::vector< std::vector<double> > > > net::Trainer::gradients
protected
std::vector< std::vector< std::vector<double> > > net::Trainer::initialWeights
protected
std::vector< std::vector< std::vector< std::vector<double> > > > net::Trainer::weightChanges
protected

The documentation for this class was generated from the following file: