IncrementalSGD< T > Class Template Reference

This class presents generic IncrementalSGD and two kind of sgd that extends this class which are TrueSGD and ReservoirSGD. More...

#include <incremental_sgd.h>

Inheritance diagram for IncrementalSGD< T >:

ReservoirSGD< T > TrueSGD< T > List of all members.

Public Member Functions

 IncrementalSGD (int dim, double l)
 Constructor that initializes IncrementalSgd.
void resetModel ()
void setModel (model m)
modelgetModel ()
 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

Detailed Description

template<class T>
class IncrementalSGD< T >

This class presents generic IncrementalSGD and two kind of sgd that extends this class which are TrueSGD and ReservoirSGD.


Constructor & Destructor Documentation

template<class T>
IncrementalSGD< T >::IncrementalSGD ( int  dim,
double  l 
)

Constructor that initializes IncrementalSgd.

Parameters:
[in] dim dimension of the model
[in] l lambda

template<class T>
virtual IncrementalSGD< T >::~IncrementalSGD (  )  [inline, virtual]

Desctructor.


Member Function Documentation

template<class T>
virtual bool IncrementalSGD< T >::addExample ( int  y,
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.

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

Implemented in TrueSGD< T >, and ReservoirSGD< T >.

template<class T>
static double IncrementalSGD< T >::classifyExample ( struct model m,
x 
) [inline, static]

Classifies given feature vector of the entity with the given model and returns distance of the entity to the model.

Parameters:
[in] m model to classify the entity
[in] x feature vector of the entity
Returns:
distance of the entity to the model

template<class T>
bool IncrementalSGD< T >::classifyExample ( f  ) 

Classifies given feature vector of the entity with the current model and returns class of the example.

Parameters:
[in] f feature vector of the entity
Returns:
class of the example

template<class T>
struct model& IncrementalSGD< T >::getModel (  )  [inline]

Returns model.

Returns:
model

template<class T>
void IncrementalSGD< T >::oneStep ( double  y,
ex 
) [protected]

This takes one step with this example.

Parameters:
[in] y class of the example
[in] ex feature vector of the example

template<class T>
void IncrementalSGD< T >::resetModel (  ) 

template<class T>
void IncrementalSGD< T >::setModel ( model  m  )  [inline]


Member Data Documentation

template<class T>
struct model IncrementalSGD< T >::_m [protected]

model

template<class T>
double IncrementalSGD< T >::lambda [protected]

step size


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