From 25e4c6a21856f940a4dcc8da5d34caba5bc7ac9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <traizetc@cesbio.cnes.fr> Date: Wed, 3 May 2017 10:44:29 +0200 Subject: [PATCH] dimreduc model added (not used at the moment), trainer app working for autoencoder --- include/AutoencoderModel.h | 44 +++++++++++++++++++++++ include/AutoencoderModel.txx | 20 +++++++++++ include/DimensionalityReductionModel.h | 48 ++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 include/AutoencoderModel.h create mode 100644 include/AutoencoderModel.txx create mode 100644 include/DimensionalityReductionModel.h diff --git a/include/AutoencoderModel.h b/include/AutoencoderModel.h new file mode 100644 index 0000000000..f545a72284 --- /dev/null +++ b/include/AutoencoderModel.h @@ -0,0 +1,44 @@ +#ifndef AutoencoderModel_h +#define AutoencoderModel_h + +#include "DimensionalityReductionModel.h" + + +namespace otb +{ +template <class TInputValue, class AutoencoderType> +class AutoencoderModel: public DimensionalityReductionModel<TInputValue> +{ + +public: + + typedef AutoencoderModel Self; + typedef DimensionalityReductionModel<TInputValue> Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + typedef TInputValue InputValueType; + typedef itk::VariableLengthVector<InputValueType> InputSampleType; + typedef itk::Statistics::ListSample<InputSampleType> InputListSampleType; + + + + void Save(const std::string & filename, const std::string & name="") {}; + void Load(const std::string & filename, const std::string & name="") {}; + + void Train(); + void Dimensionality_reduction() {}; + +protected: + AutoencoderModel(){}; + +}; +} // end namespace otb + + +#ifndef OTB_MANUAL_INSTANTIATION +#include "AutoencoderModel.txx" +#endif + + +#endif diff --git a/include/AutoencoderModel.txx b/include/AutoencoderModel.txx new file mode 100644 index 0000000000..9a51269360 --- /dev/null +++ b/include/AutoencoderModel.txx @@ -0,0 +1,20 @@ +#ifndef AutoencoderModel_txx +#define AutoencoderModel_txx + + +#include "AutoencoderModel.h" +namespace otb +{ + +template <class TInputValue, class AutoencoderType> +void AutoencoderModel<TInputValue,AutoencoderType>::Train() +{ + +} + + + + + +} // namespace otb +#endif diff --git a/include/DimensionalityReductionModel.h b/include/DimensionalityReductionModel.h new file mode 100644 index 0000000000..05066e976b --- /dev/null +++ b/include/DimensionalityReductionModel.h @@ -0,0 +1,48 @@ +#ifndef DimensionalityReductionModel_h +#define DimensionalityReductionModel_h +#include "itkObject.h" +#include "itkListSample.h" +namespace otb +{ +template <class TInputValue> +class DimensionalityReductionModel: public itk::Object +{ + +public: + + typedef DimensionalityReductionModel Self; + typedef itk::Object Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + typedef TInputValue InputValueType; + typedef itk::VariableLengthVector<InputValueType> InputSampleType; + typedef itk::Statistics::ListSample<InputSampleType> InputListSampleType; + + + + itkSetObjectMacro(InputListSample,InputListSampleType); + itkGetObjectMacro(InputListSample,InputListSampleType); + itkGetConstObjectMacro(InputListSample,InputListSampleType); + + virtual void Save(const std::string & filename, const std::string & name="") = 0; + virtual void Load(const std::string & filename, const std::string & name="") = 0; + + virtual void Train() = 0; + virtual void Dimensionality_reduction() = 0; + +protected: + DimensionalityReductionModel(){}; + typename InputListSampleType::Pointer m_InputListSample; + + +}; +} // end namespace otb + + +//#ifndef OTB_MANUAL_INSTANTIATION +//#include "DimensionalityReductionModel.txx" +//#endif + + +#endif -- GitLab