Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomness Control in DeepAR. Advice Needed. #3141

Open
heaynking opened this issue Mar 15, 2024 · 0 comments
Open

Randomness Control in DeepAR. Advice Needed. #3141

heaynking opened this issue Mar 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@heaynking
Copy link

Description

I couldn't control randomness when training the model using DeepAR as follows:

def seed_everything(seed: int) -> None:
    np.random.seed(seed)
    torch.manual_seed(seed)
    pl.seed_everything(seed=seed, workers=True)
    mx.random.seed(seed)
    random.seed(seed)
    torch.cuda.manual_seed(seed)
    torch.backends.cudnn.deterministic = True
    torch.use_deterministic_algorithms = True
seed_everything(123)

Therefore, I'm trying to train multiple models and use their statistical values.
However, I noticed a difference in behavior between simply collecting models using a for loop and using Joblib Parallel.
The for loop exhibits a large variance, whereas joblib's Parallel shows a much smaller variance. And the prediction trends also differ.

I would appreciate any advice you may have.

Environment

  • Operating system: linux
  • python = "~3.10"
  • gluonts = {extras = ["mxnet"], version = "^0.14.4"}
@heaynking heaynking added the bug Something isn't working label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant