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
5bf07724
Commit
5bf07724
authored
Jun 19, 2018
by
alexeib
Committed by
Myle Ott
Jun 21, 2018
Browse files
sort descending when evaluating lm because it is faster (17k wps vs 11k) and will fail early if oom
parent
a091d239
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairseq/data/monolingual_dataset.py
fairseq/data/monolingual_dataset.py
+1
-1
No files found.
fairseq/data/monolingual_dataset.py
View file @
5bf07724
...
@@ -72,7 +72,7 @@ class MonolingualDataset(FairseqDataset):
...
@@ -72,7 +72,7 @@ class MonolingualDataset(FairseqDataset):
order
=
[
np
.
random
.
permutation
(
len
(
self
))]
order
=
[
np
.
random
.
permutation
(
len
(
self
))]
else
:
else
:
order
=
[
np
.
arange
(
len
(
self
))]
order
=
[
np
.
arange
(
len
(
self
))]
order
.
append
(
self
.
sizes
)
order
.
append
(
np
.
flip
(
self
.
sizes
,
0
)
)
return
np
.
lexsort
(
order
)
return
np
.
lexsort
(
order
)
def
valid_size
(
self
,
index
,
max_positions
):
def
valid_size
(
self
,
index
,
max_positions
):
...
...
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