Commit dc87bec4 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: use the InputSampleList from mother class

No related merge requests found
Showing with 2 additions and 6 deletions
+2 -6
...@@ -158,7 +158,7 @@ void TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue> ...@@ -158,7 +158,7 @@ void TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
radius[i]=std::stoi(n[i]); radius[i]=std::stoi(n[i]);
} }
dimredTrainer->SetNeighborhoodSizeInit(radius); dimredTrainer->SetNeighborhoodSizeInit(radius);
dimredTrainer->SetListSample(trainingListSample); dimredTrainer->SetInputListSample(trainingListSample);
dimredTrainer->Train(); dimredTrainer->Train();
dimredTrainer->Save(modelPath); dimredTrainer->Save(modelPath);
} }
......
...@@ -100,8 +100,6 @@ public: ...@@ -100,8 +100,6 @@ public:
itkGetMacro(RandomInit, bool); itkGetMacro(RandomInit, bool);
itkSetMacro(Seed, unsigned int); itkSetMacro(Seed, unsigned int);
itkGetMacro(Seed, unsigned int); itkGetMacro(Seed, unsigned int);
itkGetObjectMacro(ListSample, InputListSampleType);
itkSetObjectMacro(ListSample, InputListSampleType);
bool CanReadFile(const std::string & filename); bool CanReadFile(const std::string & filename);
bool CanWriteFile(const std::string & filename); bool CanWriteFile(const std::string & filename);
...@@ -140,8 +138,6 @@ private: ...@@ -140,8 +138,6 @@ private:
bool m_RandomInit; bool m_RandomInit;
/** Seed for random initialization */ /** Seed for random initialization */
unsigned int m_Seed; unsigned int m_Seed;
/** The input list sample */
ListSamplePointerType m_ListSample;
/** Behavior of the Learning weightening (link to the beta coefficient) */ /** Behavior of the Learning weightening (link to the beta coefficient) */
SOMLearningBehaviorFunctorType m_BetaFunctor; SOMLearningBehaviorFunctorType m_BetaFunctor;
/** Behavior of the Neighborhood extent */ /** Behavior of the Neighborhood extent */
......
...@@ -72,7 +72,7 @@ SOMModel<TInputValue, MapDimension>::Train() ...@@ -72,7 +72,7 @@ SOMModel<TInputValue, MapDimension>::Train()
{ {
typedef otb::SOM<InputListSampleType, MapType> EstimatorType; typedef otb::SOM<InputListSampleType, MapType> EstimatorType;
typename EstimatorType::Pointer estimator = EstimatorType::New(); typename EstimatorType::Pointer estimator = EstimatorType::New();
estimator->SetListSample(m_ListSample); estimator->SetListSample(this->GetInputListSample());
estimator->SetMapSize(m_MapSize); estimator->SetMapSize(m_MapSize);
estimator->SetNeighborhoodSizeInit(m_NeighborhoodSizeInit); estimator->SetNeighborhoodSizeInit(m_NeighborhoodSizeInit);
estimator->SetNumberOfIterations(m_NumberOfIterations); estimator->SetNumberOfIterations(m_NumberOfIterations);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment