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

turn jitter into an argument of inv_probit instead of hard-coded inside #2018

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions gpflow/likelihoods/utils.py
Expand Up @@ -16,6 +16,11 @@
import tensorflow as tf


def inv_probit(x: tf.Tensor) -> tf.Tensor:
jitter = 1e-3 # ensures output is strictly between 0 and 1
def inv_probit(x: tf.Tensor, jitter: float = 1e-3) -> tf.Tensor:
"""
Compute the inverse probit, i.e. the N(0,1) CDF, at x.

:param x: argument
:param jitter: small jitter that ensures output is strictly between 0 and 1
"""
return 0.5 * (1.0 + tf.math.erf(x / np.sqrt(2.0))) * (1 - 2 * jitter) + jitter