Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otbtf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lozac'h Loic
otbtf
Commits
e2968219
Commit
e2968219
authored
Sep 20, 2018
by
remi cresson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX: validation step not performed if not user parameters are set
parent
831c400b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
app/otbTensorflowModelTrain.cxx
app/otbTensorflowModelTrain.cxx
+20
-20
No files found.
app/otbTensorflowModelTrain.cxx
View file @
e2968219
...
...
@@ -468,32 +468,32 @@ public:
AddProcess
(
m_TrainModelFilter
,
"Training epoch #"
+
std
::
to_string
(
epoch
));
m_TrainModelFilter
->
Update
();
// Validate the model
if
(
epoch
%
GetParameterInt
(
"validation.step"
)
==
0
)
if
(
do_validation
)
{
// 1. Evaluate the metrics against the learning data
for
(
unsigned
int
i
=
0
;
i
<
m_InputSourcesForEvaluationAgainstLearningData
.
size
()
;
i
++
)
// Validate the model
if
(
epoch
%
GetParameterInt
(
"validation.step"
)
==
0
)
{
m_ValidateModelFilter
->
SetInput
(
i
,
m_InputSourcesForEvaluationAgainstLearningData
[
i
]);
}
m_ValidateModelFilter
->
SetInputReferences
(
m_InputTargetsForEvaluationAgainstLearningData
);
// 1. Evaluate the metrics against the learning data
// As we use the learning data here, it's rational to use the same option as streaming during training
m_ValidateModelFilter
->
SetUseStreaming
(
GetParameterInt
(
"training.usestreaming"
));
for
(
unsigned
int
i
=
0
;
i
<
m_InputSourcesForEvaluationAgainstLearningData
.
size
()
;
i
++
)
{
m_ValidateModelFilter
->
SetInput
(
i
,
m_InputSourcesForEvaluationAgainstLearningData
[
i
]);
}
m_ValidateModelFilter
->
SetInputReferences
(
m_InputTargetsForEvaluationAgainstLearningData
);
// Update
AddProcess
(
m_ValidateModelFilter
,
"Evaluate model (Learning data)"
);
m_ValidateModelFilter
->
Update
();
// As we use the learning data here, it's rational to use the same option as streaming during training
m_ValidateModelFilter
->
SetUseStreaming
(
GetParameterInt
(
"training.usestreaming"
));
for
(
unsigned
int
i
=
0
;
i
<
m_TargetTensorsNames
.
size
()
;
i
++
)
{
otbAppLogINFO
(
"Metrics for target
\"
"
<<
m_TargetTensorsNames
[
i
]
<<
"
\"
:"
);
PrintClassificationMetrics
(
m_ValidateModelFilter
->
GetConfusionMatrix
(
i
),
m_ValidateModelFilter
->
GetMapOfClasses
(
i
));
}
// Update
AddProcess
(
m_ValidateModelFilter
,
"Evaluate model (Learning data)"
);
m_ValidateModelFilter
->
Update
();
for
(
unsigned
int
i
=
0
;
i
<
m_TargetTensorsNames
.
size
()
;
i
++
)
{
otbAppLogINFO
(
"Metrics for target
\"
"
<<
m_TargetTensorsNames
[
i
]
<<
"
\"
:"
);
PrintClassificationMetrics
(
m_ValidateModelFilter
->
GetConfusionMatrix
(
i
),
m_ValidateModelFilter
->
GetMapOfClasses
(
i
));
}
if
(
do_validation
)
{
// 2. Evaluate the metrics against the validation data
// Here we just change the input sources and references
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment