PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Types
PLearn::ConfRatedAdaboostCostVariable Class Reference

#include <ConfRatedAdaboostCostVariable.h>

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

List of all members.

Public Member Functions

 ConfRatedAdaboostCostVariable ()
 Default constructor for persistence.
 ConfRatedAdaboostCostVariable (Variable *output, Variable *target, Variable *alpha)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual
ConfRatedAdaboostCostVariable
deepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
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

static string _classname_ ()
 ConfRatedAdaboostCostVariable.
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()
static void declareOptions (OptionList &ol)
 Default constructor for persistence.

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Member Functions

void build_ ()
 Object-specific post-constructor.

Private Types

typedef NaryVariable inherited

Detailed Description

Definition at line 51 of file ConfRatedAdaboostCostVariable.h.


Member Typedef Documentation

Reimplemented from PLearn::NaryVariable.

Definition at line 53 of file ConfRatedAdaboostCostVariable.h.


Constructor & Destructor Documentation

PLearn::ConfRatedAdaboostCostVariable::ConfRatedAdaboostCostVariable ( ) [inline]

Default constructor for persistence.

Definition at line 57 of file ConfRatedAdaboostCostVariable.h.

{}
PLearn::ConfRatedAdaboostCostVariable::ConfRatedAdaboostCostVariable ( Variable output,
Variable target,
Variable alpha 
)

Definition at line 60 of file ConfRatedAdaboostCostVariable.cc.

References build_().

    : inherited(VarArray(output,target) & Var(alpha),output->size(),1)
{
    build_();
}

Here is the call graph for this function:


Member Function Documentation

string PLearn::ConfRatedAdaboostCostVariable::_classname_ ( ) [static]
OptionList & PLearn::ConfRatedAdaboostCostVariable::_getOptionList_ ( ) [static]

Reimplemented from PLearn::NaryVariable.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

RemoteMethodMap & PLearn::ConfRatedAdaboostCostVariable::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::NaryVariable.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

bool PLearn::ConfRatedAdaboostCostVariable::_isa_ ( const Object o) [static]

Reimplemented from PLearn::NaryVariable.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

Object * PLearn::ConfRatedAdaboostCostVariable::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

StaticInitializer ConfRatedAdaboostCostVariable::_static_initializer_ & PLearn::ConfRatedAdaboostCostVariable::_static_initialize_ ( ) [static]

Reimplemented from PLearn::NaryVariable.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

void PLearn::ConfRatedAdaboostCostVariable::bprop ( ) [virtual]

Implements PLearn::Variable.

Definition at line 112 of file ConfRatedAdaboostCostVariable.cc.

References PLearn::Variable::gradientdata, i, PLearn::Variable::length(), PLearn::Variable::valuedata, and PLearn::NaryVariable::varray.

{
    for(int i=0; i<length(); i++)
    {
        varray[0]->gradientdata[i] += -2*gradientdata[i]*valuedata[i]*varray[2]->valuedata[0]*(2*int(varray[1]->valuedata[i])-1);  
        varray[2]->gradientdata[0] += -gradientdata[i]*valuedata[i]*(2*varray[0]->valuedata[i]-1)*(2*int(varray[1]->valuedata[i])-1);  
    }
}

Here is the call graph for this function:

void PLearn::ConfRatedAdaboostCostVariable::build ( ) [virtual]

Post-constructor.

The normal implementation 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::NaryVariable.

Definition at line 67 of file ConfRatedAdaboostCostVariable.cc.

References PLearn::NaryVariable::build(), and build_().

Here is the call graph for this function:

void PLearn::ConfRatedAdaboostCostVariable::build_ ( ) [protected]

Object-specific post-constructor.

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 its parent's build_() has already been called.

Reimplemented from PLearn::NaryVariable.

Definition at line 74 of file ConfRatedAdaboostCostVariable.cc.

References PLERROR, PLearn::Variable::size(), and PLearn::NaryVariable::varray.

Referenced by build(), and ConfRatedAdaboostCostVariable().

{

    if (varray[1] && varray[0] && varray[1]->size() != varray[0]->size())
        PLERROR("In ConfRatedAdaboostCostVariable: target and output should have same size");

    if (varray[2] && varray[2]->size() != 1)
        PLERROR("In ConfRatedAdaboostCostVariable: target must be a single real");
}

Here is the call graph for this function:

Here is the caller graph for this function:

string PLearn::ConfRatedAdaboostCostVariable::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

void PLearn::ConfRatedAdaboostCostVariable::declareOptions ( OptionList ol) [static]

Default constructor for persistence.

Reimplemented from PLearn::NaryVariable.

Definition at line 85 of file ConfRatedAdaboostCostVariable.cc.

{
}
static const PPath& PLearn::ConfRatedAdaboostCostVariable::declaringFile ( ) [inline, static]

Reimplemented from PLearn::NaryVariable.

Definition at line 60 of file ConfRatedAdaboostCostVariable.h.

:
    void build_();
ConfRatedAdaboostCostVariable * PLearn::ConfRatedAdaboostCostVariable::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::NaryVariable.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

void PLearn::ConfRatedAdaboostCostVariable::fprop ( ) [virtual]

compute output given input

Implements PLearn::Variable.

Definition at line 98 of file ConfRatedAdaboostCostVariable.cc.

References PLearn::exp(), i, PLearn::Variable::length(), PLearn::Variable::valuedata, and PLearn::NaryVariable::varray.

{
  
    int signed_target;
    for(int i=0; i<length(); i++)
    {
        signed_target = 2*int(varray[1]->valuedata[i])-1;  
        valuedata[i] = exp(-1*varray[2]->valuedata[0]*signed_target*(2*varray[0]->valuedata[i]-1));
    }
}

Here is the call graph for this function:

OptionList & PLearn::ConfRatedAdaboostCostVariable::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

OptionMap & PLearn::ConfRatedAdaboostCostVariable::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

RemoteMethodMap & PLearn::ConfRatedAdaboostCostVariable::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 55 of file ConfRatedAdaboostCostVariable.cc.

void PLearn::ConfRatedAdaboostCostVariable::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 92 of file ConfRatedAdaboostCostVariable.cc.

References PLearn::TVec< T >::size(), and PLearn::NaryVariable::varray.

{ l=varray[0]->size(), w=1; }

Here is the call graph for this function:

void PLearn::ConfRatedAdaboostCostVariable::symbolicBprop ( ) [virtual]

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

Reimplemented from PLearn::Variable.

Definition at line 121 of file ConfRatedAdaboostCostVariable.cc.

References PLERROR.

{
    PLERROR("ConfRatedAdaboostCostVariable::symbolicBprop() not implemented");
}

Member Data Documentation

Reimplemented from PLearn::NaryVariable.

Definition at line 60 of file ConfRatedAdaboostCostVariable.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines