Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Fairseq
Commits
81ace092
Commit
81ace092
authored
Jan 19, 2018
by
Myle Ott
Browse files
Fix max_positions calculation in train.py
parent
33469436
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
train.py
train.py
+2
-2
No files found.
train.py
View file @
81ace092
...
...
@@ -79,11 +79,11 @@ def main():
# The max number of positions can be different for train and valid
# e.g., RNNs may support more positions at test time than seen in training
max_positions_train
=
(
args
.
max_source_positions
,
args
.
max_target_positions
)
max_positions_valid
=
(
max_positions_train
=
(
min
(
args
.
max_source_positions
,
model
.
max_encoder_positions
()),
min
(
args
.
max_target_positions
,
model
.
max_decoder_positions
())
)
max_positions_valid
=
(
model
.
max_encoder_positions
(),
model
.
max_decoder_positions
())
# Start multiprocessing
trainer
=
MultiprocessingTrainer
(
args
,
model
,
criterion
)
...
...
Write
Preview
Markdown
is supported
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