Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon
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
Franck Dary
macaon
Commits
b9cd4b4e
Commit
b9cd4b4e
authored
4 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Fixed min float value
parent
e253ffad
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
reading_machine/src/Action.cpp
+1
-1
1 addition, 1 deletion
reading_machine/src/Action.cpp
trainer/src/MacaonTrain.cpp
+2
-1
2 additions, 1 deletion
trainer/src/MacaonTrain.cpp
trainer/src/Trainer.cpp
+1
-1
1 addition, 1 deletion
trainer/src/Trainer.cpp
with
4 additions
and
3 deletions
reading_machine/src/Action.cpp
+
1
−
1
View file @
b9cd4b4e
...
@@ -1061,7 +1061,7 @@ Action Action::writeScore(const std::string & colName, Config::Object object, in
...
@@ -1061,7 +1061,7 @@ Action Action::writeScore(const std::string & colName, Config::Object object, in
int
lineIndex
=
config
.
getRelativeWordIndex
(
object
,
relativeIndex
);
int
lineIndex
=
config
.
getRelativeWordIndex
(
object
,
relativeIndex
);
float
score
=
config
.
getChosenActionScore
();
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
);
return
addHypothesis
(
colName
,
lineIndex
,
fmt
::
format
(
"{}"
,
score
)).
apply
(
config
,
a
);
else
else
return
addHypothesis
(
colName
,
lineIndex
,
config
.
getConst
(
colName
,
lineIndex
,
0
)).
apply
(
config
,
a
);
return
addHypothesis
(
colName
,
lineIndex
,
config
.
getConst
(
colName
,
lineIndex
,
0
)).
apply
(
config
,
a
);
...
...
This diff is collapsed.
Click to expand it.
trainer/src/MacaonTrain.cpp
+
2
−
1
View file @
b9cd4b4e
...
@@ -167,7 +167,8 @@ int MacaonTrain::main()
...
@@ -167,7 +167,8 @@ int MacaonTrain::main()
Trainer
trainer
(
machine
,
batchSize
);
Trainer
trainer
(
machine
,
batchSize
);
Decoder
decoder
(
machine
);
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"
;
auto
trainInfos
=
machinePath
.
parent_path
()
/
"train.info"
;
...
...
This diff is collapsed.
Click to expand it.
trainer/src/Trainer.cpp
+
1
−
1
View file @
b9cd4b4e
...
@@ -82,7 +82,7 @@ void Trainer::extractExamples(SubConfig & config, bool debug, std::filesystem::p
...
@@ -82,7 +82,7 @@ void Trainer::extractExamples(SubConfig & config, bool debug, std::filesystem::p
int
nbClasses
=
machine
.
getTransitionSet
(
config
.
getState
()).
size
();
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"
)
if
(
dynamicOracle
and
util
::
choiceWithProbability
(
1.0
)
and
config
.
getState
()
!=
"tokenizer"
and
config
.
getState
()
!=
"segmenter"
)
{
{
...
...
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