21 #define GRT_DLL_EXPORTS 27 UINT PostProcessing::numPostProcessingInstances = 0;
30 PostProcessing* PostProcessing::createInstanceFromString(
const std::string &
id) {
return create(
id); }
34 StringPostProcessingMap::iterator iter = getMap()->find(
id );
35 if( iter == getMap()->end() ){
38 return iter->second();
47 postProcessingInputMode = INPUT_MODE_NOT_SET;
48 postProcessingOutputMode = OUTPUT_MODE_NOT_SET;
50 numInputDimensions = 0;
51 numOutputDimensions = 0;
52 numPostProcessingInstances++;
56 if( --numPostProcessingInstances == 0 ){
57 delete stringPostProcessingMap;
58 stringPostProcessingMap = NULL;
64 if( postProcessingModule == NULL ){
65 errorLog <<
"copyBaseVariables(const PostProcessing *postProcessingModule) - postProcessingModule pointer is NULL!" << std::endl;
73 this->postProcessingType = postProcessingModule->postProcessingType;
74 this->postProcessingInputMode = postProcessingModule->postProcessingInputMode;
75 this->postProcessingOutputMode = postProcessingModule->postProcessingOutputMode;
76 this->initialized = postProcessingModule->initialized;
77 this->numInputDimensions = postProcessingModule->numInputDimensions;
78 this->numOutputDimensions = postProcessingModule->numOutputDimensions;
79 this->processedData = postProcessingModule->processedData;
80 this->debugLog = postProcessingModule->debugLog;
81 this->errorLog = postProcessingModule->errorLog;
82 this->warningLog = postProcessingModule->warningLog;
88 if( numOutputDimensions == 0 ){
89 errorLog <<
"init() - Failed to init module, the number of output dimensions is zero!" << std::endl;
95 processedData.
resize( numOutputDimensions );
105 if( !file.is_open() ){
106 errorLog <<
"savePostProcessingSettingsToFile(fstream &file) - The file is not open!" << std::endl;
112 file <<
"Initialized: " << initialized << std::endl;
119 if( !file.is_open() ){
120 errorLog <<
"loadPostProcessingSettingsFromFile(fstream &file) - The file is not open!" << std::endl;
133 if( word !=
"Initialized:" ){
134 errorLog <<
"loadPostProcessingSettingsFromFile(fstream &file) - Failed to read Initialized header!" << std::endl;
148 std::string PostProcessing::getPostProcessingType()
const{
149 return postProcessingType;
153 return postProcessingInputMode;
157 return postProcessingOutputMode;
165 return postProcessingInputMode==INPUT_MODE_PREDICTED_CLASS_LABEL;
169 return postProcessingInputMode==INPUT_MODE_CLASS_LIKELIHOODS;
173 return postProcessingOutputMode==OUTPUT_MODE_PREDICTED_CLASS_LABEL;
177 return postProcessingOutputMode==OUTPUT_MODE_CLASS_LIKELIHOODS;
181 return processedData;
bool saveBaseSettingsToFile(std::fstream &file) const
std::string getId() const
virtual ~PostProcessing(void)
bool getIsPostProcessingInputModeClassLikelihoods() const
bool savePostProcessingSettingsToFile(std::fstream &file) const
PostProcessing * create() const
bool getInitialized() const
virtual bool resize(const unsigned int size)
This is the main base class that all GRT PostProcessing algorithms should inherit from...
bool copyMLBaseVariables(const MLBase *mlBase)
UINT getPostProcessingInputMode() const
bool getIsPostProcessingOutputModePredictedClassLabel() const
UINT getPostProcessingOutputMode() const
bool getIsPostProcessingInputModePredictedClassLabel() const
bool copyBaseVariables(const PostProcessing *postProcessingModule)
bool loadBaseSettingsFromFile(std::fstream &file)
VectorFloat getProcessedData() const
PostProcessing(const std::string &id="")
bool getIsPostProcessingOutputModeClassLikelihoods() const
This is the main base class that all GRT machine learning algorithms should inherit from...
bool loadPostProcessingSettingsFromFile(std::fstream &file)
std::map< std::string, PostProcessing *(*)() > StringPostProcessingMap