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

Generic cdf and icdf implementation for scalar TransformedDistributions. #1853

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

tillahoffmann
Copy link
Contributor

@tillahoffmann tillahoffmann commented Aug 21, 2024

This PR

  • Adds a sign attribute to Transform which is the sign of the derivative for bijective scalar transforms. This matches the sign attribute of transforms in Pyro.
  • Implements cdf for TransformedDistribution by transforming from the domain of the transformed distribution to the domain of the base distribution and evaluating the cdf.
  • Implements icdf for TransformedDistribution by calling icdf of the base distribution and applying the transforms.

This means cdfs for LogNormal, InverseGamma, LogUniform, and Pareto do not require a custom implementation. As a side effect, this PR adds icdf support for LogNormal, InverseGamma, and LogUniform; it also adds cdf and icdf support for RelaxedBernoulliLogits.

…mplementation for `TransformedDistribution`s.
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

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

Beautiful! Thanks, Till!

@fehiepsi fehiepsi merged commit d52209c into pyro-ppl:master Aug 26, 2024
4 checks passed
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.

2 participants