PLearn 0.1
|
The first sentence should be a BRIEF DESCRIPTION of what the class does. More...
#include <InstanceSnippetTest.h>
Public Types | |
typedef PythonCodeSnippet | inherited |
Public Member Functions | |
TestSnippet (const string &xtra="") | |
virtual void | build () |
Post-constructor. | |
void | build_ () |
This does the actual building. | |
PythonObjectWrapper | getLearner (const TVec< PythonObjectWrapper > &args) |
PythonObjectWrapper | recTest (const TVec< PythonObjectWrapper > &args) |
PythonObjectWrapper | recTest2 (const TVec< PythonObjectWrapper > &args) |
PythonObjectWrapper | recTestCrash (const TVec< PythonObjectWrapper > &args) |
Public Attributes | |
PP< PLearner > | ll |
The first sentence should be a BRIEF DESCRIPTION of what the class does.
Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html
Definition at line 62 of file InstanceSnippetTest.h.
Reimplemented from PLearn::PythonCodeSnippet.
Definition at line 65 of file InstanceSnippetTest.h.
PLearn::TestSnippet::TestSnippet | ( | const string & | xtra = "" | ) | [inline] |
Definition at line 69 of file InstanceSnippetTest.h.
:PythonCodeSnippet(string("from plearn.pybridge.test_embedded_code_snippet import *\n") + xtra, true), ll(new LinearRegressor()) {}
virtual void PLearn::TestSnippet::build | ( | ) | [inline, virtual] |
Post-constructor.
The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.
Reimplemented from PLearn::PythonCodeSnippet.
Definition at line 76 of file InstanceSnippetTest.h.
References PLearn::PythonCodeSnippet::build(), and build_().
Referenced by PLearn::InstanceSnippetTest::perform().
{ inherited::build(); build_(); }
void PLearn::TestSnippet::build_ | ( | ) | [inline] |
This does the actual building.
This is where the Python code is in fact compiled
Reimplemented from PLearn::PythonCodeSnippet.
Definition at line 82 of file InstanceSnippetTest.h.
References getLearner(), PLearn::PythonCodeSnippet::inject(), recTest(), recTest2(), and recTestCrash().
Referenced by build().
{ inject("getLearner", this, &TestSnippet::getLearner); inject("recTest", this, &TestSnippet::recTest); inject("recTest2", this, &TestSnippet::recTest2); inject("recTestCrash", this, &TestSnippet::recTestCrash); }
PythonObjectWrapper PLearn::TestSnippet::getLearner | ( | const TVec< PythonObjectWrapper > & | args | ) | [inline] |
PythonObjectWrapper PLearn::TestSnippet::recTest | ( | const TVec< PythonObjectWrapper > & | args | ) | [inline] |
Definition at line 96 of file InstanceSnippetTest.h.
References PLearn::endl(), PLearn::PythonCodeSnippet::invoke(), n, and PLearn::pout.
Referenced by build_().
{ int n= args[0]; if(n%100 == 0) pout << "recTest\t" << n << endl; invoke("testRec", args); return PythonObjectWrapper(n); }
PythonObjectWrapper PLearn::TestSnippet::recTest2 | ( | const TVec< PythonObjectWrapper > & | args | ) | [inline] |
Definition at line 105 of file InstanceSnippetTest.h.
References PLearn::endl(), PLearn::PythonCodeSnippet::invoke(), and PLearn::pout.
Referenced by build_().
{ PP<PLearner> l= args[0]; --l->nstages; if(l->nstages%100 == 0) pout << "recTest2\t" << l->nstages << "\tnrefs=" << l->usage() << endl; invoke("testRec2", args); return args[0]; }
PythonObjectWrapper PLearn::TestSnippet::recTestCrash | ( | const TVec< PythonObjectWrapper > & | args | ) | [inline] |
Definition at line 115 of file InstanceSnippetTest.h.
References PLearn::endl(), PLearn::PythonCodeSnippet::invoke(), n, and PLearn::pout.
Referenced by build_().
{ int n= args[0]; pout << "recTestCrash\t" << n << endl; invoke("testRecCrash", n-1); return PythonObjectWrapper(); }
Definition at line 67 of file InstanceSnippetTest.h.
Referenced by getLearner(), and PLearn::InstanceSnippetTest::perform().