#include <Serialization.h>
Public Member Functions | |
Serialization (const string ­pFileName, const string &weakLearnerName) | |
The constructor. | |
~Serialization () | |
The destructor. | |
void | saveHypotheses (vector< BaseLearner * > &weakHypotheses) |
Save all the weak hypothesis all at once. | |
void | appendHypothesis (const int iteration, BaseLearner *pWeakHypothesis) |
Append the passed weak hypothesis to the file. | |
Static Public Member Functions | |
template<typename T> | |
static string | standardTag (const string &tagName, const T &value, const int numTab=0) |
Create a standard xml <tag>value<\tag>. | |
template<typename T> | |
static string | vectorTag (const string &tagName, const vector< T > &values, const int numTab=0) |
Create a set of xml tags that describes a vector. | |
Static Private Member Functions | |
static string | getTabs (const int numTabs) |
Create a string which contains only tab characters. | |
Private Attributes | |
string | _shypFileName |
The strong learner file name. |
Definition at line 52 of file Serialization.h.
|
The constructor. Create the serialization object, and write the header.
Definition at line 34 of file Serialization.cpp. References Serialization::standardTag(). |
|
The destructor. It just closes the xml tag.
Definition at line 49 of file Serialization.cpp. References Serialization::_shypFileName. |
|
Append the passed weak hypothesis to the file.
Definition at line 67 of file Serialization.cpp. References Serialization::_shypFileName, and BaseLearner::save(). Referenced by Serialization::saveHypotheses(). |
|
Create a string which contains only tab characters.
Definition at line 159 of file Serialization.h. Referenced by Serialization::standardTag(), and Serialization::vectorTag(). |
|
Save all the weak hypothesis all at once.
Definition at line 58 of file Serialization.cpp. References Serialization::appendHypothesis(). |
|
Create a standard xml <tag>value<\tag>.
Definition at line 99 of file Serialization.h. References Serialization::getTabs(). Referenced by StumpLearner::save(), SingleStumpLearner::save(), BaseLearner::save(), and Serialization::Serialization(). |
|
Create a set of xml tags that describes a vector. For instance, if the vector values is [-1, 1, 1], with tagName="vArray", and the classes are ["one", "two", "three"] will return: <vArray size="3"> <class id="one">-1</class> <class id="two">1</class> <class id="three">1</class> </vArray>
Definition at line 126 of file Serialization.h. References ClassMappings::getClassNameFromIdx(), and Serialization::getTabs(). Referenced by StumpLearner::save(), and MultiStumpLearner::save(). |