PLearn 0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Member Functions | Private Types | Private Member Functions
PLearn::GradientCorrector Class Reference

Virtual class used for converting a sequence of n-dimensional gradients g_t into corrected update directions v_t. More...

#include <GradientCorrector.h>

Inheritance diagram for PLearn::GradientCorrector:
Inheritance graph
[legend]
Collaboration diagram for PLearn::GradientCorrector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GradientCorrector ()
 Default constructor.
virtual void init ()=0
 initialize the object to start collecting covariance statistics from fresh
virtual void operator() (int t, const Vec &g, Vec v)=0
 main method of this class: reads from the gradient "g" field and writes into the "v" field an estimator of inv(cov) g.
virtual GradientCorrectordeepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.

Static Public Member Functions

static string _classname_ ()
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Public Attributes

int n_dim
 ### declare public option fields (such as build options) here
int verbosity
 verbosity level, track improvement, spectrum, etgc.

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares the class options.

Private Types

typedef Object inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Virtual class used for converting a sequence of n-dimensional gradients g_t into corrected update directions v_t.

There is a main method, the operator(), which takes a g_t and fills v_t. The process can be initialized by init().

Definition at line 55 of file GradientCorrector.h.


Member Typedef Documentation

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.h.


Constructor & Destructor Documentation

PLearn::GradientCorrector::GradientCorrector ( )

Default constructor.

Definition at line 59 of file GradientCorrector.cc.

    : n_dim(-1),
      verbosity(0)
{
}

Member Function Documentation

string PLearn::GradientCorrector::_classname_ ( ) [static]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.cc.

OptionList & PLearn::GradientCorrector::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.cc.

RemoteMethodMap & PLearn::GradientCorrector::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.cc.

bool PLearn::GradientCorrector::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.cc.

StaticInitializer GradientCorrector::_static_initializer_ & PLearn::GradientCorrector::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.cc.

void PLearn::GradientCorrector::build ( ) [virtual]

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 67 of file GradientCorrector.cc.

References PLearn::Object::build(), and build_().

Here is the call graph for this function:

void PLearn::GradientCorrector::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator.

Definition at line 95 of file GradientCorrector.cc.

References init().

Referenced by build().

{
    init();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::GradientCorrector::declareOptions ( OptionList ol) [static, protected]

Declares the class options.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 78 of file GradientCorrector.cc.

References PLearn::declareOption(), PLearn::Object::declareOptions(), PLearn::OptionBase::learntoption, and n_dim.

{
    // ### Declare all of this object's options here.
    // ### For the "flags" of each option, you should typically specify
    // ### one of OptionBase::buildoption, OptionBase::learntoption or
    // ### OptionBase::tuningoption. If you don't provide one of these three,
    // ### this option will be ignored when loading values from a script.
    // ### You can also combine flags, for example with OptionBase::nosave:
    // ### (OptionBase::buildoption | OptionBase::nosave)

    declareOption(ol, "n_dim", &GradientCorrector::n_dim,
                  OptionBase::learntoption,
                  "Number of dimensions of the gradient vectors\n");
    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

static const PPath& PLearn::GradientCorrector::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 95 of file GradientCorrector.h.

:
    //#####  Protected Options  ###############################################
GradientCorrector * PLearn::GradientCorrector::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 57 of file GradientCorrector.cc.

virtual void PLearn::GradientCorrector::init ( ) [pure virtual]

initialize the object to start collecting covariance statistics from fresh

Implemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Referenced by build_().

Here is the caller graph for this function:

void PLearn::GradientCorrector::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.

Definition at line 73 of file GradientCorrector.cc.

References PLearn::Object::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:

virtual void PLearn::GradientCorrector::operator() ( int  t,
const Vec g,
Vec  v 
) [pure virtual]

main method of this class: reads from the gradient "g" field and writes into the "v" field an estimator of inv(cov) g.

The argument is an index over examples, which is used to know when cycling through a minibatch. The statistics on the covariance are updated.

Implemented in PLearn::NatGradEstimator, and PLearn::NatGradEstimator.


Member Data Documentation

Reimplemented from PLearn::Object.

Reimplemented in PLearn::NatGradEstimator.

Definition at line 95 of file GradientCorrector.h.

### declare public option fields (such as build options) here

number of input dimensions (size of g_t or v_t)

Reimplemented in PLearn::NatGradEstimator.

Definition at line 65 of file GradientCorrector.h.

Referenced by declareOptions().

verbosity level, track improvement, spectrum, etgc.

Reimplemented in PLearn::NatGradEstimator.

Definition at line 68 of file GradientCorrector.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines