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
Main Repositories
otb
Commits
4db350d3
Commit
4db350d3
authored
7 years ago
by
Cédric Traizet
Browse files
Options
Downloads
Patches
Plain Diff
Cleaning: some useless headers and old commented code have been removed
parent
bc35458a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Dimensionality reduction algorithms
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/cbDimensionalityReduction.cxx
+0
-1
0 additions, 1 deletion
app/cbDimensionalityReduction.cxx
app/cbDimensionalityReductionTrainer.cxx
+0
-47
0 additions, 47 deletions
app/cbDimensionalityReductionTrainer.cxx
with
0 additions
and
48 deletions
app/cbDimensionalityReduction.cxx
+
0
−
1
View file @
4db350d3
/*=========================================================================
Program: ORFEO Toolbox
...
...
This diff is collapsed.
Click to expand it.
app/cbDimensionalityReductionTrainer.cxx
+
0
−
47
View file @
4db350d3
...
...
@@ -9,38 +9,13 @@
#include
"otbShiftScaleSampleListFilter.h"
#include
"otbStatisticsXMLFileReader.h"
//#include "AutoencoderModel.h"
#include
"otbSharkUtils.h"
#include
"otbMachineLearningModel.h"
//include train function
#include
<shark/ObjectiveFunctions/ErrorFunction.h>
#include
<shark/Algorithms/GradientDescent/Rprop.h>
// the RProp optimization algorithm
#include
<shark/ObjectiveFunctions/Loss/SquaredLoss.h>
// squared loss used for regression
#include
<shark/ObjectiveFunctions/Regularizer.h>
//L2 regulariziation
#include
<fstream>
// write the model file
#include
<shark/Models/Autoencoder.h>
//normal autoencoder model
#include
<shark/Models/TiedAutoencoder.h>
//autoencoder with tied weights
#include
<shark/Models/Normalizer.h>
#include
<shark/Algorithms/Trainers/NormalizeComponentsUnitVariance.h>
#include
"otbMachineLearningModelFactory.h"
#include
"cbLearningApplicationBaseDR.h"
shark
::
Normalizer
<
shark
::
RealVector
>
trainNormalizer
(
const
shark
::
UnlabeledData
<
shark
::
RealVector
>&
data
)
{
bool
removeMean
=
true
;
shark
::
Normalizer
<
shark
::
RealVector
>
normalizer
;
shark
::
NormalizeComponentsUnitVariance
<
shark
::
RealVector
>
normalizingTrainer
(
removeMean
);
normalizingTrainer
.
train
(
normalizer
,
data
);
return
normalizer
;
}
namespace
otb
{
...
...
@@ -68,15 +43,7 @@ public:
typedef
otb
::
StatisticsXMLFileReader
<
SampleType
>
StatisticsReader
;
typedef
otb
::
Statistics
::
ShiftScaleSampleListFilter
<
ListSampleType
,
ListSampleType
>
ShiftScaleFilterType
;
//typedef float ValueType;
//typedef itk::VariableLengthVector<ValueType> InputSampleType;
//typedef itk::Statistics::ListSample<InputSampleType> ListSampleType;
//typedef itk::VariableLengthVector<ValueType> MeasurementType;
typedef
otb
::
MachineLearningModelFactory
<
ValueType
,
ValueType
>
ModelFactoryType
;
private:
...
...
@@ -103,19 +70,6 @@ private:
Superclass
::
DoInit
();
/*
AddParameter(ParameterType_InputFilename, "model", "Dimensionality Reduction model file");
SetParameterDescription("model", "A model file (produced by cbDimensionalityReduction application.");
AddParameter(ParameterType_InputFilename, "normalizer", "normalizer model file");
SetParameterDescription("normalizer", "A model file (produced by cbDimensionalityReduction application.");
*/
/*
AddParameter(ParameterType_InputVectorData, "val", "Name of the input validation vector data");
SetParameterDescription("val","The vector data used for validation.");
*/
AddRAMParameter
();
}
...
...
@@ -149,7 +103,6 @@ private:
input
->
PushBack
(
mv
);
}
// Statistics for shift/scale
MeasurementType
meanMeasurementVector
;
MeasurementType
stddevMeasurementVector
;
if
(
HasValue
(
"io.stats"
)
&&
IsParameterEnabled
(
"io.stats"
))
...
...
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