Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::ProjectionErrorVariable Class Reference

The first input is a set of n_dim vectors (possibly seen as a single vector of their concatenation) f_i, each in R^n The second input is a set of T vectors (possibly seen as a single vector of their concatenation) t_j, each in R^n The output is the following: sum_j min_{w_j} || t_j - sum_i w_{ji} f_i ||^2 where row w_j of w is optmized analytically and separately for each j. More...

#include <ProjectionErrorVariable.h>

Inheritance diagram for PLearn::ProjectionErrorVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProjectionErrorVariable ()
 Default constructor for persistence.

 ProjectionErrorVariable (Variable *input1, Variable *input2, int n=-1, bool normalize_by_neighbor_distance=true, bool use_subspace_distance=false, real norm_penalization=1.0, real epsilon=1e-6, real regularization=0, bool ordered_vectors=true)
 PLEARN_DECLARE_OBJECT (ProjectionErrorVariable)
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

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 ()
 compute output given input

virtual void bprop ()
virtual void symbolicBprop ()
 compute a piece of new Var graph that represents the symbolic derivative of this Var


Public Attributes

int n
bool use_subspace_distance
bool normalize_by_neighbor_distance
real norm_penalization
real epsilon
real regularization
bool ordered_vectors
int n_dim
int T
Vec S
Vec fw
Vec norm_err
Vec ww
Vec uu
Vec wwuu
Vec rhs
Vec Tu
Vec one_over_norm_T
Vec norm_f
Mat F
Mat TT
Mat dF
Mat Ut
Mat V
Mat B
Mat VVt
Mat A
Mat A11
Mat A12
Mat A21
Mat A22
Mat wwuuM
Mat FT
Mat FT1
Mat FT2
Mat fw_minus_t
Mat w

Protected Member Functions

void build_ ()

Private Types

typedef BinaryVariable inherited

Detailed Description

The first input is a set of n_dim vectors (possibly seen as a single vector of their concatenation) f_i, each in R^n The second input is a set of T vectors (possibly seen as a single vector of their concatenation) t_j, each in R^n The output is the following: sum_j min_{w_j} || t_j - sum_i w_{ji} f_i ||^2 where row w_j of w is optmized analytically and separately for each j.

Definition at line 59 of file ProjectionErrorVariable.h.


Member Typedef Documentation

typedef BinaryVariable PLearn::ProjectionErrorVariable::inherited [private]
 

Reimplemented from PLearn::BinaryVariable.

Definition at line 61 of file ProjectionErrorVariable.h.

Referenced by ProjectionErrorVariable().


Constructor & Destructor Documentation

PLearn::ProjectionErrorVariable::ProjectionErrorVariable  )  [inline]
 

Default constructor for persistence.

Definition at line 80 of file ProjectionErrorVariable.h.

PLearn::ProjectionErrorVariable::ProjectionErrorVariable Variable input1,
Variable input2,
int  n = -1,
bool  normalize_by_neighbor_distance = true,
bool  use_subspace_distance = false,
real  norm_penalization = 1.0,
real  epsilon = 1e-6,
real  regularization = 0,
bool  ordered_vectors = true
 

Definition at line 89 of file ProjectionErrorVariable.cc.

References build_(), and inherited.


Member Function Documentation

void PLearn::ProjectionErrorVariable::bprop  )  [virtual]
 

Implements PLearn::Variable.

Definition at line 365 of file ProjectionErrorVariable.cc.

References PLearn::TVec< T >::clear(), dF, PLearn::externalProductScaleAcc(), F, fw, fw_minus_t, k, PLearn::multiplyAcc(), n_dim, norm_err, norm_penalization, normalize_by_neighbor_distance, one_over_norm_T, ordered_vectors, PLearn::substract(), T, TT, use_subspace_distance, w, and ww.

void PLearn::ProjectionErrorVariable::build  )  [virtual]
 

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::Variable.

Definition at line 102 of file ProjectionErrorVariable.cc.

References build_().

void PLearn::ProjectionErrorVariable::build_  )  [protected]
 

This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build() method, and possibly the public virtual read method (which calls its parent's read). build_() can assume that it's parent's build_ has already been called.

Reimplemented from PLearn::Variable.

Definition at line 109 of file ProjectionErrorVariable.cc.

References A, A11, A12, A21, A22, B, dF, F, FT, FT1, FT2, fw, fw_minus_t, PLearn::Var::length(), n, n_dim, norm_err, norm_f, norm_penalization, one_over_norm_T, ordered_vectors, PLERROR, PLearn::TMat< T >::resize(), PLearn::TVec< T >::resize(), rhs, PLearn::TMat< T >::subMat(), PLearn::TVec< T >::subVec(), T, PLearn::TVec< T >::toMat(), TT, Tu, use_subspace_distance, Ut, uu, V, VVt, w, PLearn::Var::width(), ww, wwuu, and wwuuM.

Referenced by build(), and ProjectionErrorVariable().

void PLearn::ProjectionErrorVariable::fprop  )  [virtual]
 

compute output given input

Implements PLearn::Variable.

Definition at line 191 of file ProjectionErrorVariable.cc.

References A11, A12, A22, B, PLearn::TMat< T >::clear(), PLearn::TVec< T >::clear(), PLearn::dot(), PLearn::endl(), epsilon, F, F, FT, FT1, FT2, fw, fw_minus_t, k, PLearn::lapackSVD(), PLearn::TMat< T >::length(), PLearn::TVec< T >::length(), PLearn::multiply(), n, n_dim, PLearn::norm(), norm_err, norm_f, norm_penalization, normalize_by_neighbor_distance, one_over_norm_T, ordered_vectors, PLearn::pownorm(), PLearn::product(), PLearn::productAcc(), PLearn::productTranspose(), regularization, PLearn::TMat< T >::resize(), S, PLearn::substract(), PLearn::sum(), PLearn::sumsquare(), T, PLearn::transposeProduct(), TT, Tu, use_subspace_distance, Ut, uu, V, w, PLearn::TMat< T >::width(), ww, and wwuu.

PLearn::ProjectionErrorVariable::PLEARN_DECLARE_OBJECT ProjectionErrorVariable   ) 
 

void PLearn::ProjectionErrorVariable::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 185 of file ProjectionErrorVariable.cc.

void PLearn::ProjectionErrorVariable::symbolicBprop  )  [virtual]
 

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

Reimplemented from PLearn::Variable.

Definition at line 442 of file ProjectionErrorVariable.cc.

References PLERROR.


Member Data Documentation

Mat PLearn::ProjectionErrorVariable::A
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_().

Mat PLearn::ProjectionErrorVariable::A11
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::A12
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::A21
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_().

Mat PLearn::ProjectionErrorVariable::A22
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::B
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::dF
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by bprop(), and build_().

real PLearn::ProjectionErrorVariable::epsilon
 

Definition at line 68 of file ProjectionErrorVariable.h.

Referenced by fprop().

Mat PLearn::ProjectionErrorVariable::F
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::FT
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::FT1
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::FT2
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::fw
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::fw_minus_t
 

Definition at line 75 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

int PLearn::ProjectionErrorVariable::n
 

Definition at line 64 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

int PLearn::ProjectionErrorVariable::n_dim
 

Definition at line 71 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::norm_err
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::norm_f
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

real PLearn::ProjectionErrorVariable::norm_penalization
 

Definition at line 67 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

bool PLearn::ProjectionErrorVariable::normalize_by_neighbor_distance
 

Definition at line 66 of file ProjectionErrorVariable.h.

Referenced by bprop(), and fprop().

Vec PLearn::ProjectionErrorVariable::one_over_norm_T
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

bool PLearn::ProjectionErrorVariable::ordered_vectors
 

Definition at line 70 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

real PLearn::ProjectionErrorVariable::regularization
 

Definition at line 69 of file ProjectionErrorVariable.h.

Referenced by fprop().

Vec PLearn::ProjectionErrorVariable::rhs
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by build_().

Vec PLearn::ProjectionErrorVariable::S
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by fprop().

int PLearn::ProjectionErrorVariable::T
 

Definition at line 72 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::TT
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::Tu
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

bool PLearn::ProjectionErrorVariable::use_subspace_distance
 

Definition at line 65 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::Ut
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::uu
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::V
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::VVt
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_().

Mat PLearn::ProjectionErrorVariable::w
 

Definition at line 76 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::ww
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by bprop(), build_(), and fprop().

Vec PLearn::ProjectionErrorVariable::wwuu
 

Definition at line 73 of file ProjectionErrorVariable.h.

Referenced by build_(), and fprop().

Mat PLearn::ProjectionErrorVariable::wwuuM
 

Definition at line 74 of file ProjectionErrorVariable.h.

Referenced by build_().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:25:30 2004 for PLearn by doxygen 1.3.7