PLearn 0.1
|
#include <SVDVariable.h>
Public Member Functions | |
SVDVariable () | |
Default constructor for persistence. | |
SVDVariable (Variable *input) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual SVDVariable * | deepCopy (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 PPath & | declaringFile () |
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 |
Definition at line 52 of file SVDVariable.h.
typedef UnaryVariable PLearn::SVDVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SVDVariable.h.
PLearn::SVDVariable::SVDVariable | ( | ) | [inline] |
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()); }
string PLearn::SVDVariable::_classname_ | ( | ) | [static] |
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.
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] |
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); }
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.
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.
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"); }
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().