Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Marco Di Francesco
IDA LSTM
Commits
190bf292
Commit
190bf292
authored
Sep 09, 2021
by
Gabriele Franch
Browse files
added seeding
parent
acca89d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
cikm_inter_dst_predrnn_run_taasss.py
View file @
190bf292
...
...
@@ -6,6 +6,8 @@ import numpy as np
from
tqdm
import
tqdm
import
os
import
sys
import
torch
import
random
import
core.trainer
as
trainer
from
cikm_inter_dst_predrnn_run_taasss_utils
import
get_batcher
,
padding_taasss
,
change_taasss_dims
...
...
@@ -67,6 +69,15 @@ batch_size = args.batch_size
# args.patch_size = 16
def
seed_everything
(
seed
):
random
.
seed
(
seed
)
os
.
environ
[
'PYTHONHASHSEED'
]
=
str
(
seed
)
np
.
random
.
seed
(
seed
)
torch
.
manual_seed
(
seed
)
torch
.
cuda
.
manual_seed
(
seed
)
torch
.
backends
.
cudnn
.
deterministic
=
True
def
schedule_sampling
(
eta
:
float
,
itr
:
int
):
"""
Return
...
...
@@ -158,5 +169,6 @@ def wrapper_train(model: Model):
print
(
"Initializing models"
,
file
=
sys
.
stderr
)
seed_everything
(
42
)
model
=
Model
(
args
)
wrapper_train
(
model
)
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