ReservoirSGD< T > Class Template Reference

This class extends IncrementalSGD and implements ReservoirSGD. More...

#include <incremental_sgd.h>

Inheritance diagram for ReservoirSGD< T >:

IncrementalSGD< T > List of all members.

Public Member Functions

 ReservoirSGD (int dim, double lambda, int _rsize)
 Constructor that initializes ReservoirSGD.
bool isFull ()
 Returns whether reservoir is filled or not.
bool addExample (int y, T ex)
 Uses the given example to train the model.

Private Attributes

Reservoir< T > _r

Detailed Description

template<class T>
class ReservoirSGD< T >

This class extends IncrementalSGD and implements ReservoirSGD.

This means that during the training we use a reservoir with the size r. First, we use given training examples to fill reservoir. Then, at each iteration, we randomly replace an example with the given training example in the reservoir and then train the model with the all elements in the reservoir


Constructor & Destructor Documentation

template<class T>
ReservoirSGD< T >::ReservoirSGD ( int  dim,
double  lambda,
int  _rsize 
) [inline]

Constructor that initializes ReservoirSGD.

Parameters:
[in] dim dimension of the model
[in] lambda lambda value
[in] _rsize reservoir size


Member Function Documentation

template<class T>
bool ReservoirSGD< T >::addExample ( int  y,
ex 
) [virtual]

Uses the given example to train the model.

Parameters:
[in] y class of the example
[in] ex feature vector of the example
Returns:
whether model changed or not

Implements IncrementalSGD< T >.

template<class T>
bool ReservoirSGD< T >::isFull (  )  [inline]

Returns whether reservoir is filled or not.

Returns:
whether reservoir is filled


Member Data Documentation

template<class T>
Reservoir<T> ReservoirSGD< T >::_r [private]


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 10:46:16 2010 for Hazy_System by  doxygen 1.4.7