-
Notifications
You must be signed in to change notification settings - Fork 52
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
x ~ scale * N(theta, 1) or x ~ N(theta, scale)? 🤔 #66
Comments
Hi Niels, the task T2 in the BayesFlow repo is the same as the one in Lueckmann et al., only written slightly differently in code. :) Can you also please specify which paper you mean? |
Follow up: You are right in assuming that the default scaling factor in the BayesFlow differs from Lueckmann et al., since the 0.1 in the original paper is a variance and not a scale! Nice spot! :) You can still adjust it with a keyword argument, but I will modify the code for out of the box compatibility. |
Hi Stefan, Indeed the task I described is T1 and not T2. Regarding the values from the paper, I think the implementation from SBIB and what they wrote in the paper is also a little different since, as you pointed out, they have 0.1 in the paper as a variance but implemented a scale (standard deviation, instead of variance) of 0.1 in their code. Anyway, my point is that having a factor in front of a distribution is only equivalent to having that scale factor as std for the normal distribution when the mean is 0. I.e., in the case where you sample the observations: Equivalently for T2: Sorry for the confusion with variance and scale and T1 and T2, but I hope my point/question is now a little bit clearer. Regarding the paper that mentions the multivariate dataset, I mean the BayesFlow paper section 3.3. Do you also provide the BayesFlow model settings somewhere for that evaluation task? |
You are exactly right. I wanted to avoid using the How do we "fix" this if the SBIB implementation / description differs as well? Should we call the optional argument Regarding the multivariate dataset, you can find the code in the super legacy repo; https://github.com/stefanradev93/cINN/blob/master/MVN_Gaussian_cINN_Example.ipynb However, it would be much easier if you use the |
Ok, so to fix the indirect scaling of the prior when sampling the observations should be straightforward instead of: Btw I found that the changes from above need to be changed for the following scripts that I looked at (might need also to be changed for other scripts; those are just the ones I looked at): To fix the inconsistency sbib has in their implementation/paper, I guess I would stick to their implementation since the benchmark results in their paper are result of using a scale of 0.1, although 0.1 was given as variance (=> scale~~0.31...) in their appendix. If they want to fix it, I guess the easiest way would be to change the scale values (or description: scale = 0.1, x|theta ~ N(theta, scale^2 * 1) in the paper and releasing a new version instead of changing the scale in the code to match the description in the paper since that would mean they also need to rerun the experiments to yield the benchmark results for the new datasets. Let me know what you think! Thank you for providing the link to the legacy repo. I am currently trying to reproduce your results from BaysFlow but am not using this repo here but an implementation for the flow using freia and to make sure everything works as expected I wanted to reproduce your results on a couple of benchmarks where numbers were provided :) |
Thanks for spotting the bugs! These are now fixed in the dev branch (soon to become main) and pointers to potential inconsistencies between paper and the two implementations have been added. I will resolve the issue upon a "thumbs up". |
Hello 👋 ,
I was trying to understand the benchmark datasets used to evaluate BayesFlow's performance. One thing that I noted for a couple of datasets is the scaling factor in front of the distribution for sampling the observations. One example is linked below, which is the T.2 task from the sbib paper.
Generating points for the original task would look like this:
theta ~ scale * N(0,1) = N(0, scale * 1)
x ~ N(theta, scale * 1)
with scale being the same for both distributions i.e., scale=0.1
Now your implementation is:
theta ~ scale * N(0,1) (same as above)
x ~ scale * N(theta, 1) = N(scale * theta, scale * 1)
which is equivalent to having a different prior compared to the T.2 task for the same data distribution, i.e.:
theta ~ scale^2 * N(0, 1) = N(0, scale^2)
x ~ N(theta, scale * 1)
maybe im also missing something but i would be glad for clarification. I also wanted to ask what code you used for the multivariate dataset from your paper part 3.3?
https://github.com/stefanradev93/BayesFlow/blob/5ff1c1ea8ee2bda8cf333ae2890b95d05185af23/bayesflow/benchmarks/gaussian_linear_uniform.py#L85
The text was updated successfully, but these errors were encountered: