Closed m6129 closed 2 months ago
Hi, as it is a probabilistic forecasting model, it is expected to give new predictions when you're sampling every time.
If you'd like to have the same samples predicted every time, can you maybe try using a random seed just before sampling?
If that doesn't work, I'm happy to take a look at this again in 2 weeks (I'm busy with releasing everything else for the next 2 weeks).
Let me know,
Thanks Arjun
Thanks!! By how using a random seed just before sampling?
I believe you've to add the random seed function before this line.
I recommend seeding everything (random
, torch
, numpy
etc.). I usually use this (but I haven't tested it for your usecase):
import os
import random
import numpy as np
import torch
def set_seed(seed, deterministic=True):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
if torch.cuda.is_available():
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = deterministic
torch.backends.cudnn.benchmark = False
os.environ["PYTHONHASHSEED"] = str(seed)
Hi @m6129 is this resolved?
Hi @m6129 is this resolved?
Yes, Thanks! it helped
Hello. How do I freeze the predictions? I have a different prediction every time.