Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JoeyNMT Server
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Simon Will
JoeyNMT Server
Commits
09bd9def
Commit
09bd9def
authored
3 years ago
by
Simon Will
Browse files
Options
Downloads
Patches
Plain Diff
Add steps column to evaluation_results table (no migration yet)
parent
f9a60cac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
joeynmt_server/joey_model.py
+6
-0
6 additions, 0 deletions
joeynmt_server/joey_model.py
joeynmt_server/models/evaluation_results.py
+1
-0
1 addition, 0 deletions
joeynmt_server/models/evaluation_results.py
joeynmt_server/trainer.py
+6
-5
6 additions, 5 deletions
joeynmt_server/trainer.py
with
13 additions
and
5 deletions
joeynmt_server/joey_model.py
+
6
−
0
View file @
09bd9def
...
...
@@ -125,6 +125,12 @@ class JoeyModel:
self
.
_train_dataset
=
self
.
_load_train_dataset
()
return
self
.
_train_dataset
@property
def
steps
(
self
):
if
self
.
train_manager
:
return
self
.
train_manager
.
stats
.
steps
return
None
def
is_still_latest
(
self
):
train_config
=
self
.
config
[
'
training
'
]
latest_ckpt
=
get_latest_checkpoint
(
train_config
[
'
model_dir
'
])
...
...
This diff is collapsed.
Click to expand it.
joeynmt_server/models/evaluation_results.py
+
1
−
0
View file @
09bd9def
...
...
@@ -8,6 +8,7 @@ class EvaluationResult(BaseModel):
label
=
db
.
Column
(
db
.
Unicode
(
50
),
nullable
=
False
)
model
=
db
.
Column
(
db
.
Unicode
(
500
),
nullable
=
False
)
steps
=
db
.
Column
(
db
.
Integer
,
nullable
=
True
)
correct
=
db
.
Column
(
db
.
Integer
,
nullable
=
False
)
total
=
db
.
Column
(
db
.
Integer
,
nullable
=
False
)
...
...
This diff is collapsed.
Click to expand it.
joeynmt_server/trainer.py
+
6
−
5
View file @
09bd9def
...
...
@@ -168,7 +168,7 @@ def train_n_rounds(config_basename, min_rounds=10):
model
=
train
(
config_basename
,
smallest_usage_count
,
train1
,
train2
)
if
dev
:
if
dev
and
current_app
.
config
.
get
(
'
RUNNING_VALIDATION
'
,
True
)
:
dev_set
=
make_dataset_from_feedback
(
dev
,
model
)
logging
.
info
(
'
Validating on {} feedback pieces.
'
.
format
(
len
(
dev_set
)))
...
...
@@ -179,8 +179,8 @@ def train_n_rounds(config_basename, min_rounds=10):
logging
.
info
(
'
Got validation result: {}/{} = {}.
'
.
format
(
correct
,
total
,
accuracy
))
evr
=
EvaluationResult
(
label
=
'
running_dev
'
,
model
=
config_basename
,
correct
=
correct
,
total
=
total
label
=
'
running_dev
'
,
steps
=
model
.
steps
,
model
=
config_basename
,
correct
=
correct
,
total
=
total
)
db
.
session
.
add
(
evr
)
db
.
session
.
commit
()
...
...
@@ -247,8 +247,9 @@ def validate(config_basename, dataset_name='dev'):
correct
=
round
(
accuracy
*
total
)
logging
.
info
(
'
Got validation result: {}/{} = {}.
'
.
format
(
correct
,
total
,
accuracy
))
evr
=
EvaluationResult
(
label
=
dataset_name
,
model
=
config_basename
,
correct
=
correct
,
total
=
total
)
evr
=
EvaluationResult
(
label
=
dataset_name
,
steps
=
model
.
steps
,
model
=
config_basename
,
correct
=
correct
,
total
=
total
)
db
.
session
.
add
(
evr
)
db
.
session
.
commit
()
except
:
...
...
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