|
PLearn 0.1
|
#include <ExtractNNetParamsVMatrix.h>


Public Member Functions | |
| ExtractNNetParamsVMatrix () | |
| Default constructor. | |
| virtual void | build () |
| Simply calls inherited::build() then build_(). | |
| virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
| Transform a shallow copy into a deep copy. | |
| virtual string | classname () const |
| virtual OptionList & | getOptionList () const |
| virtual OptionMap & | getOptionMap () const |
| virtual RemoteMethodMap & | getRemoteMethodMap () const |
| virtual ExtractNNetParamsVMatrix * | deepCopy (CopiesMap &copies) const |
Static Public Member Functions | |
| static string | _classname_ () |
| Declare 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 PPath & | declaringFile () |
Public Attributes | |
| PP< NNet > | nnet |
| bool | extract_w1 |
| bool | extract_w2 |
| bool | extract_wdirect |
| bool | extract_wout |
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. | |
Protected Attributes | |
| Mat | data |
| Used to store the precomputed parameters. | |
Private Types | |
| typedef RowBufferedVMatrix | inherited |
Private Member Functions | |
| void | build_ () |
| This does the actual building. | |
Definition at line 52 of file ExtractNNetParamsVMatrix.h.
typedef RowBufferedVMatrix PLearn::ExtractNNetParamsVMatrix::inherited [private] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 57 of file ExtractNNetParamsVMatrix.h.
| PLearn::ExtractNNetParamsVMatrix::ExtractNNetParamsVMatrix | ( | ) |
Default constructor.
Definition at line 53 of file ExtractNNetParamsVMatrix.cc.
: extract_w1(false), extract_w2(false), extract_wdirect(false), extract_wout(false) {}
| string PLearn::ExtractNNetParamsVMatrix::_classname_ | ( | ) | [static] |
Declare name and deepCopy methods.
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| OptionList & PLearn::ExtractNNetParamsVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| RemoteMethodMap & PLearn::ExtractNNetParamsVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| Object * PLearn::ExtractNNetParamsVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| StaticInitializer ExtractNNetParamsVMatrix::_static_initializer_ & PLearn::ExtractNNetParamsVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| void PLearn::ExtractNNetParamsVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::VMatrix.
Definition at line 115 of file ExtractNNetParamsVMatrix.cc.
References PLearn::VMatrix::build(), and build_().
{
inherited::build();
build_();
}

| void PLearn::ExtractNNetParamsVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::VMatrix.
Definition at line 124 of file ExtractNNetParamsVMatrix.cc.
References data, extract_w1, extract_w2, extract_wdirect, extract_wout, PLearn::TMat< T >::length(), PLearn::VMatrix::length_, m, nnet, PLearn::TMat< T >::resize(), PLearn::TMat< T >::width(), and PLearn::VMatrix::width_.
Referenced by build().
{
if (nnet) {
Mat m;
if (extract_w1)
m = nnet->getW1();
else if (extract_w2)
m = nnet->getW2();
else if (extract_wdirect)
m = nnet->getWdirect();
else if (extract_wout)
m = nnet->getWout();
data.resize(m.length(), m.width());
data << m;
length_ = data.length();
width_ = data.width();
}
}


| string PLearn::ExtractNNetParamsVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| void PLearn::ExtractNNetParamsVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::VMatrix.
Definition at line 78 of file ExtractNNetParamsVMatrix.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::VMatrix::declareOptions(), extract_w1, extract_w2, extract_wdirect, extract_wout, PLearn::VMatrix::length_, nnet, PLearn::OptionBase::nosave, PLearn::redeclareOption(), and PLearn::VMatrix::width_.
{
// ### Declare all of this object's options here
// ### For the "flags" of each option, you should typically specify
// ### one of OptionBase::buildoption, OptionBase::learntoption or
// ### OptionBase::tuningoption. Another possible flag to be combined with
// ### is OptionBase::nosave
declareOption(ol, "nnet", &ExtractNNetParamsVMatrix::nnet, OptionBase::buildoption,
"The neural network whose parameters are extracted.");
declareOption(ol, "extract_w1", &ExtractNNetParamsVMatrix::extract_w1, OptionBase::buildoption,
"Whether to extract w1.");
declareOption(ol, "extract_w2", &ExtractNNetParamsVMatrix::extract_w2, OptionBase::buildoption,
"Whether to extract w2.");
declareOption(ol, "extract_wdirect", &ExtractNNetParamsVMatrix::extract_wdirect, OptionBase::buildoption,
"Whether to extract wdirect.");
declareOption(ol, "extract_wout", &ExtractNNetParamsVMatrix::extract_wout, OptionBase::buildoption,
"Whether to extract wout.");
// Now call the parent class' declareOptions
inherited::declareOptions(ol);
redeclareOption(ol, "length", &ExtractNNetParamsVMatrix::length_, OptionBase::nosave,
"Overwritten at build time.");
redeclareOption(ol, "width", &ExtractNNetParamsVMatrix::width_, OptionBase::nosave,
"Overwritten at build time.");
}

| static const PPath& PLearn::ExtractNNetParamsVMatrix::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 118 of file ExtractNNetParamsVMatrix.h.
| ExtractNNetParamsVMatrix * PLearn::ExtractNNetParamsVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| void PLearn::ExtractNNetParamsVMatrix::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.
Implements PLearn::RowBufferedVMatrix.
Definition at line 70 of file ExtractNNetParamsVMatrix.cc.
References data.
{
v << data(i);
}
| OptionList & PLearn::ExtractNNetParamsVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| OptionMap & PLearn::ExtractNNetParamsVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| RemoteMethodMap & PLearn::ExtractNNetParamsVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 65 of file ExtractNNetParamsVMatrix.cc.
| void PLearn::ExtractNNetParamsVMatrix::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transform a shallow copy into a deep copy.
Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 146 of file ExtractNNetParamsVMatrix.cc.
References PLearn::RowBufferedVMatrix::makeDeepCopyFromShallowCopy(), and PLERROR.
{
inherited::makeDeepCopyFromShallowCopy(copies);
// deepCopyField(trainvec, copies);
PLERROR("ExtractNNetParamsVMatrix::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Reimplemented from PLearn::RowBufferedVMatrix.
Definition at line 118 of file ExtractNNetParamsVMatrix.h.
Mat PLearn::ExtractNNetParamsVMatrix::data [protected] |
Used to store the precomputed parameters.
Definition at line 68 of file ExtractNNetParamsVMatrix.h.
Referenced by build_(), and getNewRow().
Definition at line 77 of file ExtractNNetParamsVMatrix.h.
Referenced by build_(), and declareOptions().
Definition at line 78 of file ExtractNNetParamsVMatrix.h.
Referenced by build_(), and declareOptions().
Definition at line 79 of file ExtractNNetParamsVMatrix.h.
Referenced by build_(), and declareOptions().
Definition at line 80 of file ExtractNNetParamsVMatrix.h.
Referenced by build_(), and declareOptions().
Definition at line 76 of file ExtractNNetParamsVMatrix.h.
Referenced by build_(), and declareOptions().
1.7.4