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
Franck Dary
macaon
Commits
b9cd4b4e
Commit
b9cd4b4e
authored
Aug 06, 2020
by
Franck Dary
Browse files
Fixed min float value
parent
e253ffad
Changes
3
Hide whitespace changes
Inline
Side-by-side
reading_machine/src/Action.cpp
View file @
b9cd4b4e
...
...
@@ -1061,7 +1061,7 @@ Action Action::writeScore(const std::string & colName, Config::Object object, in
int
lineIndex
=
config
.
getRelativeWordIndex
(
object
,
relativeIndex
);
float
score
=
config
.
getChosenActionScore
();
if
(
score
!=
std
::
numeric_limits
<
float
>::
m
in
())
if
(
-
score
!=
std
::
numeric_limits
<
float
>::
m
ax
())
return
addHypothesis
(
colName
,
lineIndex
,
fmt
::
format
(
"{}"
,
score
)).
apply
(
config
,
a
);
else
return
addHypothesis
(
colName
,
lineIndex
,
config
.
getConst
(
colName
,
lineIndex
,
0
)).
apply
(
config
,
a
);
...
...
trainer/src/MacaonTrain.cpp
View file @
b9cd4b4e
...
...
@@ -167,7 +167,8 @@ int MacaonTrain::main()
Trainer
trainer
(
machine
,
batchSize
);
Decoder
decoder
(
machine
);
float
bestDevScore
=
computeDevScore
?
std
::
numeric_limits
<
float
>::
min
()
:
std
::
numeric_limits
<
float
>::
max
();
float
bestDevScore
=
computeDevScore
?
-
std
::
numeric_limits
<
float
>::
max
()
:
std
::
numeric_limits
<
float
>::
max
();
fmt
::
print
(
"best = {}
\n
"
,
bestDevScore
);
auto
trainInfos
=
machinePath
.
parent_path
()
/
"train.info"
;
...
...
trainer/src/Trainer.cpp
View file @
b9cd4b4e
...
...
@@ -82,7 +82,7 @@ void Trainer::extractExamples(SubConfig & config, bool debug, std::filesystem::p
int
nbClasses
=
machine
.
getTransitionSet
(
config
.
getState
()).
size
();
float
bestScore
=
std
::
numeric_limits
<
float
>::
m
in
();
float
bestScore
=
-
std
::
numeric_limits
<
float
>::
m
ax
();
if
(
dynamicOracle
and
util
::
choiceWithProbability
(
1.0
)
and
config
.
getState
()
!=
"tokenizer"
and
config
.
getState
()
!=
"segmenter"
)
{
...
...
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