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

#include <OneVsAllVMatrix.h>

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

List of all members.

Public Member Functions

 OneVsAllVMatrix ()
 Default constructor.
 OneVsAllVMatrix (VMat the_source, int the_target_class, bool inverse_target=false)
virtual void build ()
 Simply calls inherited::build() then build_().
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual OneVsAllVMatrixdeepCopy (CopiesMap &copies) const

Static Public Member Functions

static string _classname_ ()
 Declares name and deepCopy methods.
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

int target_class
bool inverse_target

Static Public Attributes

static StaticInitializer _static_initializer_

Protected Member Functions

virtual void getNewRow (int i, const Vec &v) const
 Fill the vector 'v' with the content of the i-th row.

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares this class' options.

Private Types

typedef SourceVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 51 of file OneVsAllVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 56 of file OneVsAllVMatrix.h.


Constructor & Destructor Documentation

PLearn::OneVsAllVMatrix::OneVsAllVMatrix ( )

Default constructor.

Definition at line 52 of file OneVsAllVMatrix.cc.

    : inherited(),
      target_class(0)
{

}
PLearn::OneVsAllVMatrix::OneVsAllVMatrix ( VMat  the_source,
int  the_target_class,
bool  inverse_target = false 
)

Definition at line 59 of file OneVsAllVMatrix.cc.

References build().

    : inherited(the_source),
      target_class(the_target_class),
      inverse_target(inverse_target)
{
    build();
}

Here is the call graph for this function:


Member Function Documentation

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

Declares name and deepCopy methods.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Simply calls inherited::build() then build_().

Reimplemented from PLearn::SourceVMatrix.

Definition at line 86 of file OneVsAllVMatrix.cc.

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

Referenced by OneVsAllVMatrix().

Here is the call graph for this function:

Here is the caller graph for this function:

void PLearn::OneVsAllVMatrix::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 95 of file OneVsAllVMatrix.cc.

References PLearn::VMatrix::extrasize_, PLearn::VMatrix::inputsize_, PLCHECK, PLERROR, PLearn::TVec< T >::resize(), PLearn::SourceVMatrix::setMetaInfoFromSource(), PLearn::SourceVMatrix::source, PLearn::SourceVMatrix::sourcerow, PLearn::VMatrix::targetsize_, PLearn::VMatrix::updateMtime(), PLearn::VMatrix::weightsize_, PLearn::VMat::width(), and PLearn::VMatrix::width_.

Referenced by build().

{
    if(source)
    {
        if(source->targetsize() != 1)
            PLERROR("OneVsAllVMatrix::build_(): targetsize_ should be 1");

        updateMtime(source);
        setMetaInfoFromSource();

        PLCHECK(width_ == inputsize_+targetsize_+weightsize_+extrasize_);
        sourcerow.resize(source->width());
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Declares this class' options.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 77 of file OneVsAllVMatrix.cc.

References PLearn::SourceVMatrix::declareOptions().

{
    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 111 of file OneVsAllVMatrix.h.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

void PLearn::OneVsAllVMatrix::getNewRow ( int  i,
const Vec v 
) const [protected, virtual]

Fill the vector 'v' with the content of the i-th row.

v is assumed to be the right size.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 113 of file OneVsAllVMatrix.cc.

References PLearn::VMatrix::inputsize_, inverse_target, PLearn::SourceVMatrix::source, and target_class.

{
    source->getRow(i,v);
    bool t = int(v[inputsize_]) == target_class;
    v[inputsize_] = inverse_target? !t : t;
}
OptionList & PLearn::OneVsAllVMatrix::getOptionList ( ) const [virtual]

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

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

Reimplemented from PLearn::SourceVMatrix.

Definition at line 72 of file OneVsAllVMatrix.cc.

void PLearn::OneVsAllVMatrix::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::SourceVMatrix.

Definition at line 123 of file OneVsAllVMatrix.cc.

References PLearn::SourceVMatrix::makeDeepCopyFromShallowCopy().

{
    inherited::makeDeepCopyFromShallowCopy(copies);

    //PLERROR("OneVsAllVMatrix::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::SourceVMatrix.

Definition at line 111 of file OneVsAllVMatrix.h.

Definition at line 71 of file OneVsAllVMatrix.h.

Referenced by getNewRow().

Definition at line 70 of file OneVsAllVMatrix.h.

Referenced by getNewRow().


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