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

PLearn::PlusConstantVariable Class Reference

adds a scalar constant to a matrix var More...

#include <PlusConstantVariable.h>

Inheritance diagram for PLearn::PlusConstantVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PlusConstantVariable ()
 Default constructor for persistence.

 PlusConstantVariable (Variable *input, real c)
 PLEARN_DECLARE_OBJECT (PlusConstantVariable)
virtual string info () const
 returns a bit more informative string about object (default returns classname())

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

virtual void rfprop ()

Static Public Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Public Attributes

real cst
 The constant.


Private Types

typedef UnaryVariable inherited

Detailed Description

adds a scalar constant to a matrix var

* Plus... *

Definition at line 57 of file PlusConstantVariable.h.


Member Typedef Documentation

typedef UnaryVariable PLearn::PlusConstantVariable::inherited [private]
 

Reimplemented from PLearn::UnaryVariable.

Definition at line 59 of file PlusConstantVariable.h.

Referenced by PlusConstantVariable().


Constructor & Destructor Documentation

PLearn::PlusConstantVariable::PlusConstantVariable  )  [inline]
 

Default constructor for persistence.

Definition at line 67 of file PlusConstantVariable.h.

References cst.

PLearn::PlusConstantVariable::PlusConstantVariable Variable input,
real  c
 

Definition at line 55 of file PlusConstantVariable.cc.

References inherited.


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 83 of file PlusConstantVariable.cc.

References k, and PLearn::Variable::nelems().

void PLearn::PlusConstantVariable::declareOptions OptionList ol  )  [static]
 

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::UnaryVariable.

Definition at line 61 of file PlusConstantVariable.cc.

References PLearn::declareOption(), and PLearn::OptionList.

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

compute output given input

Implements PLearn::Variable.

Definition at line 76 of file PlusConstantVariable.cc.

References cst, k, and PLearn::Variable::nelems().

virtual string PLearn::PlusConstantVariable::info  )  const [inline, virtual]
 

returns a bit more informative string about object (default returns classname())

Reimplemented from PLearn::Object.

Definition at line 73 of file PlusConstantVariable.h.

References cst, and PLearn::tostring().

PLearn::PlusConstantVariable::PLEARN_DECLARE_OBJECT PlusConstantVariable   ) 
 

void PLearn::PlusConstantVariable::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 67 of file PlusConstantVariable.cc.

References PLearn::Var::length(), and PLearn::Var::width().

void PLearn::PlusConstantVariable::rfprop  )  [virtual]
 

Reimplemented from PLearn::Variable.

Definition at line 97 of file PlusConstantVariable.cc.

References k, PLearn::TVec< T >::length(), PLearn::Variable::nelems(), and PLearn::UnaryVariable::resizeRValue().

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

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

Reimplemented from PLearn::Variable.

Definition at line 90 of file PlusConstantVariable.cc.


Member Data Documentation

real PLearn::PlusConstantVariable::cst
 

The constant.

Definition at line 63 of file PlusConstantVariable.h.

Referenced by fprop(), info(), and PlusConstantVariable().


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