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

#include <OutputVariable.h>

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

List of all members.

Public Member Functions

 OutputVariable ()
 Default constructor for persistence.
 OutputVariable (Variable *input, char *filename)
 ~OutputVariable ()
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual OutputVariabledeepCopy (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 ()
 compute a piece of new Var graph that represents the symbolic derivative of this Var
virtual void rfprop ()

Static Public Member Functions

static string _classname_ ()
 OutputVariable.
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 ()

Public Attributes

ofstream * output_file

Static Public Attributes

static StaticInitializer _static_initializer_

Private Types

typedef UnaryVariable inherited

Detailed Description

Definition at line 55 of file OutputVariable.h.


Member Typedef Documentation

Reimplemented from PLearn::UnaryVariable.

Definition at line 57 of file OutputVariable.h.


Constructor & Destructor Documentation

PLearn::OutputVariable::OutputVariable ( ) [inline]

Default constructor for persistence.

Definition at line 64 of file OutputVariable.h.

{}
PLearn::OutputVariable::OutputVariable ( Variable input,
char *  filename 
)

Definition at line 56 of file OutputVariable.cc.

References output_file.

    : inherited(input, input->length(),input->width()) 
{
    output_file = new ofstream(filename);
}
PLearn::OutputVariable::~OutputVariable ( )

Definition at line 62 of file OutputVariable.cc.

References output_file.

{
    output_file->close();
    delete output_file;
}

Member Function Documentation

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

OutputVariable.

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Nothing to do by default.

Reimplemented from PLearn::UnaryVariable.

Definition at line 88 of file OutputVariable.cc.

References PLearn::Variable::gradientdata, and PLearn::UnaryVariable::input.

{
    for(int k=0; k<input->nelems(); k++) {
        input->gradientdata[k] += gradientdata[k];
    }
}
string PLearn::OutputVariable::classname ( ) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 68 of file OutputVariable.h.

{
OutputVariable * PLearn::OutputVariable::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Nothing to do by default.

Reimplemented from PLearn::UnaryVariable.

Definition at line 78 of file OutputVariable.cc.

References PLearn::UnaryVariable::input, output_file, and PLearn::Variable::valuedata.

{
    *output_file << input->value << "\n";

    for(int k=0; k<input->nelems(); k++) {
        valuedata[k] = input->valuedata[k];
    }
}
OptionList & PLearn::OutputVariable::getOptionList ( ) const [virtual]

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

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

Reimplemented from PLearn::UnaryVariable.

Definition at line 54 of file OutputVariable.cc.

void PLearn::OutputVariable::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 68 of file OutputVariable.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::OutputVariable::rfprop ( ) [virtual]

Reimplemented from PLearn::Variable.

Definition at line 101 of file OutputVariable.cc.

References PLERROR.

{
    PLERROR("In OutputVariable::rfprop: feature not implemented");
}
void PLearn::OutputVariable::symbolicBprop ( ) [virtual]

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

Reimplemented from PLearn::Variable.

Definition at line 95 of file OutputVariable.cc.

References PLERROR.

{
    PLERROR("In OutputVariable::symbolicBprop: feature not implemented");
}

Member Data Documentation

Reimplemented from PLearn::UnaryVariable.

Definition at line 68 of file OutputVariable.h.

Definition at line 61 of file OutputVariable.h.

Referenced by fprop(), OutputVariable(), and ~OutputVariable().


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