How to properly fix random seed with TFT?
See original GitHub issueExpected behavior
Hello guys I wonder how to fix seed to get reproducibility of my experiments
Right now I’m using this function before the start of the training
pl.seed_everything(42)
Actual behavior
However, it doesn’t work. It is caused by dropout because when I set dropout = 0 it had worked.
# configure network and trainer
pl.seed_everything(42)
trainer = pl.Trainer(
deterministic=True,
gpus=[0],
gradient_clip_val=0.1,
)
tft = TemporalFusionTransformer.from_dataset(
training,
learning_rate=0.03,
hidden_size=128,
attention_head_size=2,
dropout=0.3,
hidden_continuous_size=32,
output_size=7,
loss=QuantileLoss(),
reduce_on_plateau_patience=4,
)
trainer.fit(
tft,
train_dataloader=train_dataloader,
val_dataloaders=val_dataloader,
)
So, how do I do to fix this issue?
Thanks,
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to properly fix random seed in pytorch-forecasting with ...
I wonder how to fix seed to get the reproducibility of my experiments. Right now I'm using this function before the start of...
Read more >Properly Setting the Random Seed in ML Experiments
1. Use an Experiment tracking system such as Comet.ml. · 2. Define a single variable that contains a static random seed and use...
Read more >How to Use Random Seeds Effectively | by Jai Bansal
If, as most people do, you set a random seed arbitrarily, your resulting data splits can vary drastically depending on your choice.
Read more >Can anyone confirm if TFT uses random number generator or ...
I don't know exactly how it works, but there is definitely some kind of increased chance to hit synergies you have on the...
Read more >Fixing random seed on inference - Cross Validated
I will be deploying models into production and I'm wondering whether it is appropriate to fix the random number generator seed at inference ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, could you try this?: pl.seed_everything(42,workers=True)
// It works for me
Hi Luming Sun, Thanks for your suggestion, I have tried but it hasn’t worked too.