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

#include <StatsIterator.h>

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

List of all members.

Public Member Functions

virtual string info () const
 Returns a bit more informative string about object (default returns classname())
virtual void init (int inputsize)
 Call this method once with the correct inputsize.
virtual void update (const Vec &input)
 Then iterate over the data set and call this method for each row.
virtual bool finish ()
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual ExpMeanStatsIteratordeepCopy (CopiesMap &copies) const
virtual void oldwrite (ostream &out) const

Static Public Member Functions

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

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declare options (data fields) for the class.

Protected Attributes

TVec< intnsamples

Private Types

typedef StatsIterator inherited

Detailed Description

Definition at line 136 of file StatsIterator.h.


Member Typedef Documentation

Reimplemented from PLearn::StatsIterator.

Definition at line 138 of file StatsIterator.h.


Member Function Documentation

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

Reimplemented from PLearn::StatsIterator.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::StatsIterator.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::StatsIterator.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::StatsIterator.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::Object.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::StatsIterator.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::Object.

Definition at line 147 of file StatsIterator.cc.

void PLearn::ExpMeanStatsIterator::declareOptions ( OptionList ol) [static, protected]

Declare options (data fields) for the class.

Redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options). Please call the inherited method AT THE END to get the options listed in a consistent order (from most recently defined to least recently defined).

  static void MyDerivedClass::declareOptions(OptionList& ol)
  {
      declareOption(ol, "inputsize", &MyObject::inputsize_,
                    OptionBase::buildoption,
                    "The size of the input; it must be provided");
      declareOption(ol, "weights", &MyObject::weights,
                    OptionBase::learntoption,
                    "The learned model weights");
      inherited::declareOptions(ol);
  }
Parameters:
olList of options that is progressively being constructed for the current class.

Reimplemented from PLearn::StatsIterator.

Definition at line 170 of file StatsIterator.cc.

References PLearn::declareOption(), PLearn::OptionBase::learntoption, and nsamples.

Here is the call graph for this function:

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

Reimplemented from PLearn::StatsIterator.

Definition at line 149 of file StatsIterator.h.

:
    static void declareOptions(OptionList& ol);
ExpMeanStatsIterator * PLearn::ExpMeanStatsIterator::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::StatsIterator.

Definition at line 147 of file StatsIterator.cc.

bool PLearn::ExpMeanStatsIterator::finish ( ) [virtual]

Call this method when all the data has been shown (through update) If the method returns false, then a further pass through the data is required.

Implements PLearn::StatsIterator.

Definition at line 163 of file StatsIterator.cc.

References PLearn::exp(), and i.

{
    for (int i=0;i<result.length();i++)
        result[i] = exp(result[i]/nsamples[i]);
    return true;
}

Here is the call graph for this function:

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

Reimplemented from PLearn::Object.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::Object.

Definition at line 147 of file StatsIterator.cc.

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

Reimplemented from PLearn::Object.

Definition at line 147 of file StatsIterator.cc.

virtual string PLearn::ExpMeanStatsIterator::info ( ) const [inline, virtual]

Returns a bit more informative string about object (default returns classname())

Returns:
Information about the object

Reimplemented from PLearn::Object.

Definition at line 144 of file StatsIterator.h.

{ return "exp_mean"; }
void PLearn::ExpMeanStatsIterator::init ( int  inputsize) [virtual]

Call this method once with the correct inputsize.

Implements PLearn::StatsIterator.

Definition at line 149 of file StatsIterator.cc.

{ 
    // We do not use resize on purpose, so 
    // that the previous result Vec does not get overwritten
    result = Vec(inputsize);
    nsamples.resize(inputsize);
    nsamples.clear();
} 
void PLearn::ExpMeanStatsIterator::oldwrite ( ostream &  out) const [virtual]

Reimplemented from PLearn::StatsIterator.

Definition at line 178 of file StatsIterator.cc.

References PLearn::write(), PLearn::writeField(), PLearn::writeFooter(), and PLearn::writeHeader().

{
    writeHeader(out,"ExpMeanStatsIterator");
    inherited::write(out);
    writeField(out,"nsamples",nsamples);
    writeFooter(out,"ExpMeanStatsIterator");
}

Here is the call graph for this function:

void PLearn::ExpMeanStatsIterator::update ( const Vec input) [virtual]

Then iterate over the data set and call this method for each row.

Implements PLearn::StatsIterator.

Definition at line 158 of file StatsIterator.cc.

References PLearn::addIfNonMissing().

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::StatsIterator.

Definition at line 149 of file StatsIterator.h.

Definition at line 141 of file StatsIterator.h.

Referenced by declareOptions().


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