21 #ifndef otbNeuralNetworkMachineLearningModel_h
22 #define otbNeuralNetworkMachineLearningModel_h
27 #include "itkLightObject.h"
28 #include "itkFixedArray.h"
33 template <
class TInputValue,
class TTargetValue>
65 itkGetMacro(TrainMethod,
int);
66 itkSetMacro(TrainMethod,
int);
74 void SetLayerSizes(
const std::vector<unsigned int> layers);
85 itkGetMacro(ActivateFunction,
int);
86 itkSetMacro(ActivateFunction,
int);
93 itkGetMacro(Alpha,
double);
94 itkSetMacro(Alpha,
double);
101 itkGetMacro(Beta,
double);
102 itkSetMacro(Beta,
double);
110 itkGetMacro(BackPropDWScale,
double);
111 itkSetMacro(BackPropDWScale,
double);
121 itkGetMacro(BackPropMomentScale,
double);
122 itkSetMacro(BackPropMomentScale,
double);
129 itkGetMacro(RegPropDW0,
double);
130 itkSetMacro(RegPropDW0,
double);
137 itkGetMacro(RegPropDWMin,
double);
138 itkSetMacro(RegPropDWMin,
double);
146 itkGetMacro(TermCriteriaType,
int);
147 itkSetMacro(TermCriteriaType,
int);
154 itkGetMacro(MaxIter,
int);
155 itkSetMacro(MaxIter,
int);
162 itkGetMacro(Epsilon,
double);
163 itkSetMacro(Epsilon,
double);
167 void Train()
override;
170 void Save(
const std::string& filename,
const std::string& name =
"")
override;
173 void Load(
const std::string& filename,
const std::string& name =
"")
override;
179 bool CanReadFile(
const std::string&)
override;
182 bool CanWriteFile(
const std::string&)
override;
198 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
204 void CreateNetwork();
205 void SetupNetworkAndTrain(cv::Mat& labels);
227 #ifndef OTB_MANUAL_INSTANTIATION
MachineLearningModel is the base class for all classifier objects (SVM, KNN, Random Forests,...
itk::Statistics::ListSample< TargetSampleType > TargetListSampleType
MLMTargetTraits< TConfidenceValue >::ValueType ConfidenceValueType
itk::VariableLengthVector< double > ProbaSampleType
MLMTargetTraits< TTargetValue >::ValueType TargetValueType
MLMSampleTraits< TInputValue >::SampleType InputSampleType
MLMTargetTraits< TTargetValue >::SampleType TargetSampleType
Superclass::TargetSampleType TargetSampleType
itk::SmartPointer< const Self > ConstPointer
std::vector< unsigned int > m_LayerSizes
Superclass::TargetValueType TargetValueType
void operator=(const Self &)=delete
Superclass::InputListSampleType InputListSampleType
cv::Ptr< cv::ml::ANN_MLP > m_ANNModel
Superclass::TargetListSampleType TargetListSampleType
Superclass::InputSampleType InputSampleType
NeuralNetworkMachineLearningModel Self
double m_BackPropMomentScale
std::map< TargetValueType, unsigned int > MapOfLabelsType
Superclass::ConfidenceValueType ConfidenceValueType
Superclass::ProbaSampleType ProbaSampleType
itk::SmartPointer< Self > Pointer
~NeuralNetworkMachineLearningModel() override=default
MachineLearningModel< TInputValue, TTargetValue > Superclass
Superclass::InputValueType InputValueType
NeuralNetworkMachineLearningModel(const Self &)=delete
MapOfLabelsType m_MapOfLabels
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.