https://github.com/nixtla logo
#neural-forecast
Title
# neural-forecast
l

lobbie lobbie

11/07/2023, 11:49 PM
Hi @José Morales, Is it possible to set a fixed random seed in e.g. 'random_seed': tune.randint(1, 20)? I saw from the output, it seems to be setting different global seeds. I would like my nfc models to produce the same set of prediction results with the same input data everytime I run the models. Thanks.
j

José Morales

11/07/2023, 11:51 PM
Do you mean auto models?
l

lobbie lobbie

11/08/2023, 12:09 AM
Yes, @José Morales. I was using that in the Auto Models config
j

José Morales

11/08/2023, 12:17 AM
Are you using
config=None
? The default seed for all models is 1, however the default configuration for the auto models also tunes the seed
l

lobbie lobbie

11/08/2023, 12:20 AM
Nope. I am using the following config. so what do I need to do to ensure the same random seed everytime e.g. 666?
# config for tunning etc. Most parameters taken of by the Auto models.
myconfig = {'input_size': tune.choice([horizon,horizon*2,horizon*3])
,'batch_size': tune.choice([32,64])
,'max_steps': tune.choice([500])
,'learning_rate': tune.loguniform(1e-4, 1e-2)
,'random_seed': tune.randint(1, 20)
,'scaler_type': tune.choice([None])} # data is already scaled.
j

José Morales

11/08/2023, 12:20 AM
With that config you're also changing the seed. You should fix it, e.g.
'random_seed': 666
👍 1
l

lobbie lobbie

11/08/2023, 12:21 AM
aha! lovely....thanks a million
👍 1
c

Cristian (Nixtla)

11/08/2023, 3:05 AM
Hi @lobbie lobbie! For auto models there is still randomness in the sampling of the configurations during tuning, so the best model will change every time you run it
👍 1
2 Views