Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Linear regression tutorial mixing #1404

Open
ndmlny-qs opened this issue Apr 14, 2022 · 2 comments
Open

Linear regression tutorial mixing #1404

ndmlny-qs opened this issue Apr 14, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ndmlny-qs
Copy link
Contributor

Issue Description

The linear regression tutorial has been updated in branch ot-linear-reg-tutorial to have interactive
plotting. The notebook shows poor mixing of model chains except when using the BMGInference
method.

Steps to Reproduce

Execute the notebook to in the branch to see the mixing behavior.

Expected Behavior

Similar mixing behavior between the models.

System Info

Please provide information about your setup

  • PyTorch Version (run print(torch.__version__)
    • 1.11.0
  • Python version
    • 3.10.4

Additional Context

@ndmlny-qs ndmlny-qs added the bug Something isn't working label Apr 14, 2022
@horizon-blue
Copy link
Contributor

Thanks for surfacing this, Andy. I can reproduce the same issue on my machine even without your modifications, so there is definitely some regression on BM side.

I am suspecting this is caused by improper initialization, because when I rerun the inference (without resetting the seed), sometimes NMC can still mix well. The same also applies when I try initialize from prior (by setting initialize_fn=bm.world. init_from_prior on infer). Could you try setting a different seed or changing the initialization function to see if either of these approach helps resolving the issue?

@ndmlny-qs
Copy link
Contributor Author

  • I changed the seed three times, all with the same issue surfacing.
  • Reverting back to the original seed (12) and setting initialize_fn=bm.world.init_from_prior in the infer method still had poor mixing.
  • I tried a few different initialization functions using a gamma, uniform, and halfnormal distribution. All ended up with poor mixing. The only time I got better mixing was when I used the gamma distribution in the initialize_fn with a concentration greater than the rate parameter, but this was not always the case, and I was not able to figure out a pattern.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants