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

#include <SVDVariable.h>

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

List of all members.

Public Member Functions

 SVDVariable ()
 Default constructor for persistence.
 SVDVariable (Variable *input)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual SVDVariabledeepCopy (CopiesMap &copies) const
virtual void recomputeSize (int &l, int &w) const
 Recomputes the length l and width w that this variable should have, according to its parent variables.
virtual void fprop ()
 Nothing to do by default.
virtual void bprop ()
 Nothing to do by default.
virtual void symbolicBprop ()
 compute a piece of new Var graph that represents the symbolic derivative of this Var
virtual void rfprop ()

Static Public Member Functions

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

Public Attributes

int m
int n
Mat input_copy
Mat U
Mat Vt
Vec S

Static Public Attributes

static StaticInitializer _static_initializer_

Private Types

typedef UnaryVariable inherited

Detailed Description

Definition at line 52 of file SVDVariable.h.


Member Typedef Documentation

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file SVDVariable.h.


Constructor & Destructor Documentation

PLearn::SVDVariable::SVDVariable ( ) [inline]

Default constructor for persistence.

Definition at line 58 of file SVDVariable.h.

{}
PLearn::SVDVariable::SVDVariable ( Variable input)

Definition at line 60 of file SVDVariable.cc.

References input_copy, PLearn::Variable::length(), PLearn::TMat< T >::resize(), and PLearn::Variable::width().

    : inherited(input, input->length()*input->length()+input->width()*input->width()+min(input->length(),input->width()),1), 
      m(input->length()),
      n(input->width())
{
    input_copy.resize(input->length(), input->width());
}

Here is the call graph for this function:


Member Function Documentation

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

SVDVariable.

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

Object * PLearn::SVDVariable::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

void PLearn::SVDVariable::bprop ( ) [virtual]

Nothing to do by default.

Reimplemented from PLearn::UnaryVariable.

Definition at line 90 of file SVDVariable.cc.

{}
string PLearn::SVDVariable::classname ( ) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 61 of file SVDVariable.h.

{
SVDVariable * PLearn::SVDVariable::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

void PLearn::SVDVariable::fprop ( ) [virtual]

Nothing to do by default.

Reimplemented from PLearn::UnaryVariable.

Definition at line 78 of file SVDVariable.cc.

References PLearn::UnaryVariable::input, input_copy, m, PLearn::min(), n, S, PLearn::TVec< T >::subVec(), PLearn::SVD(), PLearn::TVec< T >::toMat(), U, PLearn::Variable::value, and Vt.

{
    input_copy << input->matValue ;

    U = value->subVec(0,m*m)->toMat(m,m);
    Vt = value->subVec(m*m,n*n)->toMat(n,n);
    S = value->subVec(m*m+n*n,min(m,n));

    SVD(input_copy,U,S,Vt);
}

Here is the call graph for this function:

OptionList & PLearn::SVDVariable::getOptionList ( ) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

OptionMap & PLearn::SVDVariable::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

RemoteMethodMap & PLearn::SVDVariable::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 58 of file SVDVariable.cc.

void PLearn::SVDVariable::recomputeSize ( int l,
int w 
) const [virtual]

Recomputes the length l and width w that this variable should have, according to its parent variables.

This is used for ex. by sizeprop() The default version stupidly returns the current dimensions, so make sure to overload it in subclasses if this is not appropriate.

Reimplemented from PLearn::Variable.

Definition at line 68 of file SVDVariable.cc.

References PLearn::UnaryVariable::input, m, PLearn::min(), and n.

{
    if (input) {
        l = m*m+n*n+min(m,n);
        w = 1;
    } else
        l = w = 0;
}

Here is the call graph for this function:

void PLearn::SVDVariable::rfprop ( ) [virtual]

Reimplemented from PLearn::Variable.

Definition at line 98 of file SVDVariable.cc.

References PLERROR.

{
    PLERROR("In SVDVariable::rfprop: feature not implemented");
}
void PLearn::SVDVariable::symbolicBprop ( ) [virtual]

compute a piece of new Var graph that represents the symbolic derivative of this Var

Reimplemented from PLearn::Variable.

Definition at line 92 of file SVDVariable.cc.

References PLERROR.

{
    PLERROR("In SVDVariable::symbolicBprop: feature not implemented");
}

Member Data Documentation

Reimplemented from PLearn::UnaryVariable.

Definition at line 61 of file SVDVariable.h.

Definition at line 64 of file SVDVariable.h.

Referenced by fprop(), and SVDVariable().

Definition at line 61 of file SVDVariable.h.

Referenced by fprop(), and recomputeSize().

Definition at line 61 of file SVDVariable.h.

Referenced by fprop(), and recomputeSize().

Definition at line 66 of file SVDVariable.h.

Referenced by fprop().

Definition at line 65 of file SVDVariable.h.

Referenced by fprop().

Definition at line 65 of file SVDVariable.h.

Referenced by fprop().


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