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;
202 void operator=(
const Self&) =
delete;
204 void CreateNetwork();
205 void SetupNetworkAndTrain(cv::Mat& labels);
227 #ifndef OTB_MANUAL_INSTANTIATION