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

#include <ExpVariable.h>

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

List of all members.

Public Member Functions

 ExpVariable ()
 Default constructor for persistence.
 ExpVariable (Variable *input)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual ExpVariabledeepCopy (CopiesMap &copies) const
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 ()
 Nothing to do by default.
virtual void bprop ()
 Nothing to do by default.
virtual void symbolicBprop ()
 Incorrect!
virtual void rfprop ()

Static Public Member Functions

static string _classname_ ()
 ExpVariable.
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 Public Attributes

static StaticInitializer _static_initializer_

Private Types

typedef UnaryVariable inherited

Detailed Description

Definition at line 52 of file ExpVariable.h.


Member Typedef Documentation

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file ExpVariable.h.


Constructor & Destructor Documentation

PLearn::ExpVariable::ExpVariable ( ) [inline]

Default constructor for persistence.

Definition at line 58 of file ExpVariable.h.

{}
PLearn::ExpVariable::ExpVariable ( Variable input)

Definition at line 55 of file ExpVariable.cc.

    : inherited(input, input->length(), input->width())
{}

Member Function Documentation

string PLearn::ExpVariable::_classname_ ( ) [static]

ExpVariable.

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

OptionList & PLearn::ExpVariable::_getOptionList_ ( ) [static]

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Nothing to do by default.

Reimplemented from PLearn::UnaryVariable.

Definition at line 76 of file ExpVariable.cc.

References PLearn::Variable::gradientdata, i, PLearn::UnaryVariable::input, PLearn::Variable::nelems(), and PLearn::Variable::valuedata.

{
    for(int i=0; i<nelems(); i++)
        input->gradientdata[i] += gradientdata[i]*valuedata[i];
}

Here is the call graph for this function:

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

static const PPath& PLearn::ExpVariable::declaringFile ( ) [inline, static]

Reimplemented from PLearn::UnaryVariable.

Definition at line 61 of file ExpVariable.h.

{ return new ExpVariable(v); }
ExpVariable * PLearn::ExpVariable::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Nothing to do by default.

Reimplemented from PLearn::UnaryVariable.

Definition at line 69 of file ExpVariable.cc.

References i, PLearn::UnaryVariable::input, PLearn::Variable::nelems(), PLearn::safeexp(), and PLearn::Variable::valuedata.

{
    for(int i=0; i<nelems(); i++)
        valuedata[i] = safeexp(input->valuedata[i]);
}

Here is the call graph for this function:

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 53 of file ExpVariable.cc.

void PLearn::ExpVariable::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 59 of file ExpVariable.cc.

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

{
    if (input) {
        l = input->length();
        w = input->width();
    } else
        l = w = 0;
}

Here is the call graph for this function:

void PLearn::ExpVariable::rfprop ( ) [virtual]

Reimplemented from PLearn::Variable.

Definition at line 102 of file ExpVariable.cc.

References i, PLearn::UnaryVariable::input, PLearn::TVec< T >::length(), PLearn::Variable::nelems(), PLearn::UnaryVariable::resizeRValue(), PLearn::Variable::rValue, PLearn::Variable::rvaluedata, and PLearn::Variable::valuedata.

{
    if (rValue.length()==0) resizeRValue();
    for(int i=0; i<nelems(); i++)
        rvaluedata[i] = input->rvaluedata[i] * valuedata[i];
}

Here is the call graph for this function:

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

Incorrect!

Reimplemented from PLearn::Variable.

Definition at line 95 of file ExpVariable.cc.

References PLearn::Variable::g, PLearn::UnaryVariable::input, and PLearn::Variable::Var.

{
    input->accg(g * Var(this));
}

Member Data Documentation

Reimplemented from PLearn::UnaryVariable.

Definition at line 61 of file ExpVariable.h.


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