PLearn 0.1
|
#include <OutputVariable.h>
Public Member Functions | |
OutputVariable () | |
Default constructor for persistence. | |
OutputVariable (Variable *input, char *filename) | |
~OutputVariable () | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual OutputVariable * | deepCopy (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 PPath & | declaringFile () |
Public Attributes | |
ofstream * | output_file |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Private Types | |
typedef UnaryVariable | inherited |
Definition at line 55 of file OutputVariable.h.
typedef UnaryVariable PLearn::OutputVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file OutputVariable.h.
PLearn::OutputVariable::OutputVariable | ( | ) | [inline] |
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; }
string PLearn::OutputVariable::_classname_ | ( | ) | [static] |
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.
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] |
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.
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().
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"); }
Reimplemented from PLearn::UnaryVariable.
Definition at line 68 of file OutputVariable.h.
ofstream* PLearn::OutputVariable::output_file |
Definition at line 61 of file OutputVariable.h.
Referenced by fprop(), OutputVariable(), and ~OutputVariable().