OTB
9.0.0
Orfeo Toolbox
|
#include <otbNeuralNetworkMachineLearningModel.h>
Public Types | |
typedef Superclass::ConfidenceValueType | ConfidenceValueType |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef Superclass::InputListSampleType | InputListSampleType |
typedef Superclass::InputSampleType | InputSampleType |
typedef Superclass::InputValueType | InputValueType |
typedef std::map< TargetValueType, unsigned int > | MapOfLabelsType |
typedef itk::SmartPointer< Self > | Pointer |
typedef Superclass::ProbaSampleType | ProbaSampleType |
typedef NeuralNetworkMachineLearningModel | Self |
typedef MachineLearningModel< TInputValue, TTargetValue > | Superclass |
typedef Superclass::TargetListSampleType | TargetListSampleType |
typedef Superclass::TargetSampleType | TargetSampleType |
typedef Superclass::TargetValueType | TargetValueType |
Public Types inherited from otb::MachineLearningModel< TInputValue, TTargetValue > | |
typedef MachineLearningModel | Self |
typedef itk::Object | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef MLMSampleTraits< TInputValue >::ValueType | InputValueType |
typedef MLMSampleTraits< TInputValue >::SampleType | InputSampleType |
typedef itk::Statistics::ListSample< InputSampleType > | InputListSampleType |
typedef MLMTargetTraits< TTargetValue >::ValueType | TargetValueType |
typedef MLMTargetTraits< TTargetValue >::SampleType | TargetSampleType |
typedef itk::Statistics::ListSample< TargetSampleType > | TargetListSampleType |
typedef MLMTargetTraits< double >::ValueType | ConfidenceValueType |
typedef MLMTargetTraits< double >::SampleType | ConfidenceSampleType |
typedef itk::Statistics::ListSample< ConfidenceSampleType > | ConfidenceListSampleType |
typedef itk::VariableLengthVector< double > | ProbaSampleType |
typedef itk::Statistics::ListSample< ProbaSampleType > | ProbaListSampleType |
static Pointer | New () |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetNameOfClass () const |
virtual int | GetTrainMethod () |
virtual void | SetTrainMethod (int _arg) |
void | SetLayerSizes (const std::vector< unsigned int > layers) |
virtual int | GetActivateFunction () |
virtual void | SetActivateFunction (int _arg) |
virtual double | GetAlpha () |
virtual void | SetAlpha (double _arg) |
virtual double | GetBeta () |
virtual void | SetBeta (double _arg) |
virtual double | GetBackPropDWScale () |
virtual void | SetBackPropDWScale (double _arg) |
virtual double | GetBackPropMomentScale () |
virtual void | SetBackPropMomentScale (double _arg) |
virtual double | GetRegPropDW0 () |
virtual void | SetRegPropDW0 (double _arg) |
virtual double | GetRegPropDWMin () |
virtual void | SetRegPropDWMin (double _arg) |
virtual int | GetTermCriteriaType () |
virtual void | SetTermCriteriaType (int _arg) |
virtual int | GetMaxIter () |
virtual void | SetMaxIter (int _arg) |
virtual double | GetEpsilon () |
virtual void | SetEpsilon (double _arg) |
void | Train () override |
void | Save (const std::string &filename, const std::string &name="") override |
void | Load (const std::string &filename, const std::string &name="") override |
Classification model file compatibility tests | |
cv::Ptr< cv::ml::ANN_MLP > | m_ANNModel |
int | m_TrainMethod |
int | m_ActivateFunction |
std::vector< unsigned int > | m_LayerSizes |
double | m_Alpha |
double | m_Beta |
double | m_BackPropDWScale |
double | m_BackPropMomentScale |
double | m_RegPropDW0 |
double | m_RegPropDWMin |
int | m_TermCriteriaType |
int | m_MaxIter |
double | m_Epsilon |
cv::Mat | m_MatrixOfLabels |
MapOfLabelsType | m_MapOfLabels |
bool | CanReadFile (const std::string &) override |
bool | CanWriteFile (const std::string &) override |
NeuralNetworkMachineLearningModel () | |
~NeuralNetworkMachineLearningModel () override=default | |
TargetSampleType | DoPredict (const InputSampleType &input, ConfidenceValueType *quality=nullptr, ProbaSampleType *proba=nullptr) const override |
void | LabelsToMat (const TargetListSampleType *listSample, cv::Mat &output) |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
NeuralNetworkMachineLearningModel (const Self &)=delete | |
void | operator= (const Self &)=delete |
void | CreateNetwork () |
void | SetupNetworkAndTrain (cv::Mat &labels) |
Definition at line 34 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::ConfidenceValueType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::ConfidenceValueType |
Definition at line 49 of file otbNeuralNetworkMachineLearningModel.h.
typedef itk::SmartPointer<const Self> otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::ConstPointer |
Definition at line 41 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::InputListSampleType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::InputListSampleType |
Definition at line 45 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::InputSampleType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::InputSampleType |
Definition at line 44 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::InputValueType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::InputValueType |
Definition at line 43 of file otbNeuralNetworkMachineLearningModel.h.
typedef std::map<TargetValueType, unsigned int> otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::MapOfLabelsType |
Definition at line 51 of file otbNeuralNetworkMachineLearningModel.h.
typedef itk::SmartPointer<Self> otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::Pointer |
Definition at line 40 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::ProbaSampleType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::ProbaSampleType |
Definition at line 50 of file otbNeuralNetworkMachineLearningModel.h.
typedef NeuralNetworkMachineLearningModel otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::Self |
Standard class typedefs.
Definition at line 38 of file otbNeuralNetworkMachineLearningModel.h.
typedef MachineLearningModel<TInputValue, TTargetValue> otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::Superclass |
Definition at line 39 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::TargetListSampleType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::TargetListSampleType |
Definition at line 48 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::TargetSampleType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::TargetSampleType |
Definition at line 47 of file otbNeuralNetworkMachineLearningModel.h.
typedef Superclass::TargetValueType otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::TargetValueType |
Definition at line 46 of file otbNeuralNetworkMachineLearningModel.h.
|
protected |
Constructor
Definition at line 32 of file otbNeuralNetworkMachineLearningModel.hxx.
References otb::MachineLearningModel< TInputValue, TTargetValue >::m_ConfidenceIndex, and otb::MachineLearningModel< TInputValue, TTargetValue >::m_IsRegressionSupported.
|
overrideprotecteddefault |
Destructor
|
privatedelete |
Is the input model file readable and compatible with the corresponding classifier ?
|
overridevirtual |
Is the input model file readable and compatible with the corresponding classifier ?
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 269 of file otbNeuralNetworkMachineLearningModel.hxx.
References CV_TYPE_NAME_ML_ANN_MLP.
|
overridevirtual |
Is the input model file writable and compatible with the corresponding classifier ?
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 295 of file otbNeuralNetworkMachineLearningModel.hxx.
virtual::itk::LightObject::Pointer otb::NeuralNetworkMachineLearningModel< TInputValue, TTargetValue >::CreateAnother | ( | void | ) | const |
Run-time type information (and related methods).
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 125 of file otbNeuralNetworkMachineLearningModel.hxx.
|
overrideprotected |
Predict values using the model
Definition at line 186 of file otbNeuralNetworkMachineLearningModel.hxx.
|
virtual |
Setters/Getters to the neuron activation function 3 methods are available:
|
virtual |
Setters/Getters to the alpha parameter of the activation function Default is 0.
|
virtual |
Strength of the weight gradient term in the BACKPROP method. The recommended value is about 0.1 Default is 0.1
|
virtual |
Strength of the momentum term (the difference between weights on the 2 previous iterations). This parameter provides some inertia to smooth the random fluctuations of the weights. It can vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or so is good enough Default is 0.1
|
virtual |
Setters/Getters to the beta parameter of the activation function Default is 0.
|
virtual |
Epsilon value used in the Termination criteria. default is 0.01
|
virtual |
Maximum number of iteration used in the Termination criteria. default is 1000
|
virtual |
Run-time type information (and related methods).
|
virtual |
Initial value of update-values in RPROP method. Default is 0.1
|
virtual |
Update-values lower limit in RPROP method. It must be positive. Default is FLT_EPSILON
|
virtual |
Termination criteria. It can be CV_TERMCRIT_ITER or CV_TERMCRIT_EPS or CV_TERMCRIT_ITER+CV_TERMCRIT_EPS default is CV_TERMCRIT_ITER+CV_TERMCRIT_EPS.
|
virtual |
Setters/Getters to the train method 2 methods are available:
|
protected |
Converts a ListSample of VariableLengthVector to a CvMat. The user is responsible for freeing the output pointer with the cvReleaseMat function. A null pointer is resturned in case the conversion failed.
Definition at line 68 of file otbNeuralNetworkMachineLearningModel.hxx.
|
overridevirtual |
Load the model from file
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 259 of file otbNeuralNetworkMachineLearningModel.hxx.
|
static |
Run-time type information (and related methods).
|
privatedelete |
Is the input model file readable and compatible with the corresponding classifier ?
|
overrideprotected |
PrintSelf method
Definition at line 301 of file otbNeuralNetworkMachineLearningModel.hxx.
|
overridevirtual |
Save the model to file
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 244 of file otbNeuralNetworkMachineLearningModel.hxx.
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
void otb::NeuralNetworkMachineLearningModel< TInputValue, TOutputValue >::SetLayerSizes | ( | const std::vector< unsigned int > | layers | ) |
Set the number of neurons in each layer (including input and output layers). The number of neuron in the first layer (input layer) must be equal to the number of samples in the InputListSample
Sets the topology of the NN
Definition at line 53 of file otbNeuralNetworkMachineLearningModel.hxx.
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
virtual |
Run-time type information (and related methods).
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 145 of file otbNeuralNetworkMachineLearningModel.hxx.
|
overridevirtual |
Train the machine learning model
Train the machine learning model for classification
Implements otb::MachineLearningModel< TInputValue, TTargetValue >.
Definition at line 166 of file otbNeuralNetworkMachineLearningModel.hxx.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 208 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 211 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 206 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 213 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 214 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 212 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 219 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 209 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 222 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 221 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 218 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 215 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 216 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 217 of file otbNeuralNetworkMachineLearningModel.h.
|
private |
Is the input model file readable and compatible with the corresponding classifier ?
Definition at line 207 of file otbNeuralNetworkMachineLearningModel.h.