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

ENH: no support for tied autoencoder yet

No related merge requests found
Showing with 3 additions and 25 deletions
+3 -25
...@@ -73,7 +73,7 @@ private: ...@@ -73,7 +73,7 @@ private:
SetName("TrainDimensionalityReduction"); SetName("TrainDimensionalityReduction");
SetDescription("Trainer for the dimensionality reduction algorithms used in" SetDescription("Trainer for the dimensionality reduction algorithms used in"
" the ImageDimensionalityReduction and VectorDimensionalityReduction applications."); " the ImageDimensionalityReduction and VectorDimensionalityReduction applications.");
AddParameter(ParameterType_Group, "io", "Input and output data"); AddParameter(ParameterType_Group, "io", "Input and output data");
SetParameterDescription("io", "This group of parameters allows setting input and output data."); SetParameterDescription("io", "This group of parameters allows setting input and output data.");
...@@ -83,8 +83,7 @@ private: ...@@ -83,8 +83,7 @@ private:
AddParameter(ParameterType_OutputFilename, "io.out", "Output model"); AddParameter(ParameterType_OutputFilename, "io.out", "Output model");
SetParameterDescription("io.out", "Output file containing the estimated model (.txt format)."); SetParameterDescription("io.out", "Output file containing the estimated model (.txt format).");
AddParameter(ParameterType_InputFilename, "io.stats", "Input XML image statistics file"); AddParameter(ParameterType_InputFilename, "io.stats", "Input XML image statistics file");
MandatoryOff("io.stats"); MandatoryOff("io.stats");
SetParameterDescription("io.stats", "XML file containing mean and variance of each feature."); SetParameterDescription("io.stats", "XML file containing mean and variance of each feature.");
......
...@@ -33,22 +33,11 @@ void ...@@ -33,22 +33,11 @@ void
TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue> TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
::InitAutoencoderParams() ::InitAutoencoderParams()
{ {
AddChoice("algorithm.tiedautoencoder", "Shark Tied Autoencoder");
AddChoice("algorithm.autoencoder", "Shark Autoencoder"); AddChoice("algorithm.autoencoder", "Shark Autoencoder");
SetParameterDescription("algorithm.autoencoder", SetParameterDescription("algorithm.autoencoder",
"This group of parameters allows setting Shark autoencoder parameters. " "This group of parameters allows setting Shark autoencoder parameters. "
); );
//Tied Autoencoder
AddParameter(ParameterType_Choice, "algorithm.autoencoder.istied",
"tied weighth <tied/untied>");
SetParameterDescription(
"algorithm.autoencoder.istied",
"Parameter that determine if the weights are tied or not <tied/untied>");
AddChoice("algorithm.autoencoder.istied.yes","Tied weigths");
AddChoice("algorithm.autoencoder.istied.no","Untied weights");
//Number Of Iterations //Number Of Iterations
AddParameter(ParameterType_Int, "algorithm.autoencoder.nbiter", AddParameter(ParameterType_Int, "algorithm.autoencoder.nbiter",
"Maximum number of iterations during training"); "Maximum number of iterations during training");
...@@ -116,17 +105,7 @@ TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue> ...@@ -116,17 +105,7 @@ TrainDimensionalityReductionApplicationBase<TInputValue,TOutputValue>
{ {
typedef shark::LogisticNeuron NeuronType; typedef shark::LogisticNeuron NeuronType;
typedef otb::AutoencoderModel<InputValueType, NeuronType> AutoencoderModelType; typedef otb::AutoencoderModel<InputValueType, NeuronType> AutoencoderModelType;
std::string TiedWeigth = GetParameterString("algorithm.autoencoder.istied"); TrainAutoencoder<AutoencoderModelType>(trainingListSample,modelPath);
std::cout << TiedWeigth << std::endl;
if(TiedWeigth == "no")
{
TrainAutoencoder<AutoencoderModelType>(trainingListSample,modelPath);
}
if(TiedWeigth != "yes" && TiedWeigth != "no")
{
std::cerr << "istied : invalid choice <yes/no>" << std::endl;
}
} }
template <class TInputValue, class TOutputValue> template <class TInputValue, class TOutputValue>
......
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