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

PLearn::DiagonalizedFactorsProductVariable Class Reference

#include <DiagonalizedFactorsProductVariable.h>

Inheritance diagram for PLearn::DiagonalizedFactorsProductVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DiagonalizedFactorsProductVariable ()
 Default constructor for persistence.

 DiagonalizedFactorsProductVariable (Var left_matrix, Var center_diagonal, Var right_matrix, bool transpose_left=false, bool transpose_right=false)
 PLEARN_DECLARE_OBJECT (DiagonalizedFactorsProductVariable)
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 ()
VarleftMatrix ()
VarcenterDiagonal ()
VarrightMatrix ()

Public Attributes

bool transpose_left
bool transpose_right

Protected Member Functions

void build_ ()

Private Types

typedef NaryVariable inherited

Detailed Description

Variable that computes the matrix*diag(vector)*matrix product like the one found in singular value decomposition or eigen-decomposition. It has three parents: left_matrix U, center_diagonal_vector d, and right_matrix V. The output value has elements (i,j) equal to sum_k U_{ik} d_k V_{kj}. Optionally the right_matrix or the left_matrix is transposed before being applied.

Definition at line 58 of file DiagonalizedFactorsProductVariable.h.


Member Typedef Documentation

typedef NaryVariable PLearn::DiagonalizedFactorsProductVariable::inherited [private]
 

Reimplemented from PLearn::NaryVariable.

Definition at line 60 of file DiagonalizedFactorsProductVariable.h.

Referenced by DiagonalizedFactorsProductVariable().


Constructor & Destructor Documentation

PLearn::DiagonalizedFactorsProductVariable::DiagonalizedFactorsProductVariable  )  [inline]
 

Default constructor for persistence.

Definition at line 66 of file DiagonalizedFactorsProductVariable.h.

PLearn::DiagonalizedFactorsProductVariable::DiagonalizedFactorsProductVariable Var  left_matrix,
Var  center_diagonal,
Var  right_matrix,
bool  transpose_left = false,
bool  transpose_right = false
 

Definition at line 59 of file DiagonalizedFactorsProductVariable.cc.

References build_(), and inherited.


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 117 of file DiagonalizedFactorsProductVariable.cc.

References centerDiagonal(), PLearn::diagonalizedFactorsProductBprop(), PLearn::diagonalizedFactorsProductTransposeBprop(), PLearn::diagonalizedFactorsTransposeProductBprop(), PLearn::diagonalizedFactorsTransposeProductTransposeBprop(), leftMatrix(), rightMatrix(), transpose_left, and transpose_right.

void PLearn::DiagonalizedFactorsProductVariable::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 73 of file DiagonalizedFactorsProductVariable.cc.

References build_().

void PLearn::DiagonalizedFactorsProductVariable::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 80 of file DiagonalizedFactorsProductVariable.cc.

References centerDiagonal(), leftMatrix(), PLearn::Var::length(), PLERROR, rightMatrix(), PLearn::TVec< Var >::size(), transpose_left, transpose_right, and PLearn::Var::width().

Referenced by build(), and DiagonalizedFactorsProductVariable().

Var& PLearn::DiagonalizedFactorsProductVariable::centerDiagonal  )  [inline]
 

Definition at line 78 of file DiagonalizedFactorsProductVariable.h.

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

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

compute output given input

Implements PLearn::Variable.

Definition at line 100 of file DiagonalizedFactorsProductVariable.cc.

References centerDiagonal(), PLearn::diagonalizedFactorsProduct(), PLearn::diagonalizedFactorsProductTranspose(), PLearn::diagonalizedFactorsTransposeProduct(), PLearn::diagonalizedFactorsTransposeProductTranspose(), leftMatrix(), rightMatrix(), transpose_left, and transpose_right.

Var& PLearn::DiagonalizedFactorsProductVariable::leftMatrix  )  [inline]
 

Definition at line 77 of file DiagonalizedFactorsProductVariable.h.

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

PLearn::DiagonalizedFactorsProductVariable::PLEARN_DECLARE_OBJECT DiagonalizedFactorsProductVariable   ) 
 

void PLearn::DiagonalizedFactorsProductVariable::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 91 of file DiagonalizedFactorsProductVariable.cc.

References PLearn::TVec< Var >::size(), transpose_left, and transpose_right.

Var& PLearn::DiagonalizedFactorsProductVariable::rightMatrix  )  [inline]
 

Definition at line 79 of file DiagonalizedFactorsProductVariable.h.

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


Member Data Documentation

bool PLearn::DiagonalizedFactorsProductVariable::transpose_left
 

Definition at line 63 of file DiagonalizedFactorsProductVariable.h.

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

bool PLearn::DiagonalizedFactorsProductVariable::transpose_right
 

Definition at line 63 of file DiagonalizedFactorsProductVariable.h.

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


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