OTB  9.0.0
Orfeo Toolbox
otbTrainDimensionalityReductionApplicationBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 #ifndef otbTrainDimensionalityReductionApplicationBase_h
21 #define otbTrainDimensionalityReductionApplicationBase_h
22 
23 #include "otbConfigure.h"
24 #include "otbWrapperApplication.h"
26 
27 // ListSample
28 #include "itkListSample.h"
29 #include "itkVariableLengthVector.h"
30 
31 
32 namespace otb
33 {
34 namespace Wrapper
35 {
36 
69 template <class TInputValue, class TOutputValue>
71 {
72 public:
76  typedef itk::SmartPointer<Self> Pointer;
77  typedef itk::SmartPointer<const Self> ConstPointer;
78 
80  itkTypeMacro(TrainDimensionalityReductionApplicationBase, otb::Application);
81 
82  typedef TInputValue InputValueType;
83  typedef TOutputValue OutputValueType;
84 
87 
91 
94 
95 protected:
98 
101  void Train(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
102 
104  void Reduce(typename ListSampleType::Pointer validationListSample, std::string modelPath);
105 
107  void DoInit() override;
108 
109 private:
112  void InitSOMParams();
113  template <class somchoice>
114  void TrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
115  void BeforeTrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
116 
117 #ifdef OTB_USE_SHARK
118  void InitAutoencoderParams();
119  void InitPCAParams();
120 
121  void BeforeTrainAutoencoder(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
122  template <class autoencoderchoice>
123  void TrainAutoencoder(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
124 
125  void TrainPCA(typename ListSampleType::Pointer trainingListSample, std::string modelPath);
126 #endif
127 };
128 
129 } // end of namespace Wrapper
130 } // end of namespace otb
131 
132 #ifndef OTB_MANUAL_INSTANTIATION
135 #include <string>
136 
137 #ifdef OTB_USE_SHARK
140 #endif
141 #endif
142 
143 #endif
otb::Wrapper::TrainDimensionalityReductionApplicationBase::ListSampleType
ModelType::InputListSampleType ListSampleType
Definition: otbTrainDimensionalityReductionApplicationBase.h:93
otbDimensionalityReductionTrainAutoencoder.hxx
otb::Wrapper::TrainDimensionalityReductionApplicationBase::ModelType
ModelFactoryType::DimensionalityReductionModelType ModelType
Definition: otbTrainDimensionalityReductionApplicationBase.h:90
otb::Wrapper::Application
This class represent an application TODO.
Definition: otbWrapperApplication.h:76
otb::Wrapper::TrainDimensionalityReductionApplicationBase::InitSOMParams
void InitSOMParams()
Definition: otbDimensionalityReductionTrainSOM.hxx:31
otb::Wrapper::TrainDimensionalityReductionApplicationBase::Reduce
void Reduce(typename ListSampleType::Pointer validationListSample, std::string modelPath)
Definition: otbTrainDimensionalityReductionApplicationBase.hxx:61
otb::DimensionalityReductionModelFactory::DimensionalityReductionModelTypePointer
DimensionalityReductionModelType::Pointer DimensionalityReductionModelTypePointer
Definition: otbDimensionalityReductionModelFactory.h:50
otb::Wrapper::TrainDimensionalityReductionApplicationBase::Train
void Train(typename ListSampleType::Pointer trainingListSample, std::string modelPath)
Definition: otbTrainDimensionalityReductionApplicationBase.hxx:67
otbDimensionalityReductionTrainSOM.hxx
otb::Wrapper::TrainDimensionalityReductionApplicationBase::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbTrainDimensionalityReductionApplicationBase.h:77
otbDimensionalityReductionModelFactory.h
otb::MachineLearningModel::InputListSampleType
itk::Statistics::ListSample< InputSampleType > InputListSampleType
Definition: otbMachineLearningModel.h:85
otb::Wrapper::TrainDimensionalityReductionApplicationBase::BeforeTrainSOM
void BeforeTrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath)
Definition: otbDimensionalityReductionTrainSOM.hxx:80
otbWrapperApplication.h
otb::DimensionalityReductionModelFactory
Definition: otbDimensionalityReductionModelFactory.h:34
otbDimensionalityReductionTrainPCA.hxx
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::TrainDimensionalityReductionApplicationBase::TrainDimensionalityReductionApplicationBase
TrainDimensionalityReductionApplicationBase()
Definition: otbTrainDimensionalityReductionApplicationBase.hxx:31
otb::Wrapper::TrainDimensionalityReductionApplicationBase
Definition: otbTrainDimensionalityReductionApplicationBase.h:70
otb::Wrapper::TrainDimensionalityReductionApplicationBase::Self
TrainDimensionalityReductionApplicationBase Self
Definition: otbTrainDimensionalityReductionApplicationBase.h:74
otb::Wrapper::TrainDimensionalityReductionApplicationBase::ModelPointerType
ModelFactoryType::DimensionalityReductionModelTypePointer ModelPointerType
Definition: otbTrainDimensionalityReductionApplicationBase.h:89
otbTrainDimensionalityReductionApplicationBase.hxx
otb::Wrapper::TrainDimensionalityReductionApplicationBase::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbTrainDimensionalityReductionApplicationBase.h:76
otb::Wrapper::TrainDimensionalityReductionApplicationBase::SampleType
ModelType::InputSampleType SampleType
Definition: otbTrainDimensionalityReductionApplicationBase.h:92
otb::Wrapper::TrainDimensionalityReductionApplicationBase::Superclass
Application Superclass
Definition: otbTrainDimensionalityReductionApplicationBase.h:75
otb::Wrapper::TrainDimensionalityReductionApplicationBase::PixelType
SampleImageType::PixelType PixelType
Definition: otbTrainDimensionalityReductionApplicationBase.h:86
otb::Wrapper::TrainDimensionalityReductionApplicationBase::ModelFactoryType
otb::DimensionalityReductionModelFactory< InputValueType, OutputValueType > ModelFactoryType
Definition: otbTrainDimensionalityReductionApplicationBase.h:88
otb::Wrapper::TrainDimensionalityReductionApplicationBase::DoInit
void DoInit() override
Definition: otbTrainDimensionalityReductionApplicationBase.hxx:42
otb::MachineLearningModel
MachineLearningModel is the base class for all classifier objects (SVM, KNN, Random Forests,...
Definition: otbMachineLearningModel.h:70
otb::VectorImage::PixelType
Superclass::PixelType PixelType
Definition: otbVectorImage.h:63
otb::Wrapper::TrainDimensionalityReductionApplicationBase::SampleImageType
otb::VectorImage< InputValueType > SampleImageType
Definition: otbTrainDimensionalityReductionApplicationBase.h:85
otb::Wrapper::TrainDimensionalityReductionApplicationBase::InputValueType
TInputValue InputValueType
Definition: otbTrainDimensionalityReductionApplicationBase.h:80
otb::Wrapper::TrainDimensionalityReductionApplicationBase::TrainSOM
void TrainSOM(typename ListSampleType::Pointer trainingListSample, std::string modelPath)
Definition: otbDimensionalityReductionTrainSOM.hxx:117
otb::MachineLearningModel::InputSampleType
MLMSampleTraits< TInputValue >::SampleType InputSampleType
Definition: otbMachineLearningModel.h:84
otb::Wrapper::TrainDimensionalityReductionApplicationBase::~TrainDimensionalityReductionApplicationBase
~TrainDimensionalityReductionApplicationBase() override
Definition: otbTrainDimensionalityReductionApplicationBase.hxx:36
otb::Wrapper::TrainDimensionalityReductionApplicationBase::OutputValueType
TOutputValue OutputValueType
Definition: otbTrainDimensionalityReductionApplicationBase.h:83
otb::VectorImage
Creation of an "otb" vector image which contains metadata.
Definition: otbVectorImage.h:45