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

PLearn::IsAboveThresholdVariable Class Reference

Does elementwise newx_i = (x_i>=threshold ?truevalue :falsevalue);. More...

#include <IsAboveThresholdVariable.h>

Inheritance diagram for PLearn::IsAboveThresholdVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 IsAboveThresholdVariable ()
 Default constructor for persistence.

 IsAboveThresholdVariable (Variable *input, real the_threshold, real the_truevalue, real the_falsevalue, bool strict=false)
 PLEARN_DECLARE_OBJECT (IsAboveThresholdVariable)
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)


Protected Attributes

real threshold
real truevalue
real falsevalue
bool strict

Private Types

typedef UnaryVariable inherited

Detailed Description

Does elementwise newx_i = (x_i>=threshold ?truevalue :falsevalue);.

Definition at line 55 of file IsAboveThresholdVariable.h.


Member Typedef Documentation

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 57 of file IsAboveThresholdVariable.h.

Referenced by IsAboveThresholdVariable().


Constructor & Destructor Documentation

PLearn::IsAboveThresholdVariable::IsAboveThresholdVariable  )  [inline]
 

Default constructor for persistence.

Definition at line 65 of file IsAboveThresholdVariable.h.

References falsevalue, threshold, and truevalue.

PLearn::IsAboveThresholdVariable::IsAboveThresholdVariable Variable input,
real  the_threshold,
real  the_truevalue,
real  the_falsevalue,
bool  strict = false
 

Definition at line 55 of file IsAboveThresholdVariable.cc.

References inherited.


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 98 of file IsAboveThresholdVariable.cc.

void PLearn::IsAboveThresholdVariable::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 63 of file IsAboveThresholdVariable.cc.

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

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

compute output given input

Implements PLearn::Variable.

Definition at line 81 of file IsAboveThresholdVariable.cc.

References falsevalue, strict, threshold, and truevalue.

PLearn::IsAboveThresholdVariable::PLEARN_DECLARE_OBJECT IsAboveThresholdVariable   ) 
 

void PLearn::IsAboveThresholdVariable::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 72 of file IsAboveThresholdVariable.cc.

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

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

Reimplemented from PLearn::Variable.

Definition at line 103 of file IsAboveThresholdVariable.cc.

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

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

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

Reimplemented from PLearn::Variable.

Definition at line 100 of file IsAboveThresholdVariable.cc.


Member Data Documentation

real PLearn::IsAboveThresholdVariable::falsevalue [protected]
 

Definition at line 60 of file IsAboveThresholdVariable.h.

Referenced by fprop(), and IsAboveThresholdVariable().

bool PLearn::IsAboveThresholdVariable::strict [protected]
 

Definition at line 61 of file IsAboveThresholdVariable.h.

Referenced by fprop().

real PLearn::IsAboveThresholdVariable::threshold [protected]
 

Definition at line 60 of file IsAboveThresholdVariable.h.

Referenced by fprop(), and IsAboveThresholdVariable().

real PLearn::IsAboveThresholdVariable::truevalue [protected]
 

Definition at line 60 of file IsAboveThresholdVariable.h.

Referenced by fprop(), and IsAboveThresholdVariable().


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