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

PLearn::UnequalConstantVariable Class Reference

A scalar var; equal 1 if input1!=c, 0 otherwise. More...

#include <UnequalConstantVariable.h>

Inheritance diagram for PLearn::UnequalConstantVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UnequalConstantVariable ()
 Default constructor for persistence.

 UnequalConstantVariable (Variable *input1, real c)
 PLEARN_DECLARE_OBJECT (UnequalConstantVariable)
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


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)


Protected Attributes

real c

Private Types

typedef UnaryVariable inherited

Detailed Description

A scalar var; equal 1 if input1!=c, 0 otherwise.

Definition at line 54 of file UnequalConstantVariable.h.


Member Typedef Documentation

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 56 of file UnequalConstantVariable.h.

Referenced by UnequalConstantVariable().


Constructor & Destructor Documentation

PLearn::UnequalConstantVariable::UnequalConstantVariable  )  [inline]
 

Default constructor for persistence.

Definition at line 63 of file UnequalConstantVariable.h.

References c.

PLearn::UnequalConstantVariable::UnequalConstantVariable Variable input1,
real  c
 

Definition at line 55 of file UnequalConstantVariable.cc.

References inherited.


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 83 of file UnequalConstantVariable.cc.

void PLearn::UnequalConstantVariable::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 60 of file UnequalConstantVariable.cc.

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

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

compute output given input

Implements PLearn::Variable.

Definition at line 75 of file UnequalConstantVariable.cc.

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

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

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

Reimplemented from PLearn::Object.

Definition at line 69 of file UnequalConstantVariable.h.

References c, and PLearn::tostring().

PLearn::UnequalConstantVariable::PLEARN_DECLARE_OBJECT UnequalConstantVariable   ) 
 

void PLearn::UnequalConstantVariable::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 66 of file UnequalConstantVariable.cc.

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

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

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

Reimplemented from PLearn::Variable.

Definition at line 85 of file UnequalConstantVariable.cc.


Member Data Documentation

real PLearn::UnequalConstantVariable::c [protected]
 

Definition at line 59 of file UnequalConstantVariable.h.

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


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