Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.tensorflow
Merge requests
!55
save best models based on the loss
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
save best models based on the loss
eval
into
master
Overview
2
Commits
1
Pipelines
1
Changes
1
Merged
Amir MOHAMMADI
requested to merge
eval
into
master
6 years ago
Overview
2
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
fe0c9672
1 commit,
6 years ago
1 file
+
2
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bob/learn/tensorflow/script/eval.py
+
2
−
2
Options
@@ -29,9 +29,9 @@ def save_n_best_models(train_dir, save_dir, evaluated_file,
def
_key
(
x
):
x
=
x
[
1
]
ac
=
x
.
get
(
'
accuracy
'
)
ac
=
x
.
get
(
'
accuracy
'
)
or
0
lo
=
x
.
get
(
'
loss
'
)
or
0
return
ac
*
-
1
if
ac
is
not
None
else
lo
return
(
lo
,
ac
*
-
1
)
best_models
=
OrderedDict
(
sorted
(
evaluated
.
items
(),
key
=
_key
)[:
keep_n_best_models
])
Loading