Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Peillet
otb
Commits
4c1a32f7
Commit
4c1a32f7
authored
7 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
BUG: wrong dimension detected when reading AE model
parent
4164dbe0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.txx
+7
-4
7 additions, 4 deletions
...ionalityReductionLearning/include/otbAutoencoderModel.txx
with
7 additions
and
4 deletions
Modules/Learning/DimensionalityReductionLearning/include/otbAutoencoderModel.txx
+
7
−
4
View file @
4c1a32f7
...
...
@@ -179,6 +179,7 @@ AutoencoderModel<TInputValue,NeuronType>
shark::MaxIterations<> criterion(m_NumberOfIterationsFineTuning);
TrainNetwork(criterion, inputSamples_copy, ofs);
}
this->SetDimension(m_NumberOfHiddenNeurons[m_NumberOfHiddenNeurons.Size()-1]);
}
template <class TInputValue, class NeuronType>
...
...
@@ -387,8 +388,8 @@ AutoencoderModel<TInputValue,NeuronType>
// This gives us the dimension if we keep the encoder and decoder
size_t feature_layer_index = m_Net.layerMatrices().size()/2;
// number of neurons in the feature layer (
first
dimension of the first decoder weight matrix)
this->
m_
Dimension
=
m_Net.layerMatrix(feature_layer_index).size
1
();
// number of neurons in the feature layer (
second
dimension of the first decoder weight matrix)
this->
Set
Dimension
(
m_Net.layerMatrix(feature_layer_index).size
2
()
)
;
}
template <class TInputValue, class NeuronType>
...
...
@@ -407,7 +408,8 @@ AutoencoderModel<TInputValue,NeuronType>
shark::Data<shark::RealVector> data = shark::createDataFromRange(features);
data = m_Net.evalLayer( m_Net.layerMatrices().size()/2-1 ,data); // features layer for a network containing the encoder and decoder part
// features layer for a network containing the encoder and decoder part
data = m_Net.evalLayer( m_Net.layerMatrices().size()/2-1 ,data);
TargetSampleType target;
target.SetSize(this->m_Dimension);
...
...
@@ -432,7 +434,8 @@ AutoencoderModel<TInputValue,NeuronType>
Shark::ListSampleRangeToSharkVector(input, features,startIndex,size);
shark::Data<shark::RealVector> data = shark::createDataFromRange(features);
TargetSampleType target;
data = m_Net.evalLayer( m_Net.layerMatrices().size()/2-1 ,data); // features layer for a network containing the encoder and decoder part
// features layer for a network containing the encoder and decoder part
data = m_Net.evalLayer( m_Net.layerMatrices().size()/2-1 ,data);
unsigned int id = startIndex;
target.SetSize(this->m_Dimension);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment