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
Gaëtan Caillaut
minibert-oscar
Commits
935c095e
Commit
935c095e
authored
Jan 28, 2021
by
Gaëtan Caillaut
Browse files
--epochs-between-save
parent
89f82bbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
train.py
View file @
935c095e
...
...
@@ -21,7 +21,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
"--device"
,
type
=
str
,
default
=
"cpu"
)
parser
.
add_argument
(
"--logdir"
,
type
=
str
,
required
=
False
)
parser
.
add_argument
(
"-c"
,
"--checkpoint"
,
type
=
str
,
required
=
False
)
parser
.
add_argument
(
"--
init-w2v"
,
action
=
"store_true"
)
parser
.
add_argument
(
"--
epochs-between-save"
,
default
=
10
,
type
=
int
)
position_mapper
=
{
"none"
:
PositionalEmbeddingType
.
NONE
,
...
...
@@ -127,7 +127,7 @@ if __name__ == "__main__":
writer
.
add_scalar
(
"Loss/train"
,
cumloss
/
len
(
train_loader
),
epoch
)
print
(
f
"EPOCH
{
epoch
:
04
}
- Loss:
{
cumloss
/
len
(
train_loader
)
}
"
)
if
epoch
%
10
==
0
:
if
epoch
%
args
.
epochs_between_save
==
0
:
model
.
eval
()
k
=
5
train_precision
,
train_tp
=
eval_model_k
(
...
...
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