diff --git a/include/AutoencoderModel.txx b/include/AutoencoderModel.txx index ee400c04a7a08bc980a237abfa4f345d6dde55d5..4afa2692f3c573048591cda536def7f1a982e07a 100644 --- a/include/AutoencoderModel.txx +++ b/include/AutoencoderModel.txx @@ -395,9 +395,11 @@ void AutoencoderModel<TInputValue,NeuronType> data = net.encode(data); } */ - data = m_net.evalLayer( m_net.layerMatrices().size()/2 ,data); // features layer for a network containing the encoder and decoder part + data = m_net.evalLayer( m_net.layerMatrices().size()/2-1 ,data); // features layer for a network containing the encoder and decoder part + std::cout << data.element(0) << std::endl; unsigned int id = startIndex; target.SetSize(this->m_Dimension); + for(const auto& p : data.elements()) { for(unsigned int a = 0; a < this->m_Dimension; ++a){ diff --git a/include/DimensionalityReductionModelFactory.txx b/include/DimensionalityReductionModelFactory.txx index fb65be910ec931cc5b86a6be1c659babe1b33ac5..42eb47e76c8be9d44e53e3032e4af7e55ddae531 100644 --- a/include/DimensionalityReductionModelFactory.txx +++ b/include/DimensionalityReductionModelFactory.txx @@ -46,7 +46,7 @@ using TiedAutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTa */ template <class TInputValue, class TTargetValue> -using AutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::TanhNeuron> ; +using AutoencoderModelFactory = AutoencoderModelFactoryBase<TInputValue, TTargetValue, shark::LinearNeuron> ; template <class TInputValue, class TTargetValue> diff --git a/include/cbLearningApplicationBaseDR.h b/include/cbLearningApplicationBaseDR.h index 084db66a4caab98a4dfffc51745c099c4dd16c90..5814c3f3b555fd019a1d7c9da486b0fe8747ec79 100644 --- a/include/cbLearningApplicationBaseDR.h +++ b/include/cbLearningApplicationBaseDR.h @@ -103,7 +103,7 @@ public: #ifdef OTB_USE_SHARK // typedef shark::Autoencoder< shark::TanhNeuron, shark::LinearNeuron> AutoencoderType; - typedef shark::TanhNeuron NeuronType; + typedef shark::LinearNeuron NeuronType; typedef otb::AutoencoderModel<InputValueType, NeuronType> AutoencoderModelType; /* // typedef shark::TiedAutoencoder< shark::TanhNeuron, shark::LinearNeuron> TiedAutoencoderType;