Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
d65df2c7
Commit
d65df2c7
authored
Apr 22, 2021
by
Cédric Traizet
Committed by
Cédric Traizet
Nov 08, 2021
Browse files
BUG: use template output type when fetching label values in NeuralNetworkMachineLearningModel
parent
d5ce2967
Pipeline
#9075
failed with stages
in 61 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Modules/Learning/Supervised/include/otbNeuralNetworkMachineLearningModel.hxx
View file @
d65df2c7
...
...
@@ -99,7 +99,7 @@ void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::LabelsToMat(c
{
classLabel
=
kv
.
first
;
kv
.
second
=
itLabel
;
m_MatrixOfLabels
.
at
<
float
>
(
0
,
itLabel
)
=
classLabel
;
m_MatrixOfLabels
.
at
<
TOutputValue
>
(
0
,
itLabel
)
=
classLabel
;
++
itLabel
;
}
...
...
@@ -206,7 +206,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In
// MODE CLASSIFICATION : find the highest response
float
secondResponse
=
-
1e10
;
target
[
0
]
=
m_MatrixOfLabels
.
at
<
float
>
(
0
);
target
[
0
]
=
m_MatrixOfLabels
.
at
<
TOutputValue
>
(
0
);
unsigned
int
nbClasses
=
m_MatrixOfLabels
.
size
[
1
];
for
(
unsigned
itLabel
=
1
;
itLabel
<
nbClasses
;
++
itLabel
)
...
...
@@ -217,7 +217,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In
secondResponse
=
maxResponse
;
maxResponse
=
currentResponse
;
target
[
0
]
=
m_MatrixOfLabels
.
at
<
float
>
(
itLabel
);
target
[
0
]
=
m_MatrixOfLabels
.
at
<
TOutputValue
>
(
itLabel
);
}
else
{
...
...
Write
Preview
Supports
Markdown
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