OpenANN  1.1.0
An open source library for artificial neural networks.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
OpenANN::Learner Class Referenceabstract

Common base class of all learning algorithms. More...

#include <Learner.h>

+ Inheritance diagram for OpenANN::Learner:

Public Member Functions

 Learner ()
 
virtual ~Learner ()
 
virtual Eigen::VectorXd operator() (const Eigen::VectorXd &x)=0
 Make a prediction. More...
 
virtual Eigen::MatrixXd operator() (const Eigen::MatrixXd &X)=0
 Make predictions. More...
 
virtual LearnertrainingSet (Eigen::MatrixXd &input, Eigen::MatrixXd &output)
 Set training set. More...
 
virtual LearnertrainingSet (DataSet &trainingSet)
 Set training set. More...
 
virtual LearnerremoveTrainingSet ()
 Remove the training set from the learner. More...
 
virtual LearnervalidationSet (Eigen::MatrixXd &input, Eigen::MatrixXd &output)
 Set validation set. More...
 
virtual LearnervalidationSet (DataSet &validationSet)
 Set validation set. More...
 
virtual LearnerremoveValidationSet ()
 Remove the validation set from the learner. More...
 
- Public Member Functions inherited from OpenANN::Optimizable
virtual ~Optimizable ()
 
virtual void finishedIteration ()
 This callback is called after each optimization algorithm iteration. More...
 
virtual bool providesInitialization ()=0
 Check if the object knows how to initialize its parameters. More...
 
virtual void initialize ()=0
 Initialize the optimizable parameters. More...
 
virtual unsigned dimension ()=0
 Request the number of optimizable parameters. More...
 
virtual const Eigen::VectorXd & currentParameters ()=0
 Request the current parameters. More...
 
virtual void setParameters (const Eigen::VectorXd &parameters)=0
 Set new parameters. More...
 
virtual double error ()=0
 Compute error on training set. More...
 
virtual bool providesGradient ()=0
 Check if the object provides a gradient of the error function with respect to its parameters. More...
 
virtual Eigen::VectorXd gradient ()=0
 Compute gradient of the error function with respect to the parameters. More...
 
virtual unsigned examples ()
 Request number of training examples. More...
 
virtual double error (unsigned n)
 Compute error of a given training example. More...
 
virtual Eigen::VectorXd gradient (unsigned n)
 Compute gradient of a given training example. More...
 
virtual void errorGradient (int n, double &value, Eigen::VectorXd &grad)
 Calculates the function value and gradient of a training example. More...
 
virtual void errorGradient (double &value, Eigen::VectorXd &grad)
 Calculates the function value and gradient of all training examples. More...
 
virtual Eigen::VectorXd error (std::vector< int >::const_iterator startN, std::vector< int >::const_iterator endN)
 Calculates the errors of given training examples. More...
 
virtual Eigen::VectorXd gradient (std::vector< int >::const_iterator startN, std::vector< int >::const_iterator endN)
 Calculates the accumulated gradient of given training examples. More...
 
virtual void errorGradient (std::vector< int >::const_iterator startN, std::vector< int >::const_iterator endN, double &value, Eigen::VectorXd &grad)
 Calculates the accumulated gradient and error of given training examples. More...
 

Protected Attributes

DataSettrainSet
 
DataSetvalidSet
 
bool deleteTrainSet
 
bool deleteValidSet
 
int N
 

Detailed Description

Common base class of all learning algorithms.

A learner combines a model and a training set so that an Optimizer can minimize the error function on the training set.

Constructor & Destructor Documentation

OpenANN::Learner::Learner ( )
virtual OpenANN::Learner::~Learner ( )
virtual

Member Function Documentation

virtual Eigen::VectorXd OpenANN::Learner::operator() ( const Eigen::VectorXd &  x)
pure virtual

Make a prediction.

Parameters
xInput vector.
Returns
Prediction.

Implemented in OpenANN::Net, OpenANN::RBM, OpenANN::IntrinsicPlasticity, and OpenANN::SparseAutoEncoder.

virtual Eigen::MatrixXd OpenANN::Learner::operator() ( const Eigen::MatrixXd &  X)
pure virtual

Make predictions.

Parameters
XEach row represents an input vector.
Returns
Each row represents a prediction.

Implemented in OpenANN::Net, OpenANN::RBM, OpenANN::IntrinsicPlasticity, and OpenANN::SparseAutoEncoder.

virtual Learner& OpenANN::Learner::removeTrainingSet ( )
virtual

Remove the training set from the learner.

Returns
this for chaining
virtual Learner& OpenANN::Learner::removeValidationSet ( )
virtual

Remove the validation set from the learner.

Returns
this for chaining
virtual Learner& OpenANN::Learner::trainingSet ( Eigen::MatrixXd &  input,
Eigen::MatrixXd &  output 
)
virtual

Set training set.

Parameters
inputinput vectors, each instance should be in a row
outputoutput vectors, each instance should be in a row
Returns
this for chaining
virtual Learner& OpenANN::Learner::trainingSet ( DataSet trainingSet)
virtual

Set training set.

Parameters
trainingSettraining set
Returns
this for chaining

Reimplemented in OpenANN::SparseAutoEncoder.

virtual Learner& OpenANN::Learner::validationSet ( Eigen::MatrixXd &  input,
Eigen::MatrixXd &  output 
)
virtual

Set validation set.

Parameters
inputinput vectors, each instance should be in a row
outputoutput vectors, each instance should be in a row
Returns
this for chaining
virtual Learner& OpenANN::Learner::validationSet ( DataSet validationSet)
virtual

Set validation set.

Parameters
validationSetvalidation set
Returns
this for chaining

Member Data Documentation

bool OpenANN::Learner::deleteTrainSet
protected
bool OpenANN::Learner::deleteValidSet
protected
int OpenANN::Learner::N
protected
DataSet* OpenANN::Learner::trainSet
protected
DataSet* OpenANN::Learner::validSet
protected

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