Commit ba09b3e7 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH: remove TrainNormalizer

No related merge requests found
Showing with 1 addition and 17 deletions
+1 -17
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "otbLearningApplicationBase.h" #include "otbLearningApplicationBase.h"
#include "otbSharkKMeansMachineLearningModel.h" #include "otbSharkKMeansMachineLearningModel.h"
#include "otbStatisticsXMLFileReader.h" #include "otbStatisticsXMLFileReader.h"
#include "shark/Models/Normalizer.h"
namespace otb namespace otb
{ {
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include "shark/Models/Clustering/Centroids.h" #include "shark/Models/Clustering/Centroids.h"
#include "shark/Models/Clustering/ClusteringModel.h" #include "shark/Models/Clustering/ClusteringModel.h"
#include "shark/Algorithms/KMeans.h" #include "shark/Algorithms/KMeans.h"
#include "shark/Algorithms/Trainers/NormalizeComponentsUnitVariance.h"
#if defined(__GNUC__) || defined(__clang__) #if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
...@@ -146,9 +145,6 @@ protected: ...@@ -146,9 +145,6 @@ protected:
virtual void DoPredictBatch(const InputListSampleType *, const unsigned int &startIndex, const unsigned int &size, virtual void DoPredictBatch(const InputListSampleType *, const unsigned int &startIndex, const unsigned int &size,
TargetListSampleType *, ConfidenceListSampleType * = nullptr, ProbaListSampleType * = nullptr) const override; TargetListSampleType *, ConfidenceListSampleType * = nullptr, ProbaListSampleType * = nullptr) const override;
template<typename DataType>
shark::Normalizer<> TrainNormalizer(const DataType &data) const;
/** PrintSelf method */ /** PrintSelf method */
void PrintSelf(std::ostream &os, itk::Indent indent) const override; void PrintSelf(std::ostream &os, itk::Indent indent) const override;
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "otb_shark.h" #include "otb_shark.h"
#include "otbSharkUtils.h" #include "otbSharkUtils.h"
#include "shark/Algorithms/Trainers/NormalizeComponentsUnitVariance.h" //normalize
#include "shark/Algorithms/KMeans.h" //k-means algorithm #include "shark/Algorithms/KMeans.h" //k-means algorithm
#include "shark/Models/Clustering/HardClusteringModel.h" #include "shark/Models/Clustering/HardClusteringModel.h"
#include "shark/Models/Clustering/SoftClusteringModel.h" #include "shark/Models/Clustering/SoftClusteringModel.h"
...@@ -82,18 +81,6 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue> ...@@ -82,18 +81,6 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue>
m_ClusteringModel = boost::make_shared<ClusteringModelType>( &m_Centroids ); m_ClusteringModel = boost::make_shared<ClusteringModelType>( &m_Centroids );
} }
template<class TInputValue, class TOutputValue>
template<typename DataType>
shark::Normalizer<>
SharkKMeansMachineLearningModel<TInputValue, TOutputValue>
::TrainNormalizer(const DataType &data) const
{
shark::Normalizer<> normalizer;
shark::NormalizeComponentsUnitVariance<> normalizingTrainer( true );//zero mean
normalizingTrainer.train( normalizer, data );
return normalizer;
}
template<class TInputValue, class TOutputValue> template<class TInputValue, class TOutputValue>
typename SharkKMeansMachineLearningModel<TInputValue, TOutputValue> typename SharkKMeansMachineLearningModel<TInputValue, TOutputValue>
::TargetSampleType ::TargetSampleType
......
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