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

Add epsilon after precision-factor-multiplication #22

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

michaeldeistler
Copy link
Contributor

@michaeldeistler michaeldeistler commented Aug 23, 2022

Fixes this issue of SNPE-C.

The change is that we apply the epsilon addition after having multiplied the precision factors. I.e., instead of

P = (L+eps) (L+eps)^T

we now do

P = (L L^T) + eps

This fixes SNPE-C on the toy example posted in the issue posted above.

I also decreased the magnitude of eps because previously, it was essentially squared through the (L+eps) (L+eps)^T operation.

Copy link
Contributor

@janfb janfb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, thanks!

@@ -81,7 +81,7 @@ def __init__(
raise NotImplementedError

# Constant for numerical stability.
self._epsilon = 1e-2
self._epsilon = 1e-4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add a test in sbi to make sure this really fixes the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'll create an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instability/Assertion error when using multi-round SNPE with mdn density estimator
2 participants