![]() |
KSquare Utilities
|
#include <TrainingConfiguration2.h>
Inheritance diagram for KKMLL::TrainingConfiguration2:Classes | |
| class | Factory |
Public Types | |
| typedef Model::ModelTypes | ModelTypes |
| typedef TrainingConfiguration2 const | TrainingConfiguration2Const |
| typedef TrainingConfiguration2Const * | TrainingConfiguration2ConstPtr |
| typedef TrainingConfiguration2 * | TrainingConfiguration2Ptr |
Public Member Functions | |
| TrainingConfiguration2 () | |
| TrainingConfiguration2 (const TrainingConfiguration2 &tc) | |
| TrainingConfiguration2 (MLClassListPtr _mlClasses, FactoryFVProducerPtr _fvFactoryProducer, const KKStr &_parameterStr, RunLog &_log) | |
| Use this one if you want to create a default Configuration object. More... | |
| TrainingConfiguration2 (MLClassListPtr _mlClasses, FileDescPtr _fileDesc, const KKStr &_parameterStr, RunLog &_log) | |
| Use this one if you want to create a default Configuration object. More... | |
| TrainingConfiguration2 (MLClassListPtr _mlClasses, FileDescPtr _fileDesc, ModelParamPtr _modelParameters, RunLog &_log) | |
| Creates a configuration file using the parameters specified in '_modelParameters'; does not read from a configuration file. More... | |
| virtual | ~TrainingConfiguration2 () |
| float | A_Param () const |
| void | A_Param (float _aParam) |
| void | AddATrainingClass (TrainingClassPtr _trainClass) |
| Adds specified Training Class to list taking ownership of it. More... | |
| void | AddATrainingClass (MLClassPtr _newClass) |
| Will assume that images for this class will be saved off the RootDirectory using its own name for the subdirectory name. More... | |
| float | AvgNumOfFeatures () const |
| float | AvgNumOfFeatures (FeatureVectorListPtr trainExamples) const |
| double | C_Param () const |
| double | C_Param (MLClassPtr class1, MLClassPtr class2) const |
| void | C_Param (double _CCC) |
| void | C_Param (MLClassPtr class1, MLClassPtr class2, double cParam) |
| const KKStr & | ConfigFileNameSpecified () const |
| const KKStr & | ConfigRootName () const |
| virtual FactoryFVProducerPtr | DefaultFeatureVectorProducer (RunLog &runLog) const |
| KKStr | DirectoryPathForClass (MLClassPtr mlClass) const |
| Fully expanded directory path for specified class. More... | |
| virtual TrainingConfiguration2Ptr | Duplicate () const |
| void | EmptyTrainingClasses () |
| Removes all training classes from the configuration; example use would be to remove all classes and then add the two needed by a Binary-Class-Pair classifier. More... | |
| SVM_EncodingMethod | EncodingMethod () const |
| void | EncodingMethod (SVM_EncodingMethod _encodingMethod) |
| kkint32 | ExamplesPerClass () const |
| void | ExamplesPerClass (kkint32 _examplesPerClass) |
| MLClassListPtr | ExtractClassList () const |
| MLClassListPtr | ExtractFullHierachyOfClasses () const |
| MLClassListPtr | ExtractListOfClassesForAGivenHierarchialLevel (kkuint32 level) const |
| virtual KKStr | FactoryName () const |
| FileDescPtr | FileDesc () const |
| FactoryFVProducerPtr | FvFactoryProducer (RunLog &log) const |
| bool | FvFactoryProducerSpecified () const |
| double | Gamma () const |
| void | Gamma (double _gamma) |
| TrainingConfiguration2Ptr | GenerateAConfiguraionForAHierarchialLevel (kkuint32 level, RunLog &log) const |
| BinaryClassParmsPtr | GetBinaryClassParms (MLClassPtr class1, MLClassPtr class2) |
| FeatureNumList | GetFeatureNums () const |
| FeatureNumList | GetFeatureNums (MLClassPtr class1, MLClassPtr class2) |
| Returns features selected for the specified class-pairIf none were specified for that pair will return global feature nums. More... | |
| const BinaryClassParmsPtr | GetParamtersToUseFor2ClassCombo (MLClassPtr class1, MLClassPtr class2) const |
| kkint32 | ImagesPerClass () const |
| void | ImagesPerClass (kkint32 _imagesPerClass) |
| SVM_KernalType | KernalType () const |
| void | KernalType (SVM_KernalType _kernalType) |
| virtual void | Load (const KKStr &_configFileName, bool _validateDirectories, RunLog &log) |
| FeatureVectorListPtr | LoadFeatureDataFromTrainingLibraries (KKB::DateTime &latestImageTimeStamp, bool &changesMadeToTrainingLibraries, VolConstBool &cancelFlag, RunLog &log) |
| Load training data from the training library directories. More... | |
| FeatureVectorListPtr | LoadOtherClasssExamples (RunLog &runLog) |
| TrainingClassPtr | LocateByMLClassName (const KKStr &className) |
| SVM_MachineType | MachineType () const |
| void | MachineType (SVM_MachineType _machineType) |
| MLClassListPtr | MlClasses () const |
| Model::ModelTypes | ModelingMethod () const |
| KKStr | ModelParameterCmdLine () const |
| ModelParamPtr | ModelParameters () const |
| void | ModelParameters (ModelParamPtr _modelParameters) |
| Model::ModelTypes | ModelType () const |
| KKStr | ModelTypeStr () const |
| MLClassPtr | NoiseMLClass () const |
| const TrainingClassPtr | NoiseTrainingClass () const |
| bool | NormalizeNominalFeatures () |
| kkint32 | Number_of_rounds () const |
| void | Number_of_rounds (kkint32 _number_of_rounds) |
| kkuint32 | NumHierarchialLevels () const |
| kkint32 | NumOfFeaturesAfterEncoding (RunLog &log) const |
| kkint32 | NumOfRounds () const |
| void | NumOfRounds (kkint32 _numOfRounds) |
| MLClassPtr | OtherClass () const |
| virtual void | ReadXML (XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log) |
| const KKStr & | RootDir () const |
| The root directory where Training library images are stored. More... | |
| void | RootDir (const KKStr &_rootDir) |
| KKStr | RootDirExpanded () const |
| virtual void | Save (const KKStr &fileName) const |
| virtual void | Save (std::ostream &o) const |
| SVM_SelectionMethod | SelectionMethod () const |
| void | SelectionMethod (SVM_SelectionMethod _selectionMethod) |
| void | SetBinaryClassFields (MLClassPtr class1, MLClassPtr class2, const SVM233::svm_parameter &_param, const FeatureNumList &_features, float _weight) |
| void | SetFeatureNums (const FeatureNumList &features) |
| void | SetFeatureNums (MLClassPtr class1, MLClassPtr class2, const FeatureNumList &_features, float _weight=-1) |
| void | SetModelParameters (ModelParamPtr _svmParanters, kkint32 _examplesPerClass) |
| void | SetTrainingClasses (TrainingClassListPtr _trainingClasses) |
| TrainingConfiguration2ListPtr | SubClassifiers () const |
| const SVMparam & | SVMparamREF (RunLog &log) const |
| const TrainingClassList & | TrainingClasses () const |
| void | WriteXML (const KKStr &varName, std::ostream &o) const |
Public Member Functions inherited from KKB::Configuration | |
| Configuration (const KKB::KKStr &_fileName, RunLog &_log) | |
| Configuration () | |
| Configuration (const Configuration &c) | |
| virtual | ~Configuration () |
| const KKB::KKStr & | FileName () const |
| const VectorKKStr & | FormatErrors () const |
| void | FormatErrorsAdd (kkint32 lineNum, const KKStr &error) |
| void | FormatErrorsClear () |
| Call this to clear all format error messages. More... | |
| const VectorInt & | FormatErrorsLineNums () const |
| VectorKKStr | FormatErrorsWithLineNumbers () const |
| bool | FormatGood () const |
| void | FormatGood (bool _formatGood) |
| void | GetSetting (const char *sectiopnName, kkint32 settingNum, KKStrConstPtr &name, KKStrConstPtr &value, kkint32 &lineNum) |
| virtual void | Load (const KKB::KKStr &_fileName, RunLog &_log) |
| void | LoadFile (RunLog &log) |
| virtual kkint32 | MemoryConsumedEstimated () const |
| kkint32 | NumOfSections () |
| kkint32 | NumOfSettings (const KKB::KKStr §ionName) const |
| kkint32 | NumOfSettings (kkint32 sectionNum) const |
| Returns number of settings for the specified section,. More... | |
| void | PrintFormatErrors (std::ostream &o) |
| bool | SectionDefined (const KKB::KKStr §ionName) const |
| Returns true if the section is defined. More... | |
| kkint32 | SectionLineNum (kkint32 sectionNum) const |
| KKStrConstPtr | SectionName (kkint32 sectionNum) const |
| Returns the name of the section for specified index, if index not defined will return NULL. More... | |
| kkint32 | SectionNum (const KKB::KKStr §ionName) const |
| KKStrConstPtr | SettingName (const KKB::KKStr §ionName, kkint32 settingNum) const |
| KKStrConstPtr | SettingName (kkint32 sectionNum, kkint32 settingNum) const |
| KKStrConstPtr | SettingValue (const KKB::KKStr §ionName, const KKB::KKStr &settingName, kkint32 &lineNum) const |
| KKStrConstPtr | SettingValue (kkint32 sectionNum, const KKB::KKStr &settingName, kkint32 &lineNum) const |
| KKStrConstPtr | SettingValue (kkint32 sectionNum, kkint32 settingNum, kkint32 &lineNum) const |
| KKStr | SettingValueToStr (const KKB::KKStr §ionName, const KKB::KKStr &settingName, kkint32 &lineNum) const |
| KKStr | SettingValueToStr (kkint32 sectionNum, const KKB::KKStr &settingName, kkint32 &lineNum) const |
Static Public Member Functions | |
| static bool | ConfigFileExists (const KKStr &_configFileName) |
| static TrainingConfiguration2 * | CreateFromDirectoryStructure (const KKStr &_existingConfigFileName, const KKStr &_subDir, FactoryFVProducerPtr _fvFactoryProducer, RunLog &_log, bool &_successful, KKStr &_errorMessage) |
| Will create a instance using a sub-directory tree to drive the TraningClassList. More... | |
| static TrainingConfiguration2 * | CreateFromFeatureVectorList (FeatureVectorList &_examples, FileDescPtr _fileDesc, const KKStr &_parameterStr, RunLog &_log) |
| static Factory * | FactoryInstace () |
| static KKStr | GetEffectiveConfigFileName (const KKStr &configFileName) |
| Determine the correct configuration file name. More... | |
| static TrainingConfiguration2Ptr | Manufacture (const KKStr &_className, const KKStr &_configFileName, bool _validateDirectories, RunLog &_log) |
| static ModelTypes | ModelTypeFromStr (const KKStr &_modelTypeStr) |
| static KKStr | ModelTypeToStr (ModelTypes _modelType) |
| static void | RegisterFatory (const KKStr &className, Factory *factory) |
Static Public Attributes | |
| static Factory * | factoryInstace = NULL |
Protected Member Functions | |
| void | BuildTrainingClassListFromDirectoryStructure (const KKStr &_subDir, bool &_successful, KKStr &_errorMessage, RunLog &_log) |
| XmlTokenPtr | ReadXMLBaseToken (XmlTokenPtr t, VolConstBool &cancelFlag, RunLog &log) |
| void | ReadXMLPost (VolConstBool &cancelFlag, RunLog &log) |
| void | WriteXMLFields (std::ostream &o) const |
| To be used by both Base Class and Derived classes to write fields that are specific to 'TrainingConfiguration2'. More... | |
Definition at line 54 of file TrainingConfiguration2.h.
Definition at line 57 of file TrainingConfiguration2.h.
Definition at line 61 of file TrainingConfiguration2.h.
Definition at line 62 of file TrainingConfiguration2.h.
Definition at line 60 of file TrainingConfiguration2.h.
| TrainingConfiguration2::TrainingConfiguration2 | ( | ) |
Definition at line 102 of file TrainingConfiguration2.cpp.
References KKB::Configuration::Configuration(), KKB::KKStr::KKStr(), KKMLL::Model::Null, and TrainingConfiguration2().
Referenced by KKMLL::TrainingProcess2::CreateTrainingProcessForLevel(), KKMLL::TrainingConfiguration2::Factory::Manufacture(), KKMLL::FactoryFVProducer::ManufacturTrainingConfiguration(), and TrainingConfiguration2().
| TrainingConfiguration2::TrainingConfiguration2 | ( | const TrainingConfiguration2 & | tc | ) |
Definition at line 364 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::Duplicate(), KKB::KKStr::KKStr(), KKMLL::MLClassList::MLClassList(), TrainingConfiguration2(), and KKMLL::TrainingConfiguration2List::TrainingConfiguration2List().
Referenced by Duplicate(), GenerateAConfiguraionForAHierarchialLevel(), and TrainingConfiguration2().
| TrainingConfiguration2::TrainingConfiguration2 | ( | MLClassListPtr | _mlClasses, |
| FactoryFVProducerPtr | _fvFactoryProducer, | ||
| const KKStr & | _parameterStr, | ||
| RunLog & | _log | ||
| ) |
Use this one if you want to create a default Configuration object.
| [in] | _mlClasses | Will make copy of list of MLClasses and NOT take ownership. |
| [in] | _fvFactoryProducer | If NULL will default to "GrayScaleImagesFVProducerFactory". |
| [in] | _parameterStr | Sting with Machine Learning Parameters. |
| [in] | _log | Where to send logging messages to. |
Definition at line 172 of file TrainingConfiguration2.cpp.
References KKB::Configuration::Configuration(), DefaultFeatureVectorProducer(), KKMLL::FeatureNumList::FeatureNumList(), KKMLL::FactoryFVProducer::FileDesc(), KKB::KKStr::KKStr(), KKMLL::MLClassList::MLClassList(), KKMLL::MLClass::Name(), KKMLL::Model::Null, KKMLL::Model::OldSVM, KKMLL::FeatureNumList::SetAllFeatures(), KKMLL::TrainingClass::TrainingClass(), TrainingConfiguration2(), and KKMLL::ModelParam::ValidParam().
Referenced by CreateFromDirectoryStructure(), and TrainingConfiguration2().
| TrainingConfiguration2::TrainingConfiguration2 | ( | MLClassListPtr | _mlClasses, |
| FileDescPtr | _fileDesc, | ||
| const KKStr & | _parameterStr, | ||
| RunLog & | _log | ||
| ) |
Use this one if you want to create a default Configuration object.
We know what the underlying feature data is from _fileDesc but we do not know how they are computed; that is why we do not provide a "FactoryFVProducer" instance.
| [in] | _mlClasses | Will make copy of list of MLClasses and NOT take ownership. |
| [in] | _fileDesc | Description of the Feature-Vector fields. |
| [in] | _parameterStr | Sting with Machine Learning Parameters. |
| [in] | _log | Where to send logging messages to. |
Definition at line 242 of file TrainingConfiguration2.cpp.
References KKB::Configuration::Configuration(), KKMLL::FeatureNumList::FeatureNumList(), KKB::KKStr::KKStr(), KKMLL::MLClassList::MLClassList(), KKMLL::MLClass::Name(), KKMLL::Model::Null, KKMLL::Model::OldSVM, KKMLL::FeatureNumList::SetAllFeatures(), KKMLL::TrainingClass::TrainingClass(), TrainingConfiguration2(), and KKMLL::ModelParam::ValidParam().
Referenced by CreateFromFeatureVectorList(), and TrainingConfiguration2().
| TrainingConfiguration2::TrainingConfiguration2 | ( | MLClassListPtr | _mlClasses, |
| FileDescPtr | _fileDesc, | ||
| ModelParamPtr | _modelParameters, | ||
| RunLog & | _log | ||
| ) |
Creates a configuration file using the parameters specified in '_modelParameters'; does not read from a configuration file.
For each class specified in '_mlClasses' a 'TrainingClass' instance will be created. All feature-numbers will be assumed to be selected and unlimited examples per class will be allowed.
| [in] | _mlClasses | |
| [in] | _fileDesc | Description of the Feature-Vector fields. |
| [in] | _modelParameters | Will take ownership of this instance. |
| [in] | _log |
Definition at line 308 of file TrainingConfiguration2.cpp.
References KKB::Configuration::Configuration(), KKMLL::ModelParam::Dual, KKMLL::Model::Dual, KKB::KKStr::KKStr(), KKMLL::ModelParam::KNN, KKMLL::Model::KNN, KKMLL::MLClassList::MLClassList(), KKMLL::ModelParam::ModelParamType(), KKMLL::MLClass::Name(), KKMLL::Model::Null, KKMLL::ModelParam::OldSVM, KKMLL::Model::OldSVM, KKMLL::ModelParam::SvmBase, KKMLL::Model::SvmBase, KKMLL::TrainingClass::TrainingClass(), TrainingConfiguration2(), KKMLL::ModelParam::UsfCasCor, and KKMLL::Model::UsfCasCor.
Referenced by TrainingConfiguration2().
|
virtual |
Definition at line 420 of file TrainingConfiguration2.cpp.
| float TrainingConfiguration2::A_Param | ( | ) | const |
Definition at line 1054 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::A_Param().
| void TrainingConfiguration2::A_Param | ( | float | _aParam | ) |
Definition at line 1064 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::A_Param().
| void TrainingConfiguration2::AddATrainingClass | ( | TrainingClassPtr | _trainClass | ) |
Adds specified Training Class to list taking ownership of it.
Add a Training class to configuration Will take ownership of allocation.
Definition at line 993 of file TrainingConfiguration2.cpp.
Referenced by AddATrainingClass(), and GenerateAConfiguraionForAHierarchialLevel().
| void TrainingConfiguration2::AddATrainingClass | ( | MLClassPtr | _newClass | ) |
Will assume that images for this class will be saved off the RootDirectory using its own name for the subdirectory name.
Will assume that images for this class will be saved off the RootDirectory using its own name for the subdirectory name.
< Weight given to this Class during training
< CountFactor.
< Sub-Classifier.
Definition at line 1004 of file TrainingConfiguration2.cpp.
References AddATrainingClass(), KKMLL::MLClass::Name(), and KKMLL::TrainingClass::TrainingClass().
| float TrainingConfiguration2::AvgNumOfFeatures | ( | ) | const |
Definition at line 1263 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::AvgMumOfFeatures().
| float TrainingConfiguration2::AvgNumOfFeatures | ( | FeatureVectorListPtr | trainExamples | ) | const |
Definition at line 1272 of file TrainingConfiguration2.cpp.
References KKMLL::SVMparam::AvgNumOfFeatures().
|
protected |
Definition at line 877 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), KKMLL::TrainingClassList::DuplicateListAndContents(), EmptyTrainingClasses(), KKMLL::TrainingClass::ExpandedDirectory(), KKMLL::TrainingClass::FeatureFileName(), ImagesPerClass(), KKMLL::TrainingClassList::LocateByDirectory(), KKMLL::TrainingClass::MLClass(), ModelParameters(), KKMLL::ModelParamOldSVM::ModelParamOldSVM(), KKMLL::ModelParamOldSVM::ParseCmdLine(), and TrainingClasses().
Referenced by CreateFromDirectoryStructure().
| double TrainingConfiguration2::C_Param | ( | ) | const |
Definition at line 1090 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::C_Param().
| double TrainingConfiguration2::C_Param | ( | MLClassPtr | class1, |
| MLClassPtr | class2 | ||
| ) | const |
Definition at line 1213 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::C_Param().
| void TrainingConfiguration2::C_Param | ( | double | _CCC | ) |
Definition at line 1100 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::C_Param().
| void TrainingConfiguration2::C_Param | ( | MLClassPtr | class1, |
| MLClassPtr | class2, | ||
| double | cParam | ||
| ) |
Definition at line 1226 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::C_Param().
|
static |
Definition at line 2296 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), GetEffectiveConfigFileName(), and KKB::osFileExists().
Referenced by KKMLL::ModelDual::TrainModel().
|
inline |
Definition at line 186 of file TrainingConfiguration2.h.
Referenced by KKMLL::TrainingProcess2::BuildTrainingProcess(), and KKMLL::TrainingProcess2::SaveTrainingProcess().
|
inline |
Definition at line 187 of file TrainingConfiguration2.h.
Referenced by KKMLL::Classifier2::Classifier2(), KKMLL::TrainingProcess2::CreateTrainingProcess(), and KKMLL::TrainingConfiguration2List::LookUp().
|
static |
Will create a instance using a sub-directory tree to drive the TraningClassList.
for each unique sub-directory entry below it that contains 'bmp' files a TrainingClass' instance will be created using the root-name as the class name. If an existing Config file already exists then parameters will be taken from it otherwise a default configuration will be created.
| [in] | _existingConfigFileName | Caller can specify an existing Configuration file to extract configuration parameters from; if left blank then a configuration file with the same name of the last name in the directory path specified by _subDir will be assumed in the default TraningModel directory. If still no configuration file found then one will be created using default parameters. |
| [in] | _subDir | The root directory entry to the Sub-Directory structure that is to be used to construct training class list from. |
| [in] | _fvFactoryProducer | The FeatureVector computation routines you want to use; if NULL will default. |
| [in] | _log | |
| [out] | _successful | |
| [out] | _errorMessage | Will contain description of errors encountered. |
Definition at line 790 of file TrainingConfiguration2.cpp.
References BuildTrainingClassListFromDirectoryStructure(), KKB::KKStr::Concat(), KKB::KKStr::Empty(), KKMLL::GrayScaleImagesFVProducerFactory::Factory(), Gamma(), Load(), KKMLL::FactoryFVProducer::ManufacturTrainingConfiguration(), KKB::KKStr::operator+(), KKB::KKStr::operator=(), KKB::osAddSlash(), KKB::osFileExists(), KKB::osGetRootNameOfDirectory(), RootDir(), Save(), TrainingConfiguration2(), and KKMLL::KKMLVariables::TrainingModelsDir().
|
static |
Definition at line 758 of file TrainingConfiguration2.cpp.
References KKMLL::FeatureVectorList::AllFeatures(), KKB::KKStr::Concat(), KKB::KKStr::Empty(), KKMLL::FeatureVectorList::ExtractListOfClasses(), KKMLL::FeatureVectorList::FileDesc(), KKB::KKStr::operator=(), SetFeatureNums(), KKMLL::MLClassList::SortByName(), and TrainingConfiguration2().
|
virtual |
Definition at line 452 of file TrainingConfiguration2.cpp.
References KKMLL::GrayScaleImagesFVProducerFactory::Factory().
Referenced by FvFactoryProducer(), ReadXMLPost(), and TrainingConfiguration2().
| KKStr TrainingConfiguration2::DirectoryPathForClass | ( | MLClassPtr | mlClass | ) | const |
Fully expanded directory path for specified class.
| mlClass | Class that we want to get directory path for training images. |
Definition at line 476 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::EmptyStr(), KKMLL::TrainingClass::ExpandedDirectory(), and KKMLL::TrainingClass::MLClass().
|
virtual |
Definition at line 436 of file TrainingConfiguration2.cpp.
References TrainingConfiguration2().
Referenced by KKMLL::TrainingProcess2::BuildTrainingProcess().
| void TrainingConfiguration2::EmptyTrainingClasses | ( | ) |
Removes all training classes from the configuration; example use would be to remove all classes and then add the two needed by a Binary-Class-Pair classifier.
Definition at line 1974 of file TrainingConfiguration2.cpp.
Referenced by BuildTrainingClassListFromDirectoryStructure(), GenerateAConfiguraionForAHierarchialLevel(), and SetTrainingClasses().
| SVM_EncodingMethod TrainingConfiguration2::EncodingMethod | ( | ) | const |
Definition at line 1202 of file TrainingConfiguration2.cpp.
References KKMLL::SVMparam::EncodingMethod(), and KKMLL::NoEncoding.
| void TrainingConfiguration2::EncodingMethod | ( | SVM_EncodingMethod | _encodingMethod | ) |
Definition at line 1194 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::EncodingMethod().
| kkint32 TrainingConfiguration2::ExamplesPerClass | ( | ) | const |
Definition at line 1335 of file TrainingConfiguration2.cpp.
Referenced by KKMLL::CrossValidation::CrossValidation(), and ImagesPerClass().
| void TrainingConfiguration2::ExamplesPerClass | ( | kkint32 | _examplesPerClass | ) |
Definition at line 1328 of file TrainingConfiguration2.cpp.
Referenced by ImagesPerClass().
| MLClassListPtr TrainingConfiguration2::ExtractClassList | ( | ) | const |
Constructs new list of classes that caller will own.
Definition at line 701 of file TrainingConfiguration2.cpp.
References KKMLL::MLClassList::MLClassList(), and KKMLL::MLClassList::SortByName().
Referenced by KKMLL::TrainingProcess2::CreateTrainingProcessForLevel().
| MLClassListPtr TrainingConfiguration2::ExtractFullHierachyOfClasses | ( | ) | const |
Extracts the list of classes including ones from Sub-Classifiers
Definition at line 722 of file TrainingConfiguration2.cpp.
References ExtractFullHierachyOfClasses(), KKMLL::MLClassList::MLClassList(), KKMLL::MLClassList::SortByName(), and KKMLL::TrainingClass::SubClassifier().
Referenced by KKMLL::TrainingProcess2::ExtractFullHierachyOfClasses(), and ExtractFullHierachyOfClasses().
| MLClassListPtr TrainingConfiguration2::ExtractListOfClassesForAGivenHierarchialLevel | ( | kkuint32 | level | ) | const |
Definition at line 530 of file TrainingConfiguration2.cpp.
References KKMLL::MLClass::MLClassForGivenHierarchialLevel(), and KKMLL::MLClassList::MLClassList().
Referenced by GenerateAConfiguraionForAHierarchialLevel().
|
static |
Definition at line 2415 of file TrainingConfiguration2.cpp.
References KKB::GlobalGoalKeeper::EndBlock(), KKMLL::TrainingConfiguration2::Factory::Factory(), factoryInstace, RegisterFatory(), and KKB::GlobalGoalKeeper::StartBlock().
|
inlinevirtual |
The name of the Factory class that produces an instance of this class.
Definition at line 500 of file TrainingConfiguration2.h.
|
inline |
Definition at line 190 of file TrainingConfiguration2.h.
Referenced by KKMLL::NormalizationParms::NormalizationParms().
| FactoryFVProducerPtr TrainingConfiguration2::FvFactoryProducer | ( | RunLog & | log | ) | const |
Definition at line 443 of file TrainingConfiguration2.cpp.
References DefaultFeatureVectorProducer().
Referenced by KKMLL::TrainingProcess2::BuildTrainingProcess(), KKMLL::TrainingProcess2::CreateModelsFromTrainingData(), KKMLL::TrainingProcess2::CreateTrainingProcessForLevel(), KKMLL::CrossValidation::CrossValidation(), KKMLL::TrainingProcess2::ExtractTrainingClassFeatures(), and KKMLL::TrainingProcess2::ReadXML().
|
inline |
Definition at line 192 of file TrainingConfiguration2.h.
| double TrainingConfiguration2::Gamma | ( | ) | const |
Definition at line 1072 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::Gamma().
Referenced by CreateFromDirectoryStructure().
| void TrainingConfiguration2::Gamma | ( | double | _gamma | ) |
Definition at line 1082 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::Gamma().
Referenced by CreateFromDirectoryStructure().
| TrainingConfiguration2Ptr TrainingConfiguration2::GenerateAConfiguraionForAHierarchialLevel | ( | kkuint32 | level, |
| RunLog & | log | ||
| ) | const |
Definition at line 548 of file TrainingConfiguration2.cpp.
References AddATrainingClass(), KKMLL::TrainingClass::Directories(), EmptyTrainingClasses(), ExtractListOfClassesForAGivenHierarchialLevel(), KKMLL::TrainingClass::MLClass(), KKMLL::MLClass::MLClassForGivenHierarchialLevel(), KKMLL::MLClass::Name(), KKMLL::TrainingClass::TrainingClass(), and TrainingConfiguration2().
Referenced by KKMLL::TrainingProcess2::CreateTrainingProcessForLevel().
| BinaryClassParmsPtr TrainingConfiguration2::GetBinaryClassParms | ( | MLClassPtr | class1, |
| MLClassPtr | class2 | ||
| ) |
if BinaryClass parms exist for the two specified classes will return otherwise NULL.
Definition at line 2382 of file TrainingConfiguration2.cpp.
References KKMLL::SVMparam::GetBinaryClassParms().
Determine the correct configuration file name.
Definition at line 2259 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::Empty(), KKB::KKStr::operator+(), KKB::KKStr::operator=(), KKB::osAddSlash(), KKB::osFileExists(), KKB::osGetCurrentDirectory(), KKB::osGetFileExtension(), KKB::osGetPathPartOfFile(), KKB::osGetRootNameWithExtension(), KKB::osRemoveExtension(), and KKMLL::KKMLVariables::TrainingModelsDir().
Referenced by ConfigFileExists(), KKMLL::TrainingProcess2::CreateTrainingProcess(), Load(), KKMLL::TrainingProcess2::LoadExistingTrainingProcess(), and KKMLL::TrainingProcess2::SaveTrainingProcess().
| FeatureNumList TrainingConfiguration2::GetFeatureNums | ( | ) | const |
Definition at line 1302 of file TrainingConfiguration2.cpp.
References KKMLL::FeatureNumList::FeatureNumList(), and KKMLL::ModelParam::SelectedFeatures().
| FeatureNumList TrainingConfiguration2::GetFeatureNums | ( | MLClassPtr | class1, |
| MLClassPtr | class2 | ||
| ) |
Returns features selected for the specified class-pairIf none were specified for that pair will return global feature nums.
Definition at line 1342 of file TrainingConfiguration2.cpp.
References KKMLL::FeatureNumList::AllFeatures(), and KKMLL::ModelParamOldSVM::GetFeatureNums().
| const BinaryClassParmsPtr TrainingConfiguration2::GetParamtersToUseFor2ClassCombo | ( | MLClassPtr | class1, |
| MLClassPtr | class2 | ||
| ) | const |
Definition at line 2370 of file TrainingConfiguration2.cpp.
References KKMLL::SVMparam::GetParamtersToUseFor2ClassCombo().
|
inline |
Definition at line 194 of file TrainingConfiguration2.h.
References ExamplesPerClass().
|
inline |
Definition at line 248 of file TrainingConfiguration2.h.
References ExamplesPerClass().
Referenced by BuildTrainingClassListFromDirectoryStructure().
| SVM_KernalType TrainingConfiguration2::KernalType | ( | ) | const |
Definition at line 1283 of file TrainingConfiguration2.cpp.
References KKMLL::SVMparam::KernalType(), and KKMLL::Linear.
| void TrainingConfiguration2::KernalType | ( | SVM_KernalType | _kernalType | ) |
Definition at line 1293 of file TrainingConfiguration2.cpp.
References KKMLL::SVMparam::KernalType().
|
virtual |
Definition at line 130 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), GetEffectiveConfigFileName(), KKMLL::MLClassList::MLClassList(), KKB::KKStr::operator=(), and KKB::osGetRootName().
Referenced by CreateFromDirectoryStructure(), KKMLL::TrainingProcess2::CreateTrainingProcessForLevel(), KKMLL::TrainingConfiguration2::Factory::Manufacture(), and KKMLL::ModelDual::TrainModel().
| FeatureVectorListPtr TrainingConfiguration2::LoadFeatureDataFromTrainingLibraries | ( | KKB::DateTime & | latestImageTimeStamp, |
| bool & | changesMadeToTrainingLibraries, | ||
| VolConstBool & | cancelFlag, | ||
| RunLog & | log | ||
| ) |
Load training data from the training library directories.
Loads all the FeatureData from the Training Library. The images in the sub-directories specified by the 'TrainingClass' entries will be used as the primary source. Data from existing FeatureData files will be used unless they are out of date. In that case the data will be recomputed from the original images.
The 'ExampleFileName' A field that is in each 'FeatureVector' instance will reflect the sub-directory from where it was retrieved. Between that and the 'rootDir' field you will be able to get the full path to then original image.
| [out] | latestImageTimeStamp | Time-stamp of the most current image loaded. |
| [out] | changesMadeToTrainingLibraries | True if any image needed to have its features recalculated or images were removed or added to a training directory. |
| [in] | cancelFlag | Will monitor this flag; if turns true will terminate the load and return. |
| [in] | log | Logging File. |
Definition at line 2077 of file TrainingConfiguration2.cpp.
References KKMLL::FeatureVectorList::AddQueue(), KKMLL::FactoryFVProducer::ManufacturFeatureVectorList(), NoiseTrainingClass(), KKB::DateTime::operator=(), and KKB::DateTime::operator>().
| FeatureVectorListPtr TrainingConfiguration2::LoadOtherClasssExamples | ( | RunLog & | runLog | ) |
Definition at line 2023 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), KKMLL::FactoryFVProducer::DefaultFeatureFileIO(), KKB::KKStr::Empty(), KKMLL::FeatureFileIO::FeatureDataReSink(), KKMLL::MLClass::Name(), KKB::KKStr::operator+(), KKB::KKStr::operator=(), KKB::osAddSlash(), and KKB::osSubstituteInEnvironmentVariables().
| TrainingClassPtr TrainingConfiguration2::LocateByMLClassName | ( | const KKStr & | className | ) |
Definition at line 1967 of file TrainingConfiguration2.cpp.
| SVM_MachineType TrainingConfiguration2::MachineType | ( | ) | const |
Definition at line 1142 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::MachineType(), and KKMLL::Null.
| void TrainingConfiguration2::MachineType | ( | SVM_MachineType | _machineType | ) |
Definition at line 1132 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::MachineType().
|
static |
Definition at line 2430 of file TrainingConfiguration2.cpp.
References KKB::GlobalGoalKeeper::EndBlock(), and KKB::GlobalGoalKeeper::StartBlock().
|
inline |
Definition at line 197 of file TrainingConfiguration2.h.
Referenced by KKMLL::TrainingProcess2::ExtractTrainingClassFeatures().
|
inline |
Definition at line 198 of file TrainingConfiguration2.h.
Referenced by KKMLL::TrainingProcess2::CreateModelsFromTrainingData().
| KKStr TrainingConfiguration2::ModelParameterCmdLine | ( | ) | const |
Definition at line 690 of file TrainingConfiguration2.cpp.
References ModelParameters(), and KKMLL::ModelParam::ToCmdLineStr().
|
inline |
Definition at line 212 of file TrainingConfiguration2.h.
Referenced by BuildTrainingClassListFromDirectoryStructure(), KKMLL::TrainingProcess2::CreateModelsFromTrainingData(), and ModelParameterCmdLine().
| void TrainingConfiguration2::ModelParameters | ( | ModelParamPtr | _modelParameters | ) |
Definition at line 682 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::Duplicate().
Referenced by BuildTrainingClassListFromDirectoryStructure().
|
inline |
Definition at line 199 of file TrainingConfiguration2.h.
|
inlinestatic |
Definition at line 178 of file TrainingConfiguration2.h.
References KKMLL::Model::ModelTypeFromStr().
|
inline |
Definition at line 200 of file TrainingConfiguration2.h.
References KKMLL::Model::ModelTypeToStr().
|
inlinestatic |
Definition at line 177 of file TrainingConfiguration2.h.
References KKMLL::Model::ModelTypeToStr().
Referenced by KKMLL::operator<<().
|
inline |
Definition at line 201 of file TrainingConfiguration2.h.
|
inline |
Definition at line 202 of file TrainingConfiguration2.h.
Referenced by KKMLL::TrainingProcess2::ExtractTrainingClassFeatures(), and LoadFeatureDataFromTrainingLibraries().
| bool TrainingConfiguration2::NormalizeNominalFeatures | ( | ) |
Definition at line 1985 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::NormalizeNominalFeatures().
Referenced by KKMLL::NormalizationParms::NormalizationParms().
| kkint32 TrainingConfiguration2::Number_of_rounds | ( | ) | const |
Definition at line 1108 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::ModelParamType(), KKMLL::ModelParamUsfCasCor::Number_of_rounds(), and KKMLL::ModelParam::UsfCasCor.
Referenced by NumOfRounds().
| void TrainingConfiguration2::Number_of_rounds | ( | kkint32 | _number_of_rounds | ) |
Definition at line 1122 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::ModelParamType(), KKMLL::ModelParamUsfCasCor::Number_of_rounds(), and KKMLL::ModelParam::UsfCasCor.
Referenced by NumOfRounds().
| kkuint32 TrainingConfiguration2::NumHierarchialLevels | ( | ) | const |
returns back the number of hierarchical levels thereare in the trainingClass that has the most.
Definition at line 491 of file TrainingConfiguration2.cpp.
Definition at line 1318 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::NumOfFeaturesAfterEncoding().
|
inline |
Definition at line 204 of file TrainingConfiguration2.h.
References Number_of_rounds().
|
inline |
Definition at line 253 of file TrainingConfiguration2.h.
References Number_of_rounds().
|
inline |
Definition at line 206 of file TrainingConfiguration2.h.
|
virtual |
Definition at line 2766 of file TrainingConfiguration2.cpp.
References KKB::XmlStream::GetNextToken(), ReadXMLBaseToken(), and ReadXMLPost().
|
protected |
KKKK modelParameters
Definition at line 2589 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::EqualIgnoreCase(), KKMLL::XmlElementMLClassNameList::TakeOwnership(), KKB::XmlToken::tokElement, KKB::XmlToken::TokenType(), KKB::XmlElementBool::Value(), KKB::XmlToken::VarName(), and KKB::XmlElement::VarName().
Referenced by ReadXML().
|
protected |
Definition at line 2740 of file TrainingConfiguration2.cpp.
References DefaultFeatureVectorProducer(), KKB::KKStr::Empty(), KKMLL::FactoryFVProducer::FileDesc(), KKMLL::TrainingClass::SubClassifier(), and KKMLL::TrainingClass::SubClassifierName().
Referenced by ReadXML().
Definition at line 2467 of file TrainingConfiguration2.cpp.
References KKB::GlobalGoalKeeper::EndBlock(), and KKB::GlobalGoalKeeper::StartBlock().
Referenced by FactoryInstace().
|
inline |
The root directory where Training library images are stored.
Definition at line 207 of file TrainingConfiguration2.h.
| void TrainingConfiguration2::RootDir | ( | const KKStr & | _rootDir | ) |
Definition at line 673 of file TrainingConfiguration2.cpp.
References KKB::KKStr::operator=(), and KKB::osSubstituteInEnvironmentVariables().
Referenced by CreateFromDirectoryStructure().
| KKStr TrainingConfiguration2::RootDirExpanded | ( | ) | const |
Definition at line 469 of file TrainingConfiguration2.cpp.
|
virtual |
Definition at line 665 of file TrainingConfiguration2.cpp.
Referenced by CreateFromDirectoryStructure().
|
virtual |
| SVM_SelectionMethod TrainingConfiguration2::SelectionMethod | ( | ) | const |
Definition at line 1162 of file TrainingConfiguration2.cpp.
References KKMLL::Null, and KKMLL::ModelParamOldSVM::SelectionMethod().
| void TrainingConfiguration2::SelectionMethod | ( | SVM_SelectionMethod | _selectionMethod | ) |
Definition at line 1153 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::SelectionMethod().
| void TrainingConfiguration2::SetBinaryClassFields | ( | MLClassPtr | class1, |
| MLClassPtr | class2, | ||
| const SVM233::svm_parameter & | _param, | ||
| const FeatureNumList & | _features, | ||
| float | _weight | ||
| ) |
Definition at line 1238 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::SetBinaryClassFields().
| void TrainingConfiguration2::SetFeatureNums | ( | const FeatureNumList & | features | ) |
Definition at line 1173 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::SelectedFeatures().
Referenced by CreateFromFeatureVectorList().
| void TrainingConfiguration2::SetFeatureNums | ( | MLClassPtr | class1, |
| MLClassPtr | class2, | ||
| const FeatureNumList & | _features, | ||
| float | _weight = -1 |
||
| ) |
Definition at line 1179 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParamOldSVM::SetFeatureNums().
| void TrainingConfiguration2::SetModelParameters | ( | ModelParamPtr | _svmParanters, |
| kkint32 | _examplesPerClass | ||
| ) |
Definition at line 1359 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::Duplicate().
| void TrainingConfiguration2::SetTrainingClasses | ( | TrainingClassListPtr | _trainingClasses | ) |
Definition at line 1252 of file TrainingConfiguration2.cpp.
References EmptyTrainingClasses().
|
inline |
Definition at line 210 of file TrainingConfiguration2.h.
Referenced by KKMLL::TrainingProcess2::ReadXML().
Definition at line 1020 of file TrainingConfiguration2.cpp.
References KKB::KKStr::Concat(), KKB::KKException::KKException(), and KKMLL::ModelParamOldSVM::SvmParameters().
|
inline |
Definition at line 211 of file TrainingConfiguration2.h.
Referenced by BuildTrainingClassListFromDirectoryStructure(), and KKMLL::TrainingProcess2::ExtractTrainingClassFeatures().
| void TrainingConfiguration2::WriteXML | ( | const KKStr & | varName, |
| std::ostream & | o | ||
| ) | const |
Definition at line 2570 of file TrainingConfiguration2.cpp.
References KKB::XmlTag::AddAtribute(), KKB::KKStr::Empty(), KKB::XmlTag::tagEnd, KKB::XmlTag::tagStart, KKB::XmlTag::WriteXML(), WriteXMLFields(), and KKB::XmlTag::XmlTag().
Referenced by KKMLL::ModelDual::WriteXML(), and KKMLL::TrainingProcess2::WriteXML().
|
protected |
To be used by both Base Class and Derived classes to write fields that are specific to 'TrainingConfiguration2'.
Definition at line 2513 of file TrainingConfiguration2.cpp.
References KKMLL::ModelParam::WriteXML(), KKB::XmlElementBool::WriteXML(), and KKMLL::XmlElementMLClassNameList::WriteXML().
Referenced by WriteXML().
|
static |
Definition at line 532 of file TrainingConfiguration2.h.
Referenced by FactoryInstace().