#include <incremental_sgd.h>
Inheritance diagram for ReservoirSGD< T >:
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 |
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
ReservoirSGD< T >::ReservoirSGD | ( | int | dim, | |
double | lambda, | |||
int | _rsize | |||
) | [inline] |
Constructor that initializes ReservoirSGD.
[in] | dim | dimension of the model |
[in] | lambda | lambda value |
[in] | _rsize | reservoir size |
bool ReservoirSGD< T >::addExample | ( | int | y, | |
T | ex | |||
) | [virtual] |
Uses the given example to train the model.
[in] | y | class of the example |
[in] | ex | feature vector of the example |
Implements IncrementalSGD< T >.
bool ReservoirSGD< T >::isFull | ( | ) | [inline] |
Returns whether reservoir is filled or not.
Reservoir<T> ReservoirSGD< T >::_r [private] |