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
OpenANN::WeightedDataSet Class Reference

Resampled dataset based on the original dataset. More...

#include <WeightedDataSet.h>

+ Inheritance diagram for OpenANN::WeightedDataSet:

Public Member Functions

 WeightedDataSet (DataSet &dataSet, const Eigen::VectorXd &weights, bool deterministic)
 
WeightedDataSetupdateWeights (const Eigen::VectorXd &weights)
 
virtual int samples ()
 Number of instances. More...
 
virtual int inputs ()
 Input dimensions of instances. More...
 
virtual int outputs ()
 Output dimensions of instances. More...
 
virtual Eigen::VectorXd & getInstance (int n)
 Get the input of the ith instance. More...
 
virtual Eigen::VectorXd & getTarget (int n)
 Get the output of the ith instance. More...
 
virtual void finishIteration (Learner &learner)
 This function is called after an iteration of the optimization algorithm. More...
 
- Public Member Functions inherited from OpenANN::DataSet
virtual ~DataSet ()
 

Detailed Description

Resampled dataset based on the original dataset.

The probability of each instance to occur in the dataset is defined by the given weights. Note that the weights must sum up to one.

Constructor & Destructor Documentation

OpenANN::WeightedDataSet::WeightedDataSet ( DataSet dataSet,
const Eigen::VectorXd &  weights,
bool  deterministic 
)
Parameters
dataSetoriginal dataset
weightsweights for each instance, must sum up to one
deterministicuse deterministic (roulette wheel) sampling

Member Function Documentation

virtual void OpenANN::WeightedDataSet::finishIteration ( Learner learner)
inlinevirtual

This function is called after an iteration of the optimization algorithm.

It could log results, modify or extend the data set or whatever.

Parameters
learnerlearned model

Implements OpenANN::DataSet.

virtual Eigen::VectorXd& OpenANN::WeightedDataSet::getInstance ( int  n)
virtual

Get the input of the ith instance.

Parameters
nnumber of instance
Returns
input

Implements OpenANN::DataSet.

virtual Eigen::VectorXd& OpenANN::WeightedDataSet::getTarget ( int  n)
virtual

Get the output of the ith instance.

Parameters
nnumber of instance
Returns
output

Implements OpenANN::DataSet.

virtual int OpenANN::WeightedDataSet::inputs ( )
virtual

Input dimensions of instances.

Returns
number of inputs

Implements OpenANN::DataSet.

virtual int OpenANN::WeightedDataSet::outputs ( )
virtual

Output dimensions of instances.

Returns
number of outputs

Implements OpenANN::DataSet.

virtual int OpenANN::WeightedDataSet::samples ( )
virtual

Number of instances.

Assumes that the data set has a fixed size, at least for one iteration of the optimization algorithm.

Returns
number of examples

Implements OpenANN::DataSet.

WeightedDataSet& OpenANN::WeightedDataSet::updateWeights ( const Eigen::VectorXd &  weights)

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