Hi, thanks for work. I try to improve the reproducibility, but the comment in the json file seems not consistent with the code.
|
"seed" : -1, // random seed, seed <0 represents randomization not used |
|
""" set random seed, gl_seed used in worker_init_fn function """ |
|
if seed >= 0 and gl_seed >= 0: |
|
seed += gl_seed |
|
torch.manual_seed(seed) |
|
torch.cuda.manual_seed_all(seed) |
|
np.random.seed(seed) |
|
random.seed(seed) |
|
|
|
''' change the deterministic and benchmark maybe cause uncertain convolution behavior. |
|
speed-reproducibility tradeoff https://pytorch.org/docs/stable/notes/randomness.html ''' |
|
if seed >= 0 and gl_seed >= 0: # slower, more reproducible |
|
torch.backends.cudnn.deterministic = True |
|
torch.backends.cudnn.benchmark = False |
|
else: # faster, less reproducible |
|
torch.backends.cudnn.deterministic = False |
|
torch.backends.cudnn.benchmark = True |
Hi, thanks for work. I try to improve the reproducibility, but the comment in the json file seems not consistent with the code.
EMDiffuse/config/EMDiffuse-r.json
Line 6 in 79c8045
EMDiffuse/core/util.py
Lines 45 to 60 in 79c8045