#include <incremental_sgd.h>
Inheritance diagram for IncrementalSGD< T >:
Public Member Functions | |
IncrementalSGD (int dim, double l) | |
Constructor that initializes IncrementalSgd. | |
void | resetModel () |
void | setModel (model m) |
model & | getModel () |
Returns model. | |
virtual bool | addExample (int y, T ex)=0 |
There are many algorithms that do not train when we an add example the return value indicates whether or not the model has changed as a result of this update. | |
virtual | ~IncrementalSGD () |
Desctructor. | |
bool | classifyExample (T f) |
Classifies given feature vector of the entity with the current model and returns class of the example. | |
Static Public Member Functions | |
static double | classifyExample (struct model &m, T x) |
Classifies given feature vector of the entity with the given model and returns distance of the entity to the model. | |
Protected Member Functions | |
void | oneStep (double y, T ex) |
This takes one step with this example. | |
Protected Attributes | |
double | lambda |
step size | |
model | _m |
model |
IncrementalSGD< T >::IncrementalSGD | ( | int | dim, | |
double | l | |||
) |
Constructor that initializes IncrementalSgd.
[in] | dim | dimension of the model |
[in] | l | lambda |
virtual IncrementalSGD< T >::~IncrementalSGD | ( | ) | [inline, virtual] |
Desctructor.
virtual bool IncrementalSGD< T >::addExample | ( | int | y, | |
T | ex | |||
) | [pure virtual] |
There are many algorithms that do not train when we an add example the return value indicates whether or not the model has changed as a result of this update.
[in] | y | class of the given example |
[in] | ex | feature vector of the given example |
Implemented in TrueSGD< T >, and ReservoirSGD< T >.
static double IncrementalSGD< T >::classifyExample | ( | struct model & | m, | |
T | x | |||
) | [inline, static] |
Classifies given feature vector of the entity with the given model and returns distance of the entity to the model.
[in] | m | model to classify the entity |
[in] | x | feature vector of the entity |
bool IncrementalSGD< T >::classifyExample | ( | T | f | ) |
Classifies given feature vector of the entity with the current model and returns class of the example.
[in] | f | feature vector of the entity |
struct model& IncrementalSGD< T >::getModel | ( | ) | [inline] |
Returns model.
void IncrementalSGD< T >::oneStep | ( | double | y, | |
T | ex | |||
) | [protected] |
This takes one step with this example.
[in] | y | class of the example |
[in] | ex | feature vector of the example |
void IncrementalSGD< T >::resetModel | ( | ) |
void IncrementalSGD< T >::setModel | ( | model | m | ) | [inline] |
struct model IncrementalSGD< T >::_m [protected] |
model
double IncrementalSGD< T >::lambda [protected] |
step size