Skip to content

Fix ELU transform support - #3505

Open
ska2704 wants to merge 1 commit into
pyro-ppl:devfrom
ska2704:fix-elu-support
Open

ska2704 wants to merge 1 commit into
pyro-ppl:devfrom
ska2704:fix-elu-support

Conversation

@ska2704

@ska2704 ska2704 commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #2806.

ELU maps the real line to (-1, infinity), but ELUTransform declares positive-only support. As a result, TransformedDistribution(..., validate_args=True).log_prob() rejects valid negative and zero outputs. Set the codomain to greater_than(-1.0) so distribution validation follows the transform's range.

The regression tests cover the open lower boundary, float32/float64, batching, scalar/vector events, and log probabilities against the change-of-variables formula. All 14 new cases fail on unchanged dev.

Validation on Python 3.12.11 and PyTorch 2.14.1, CPU:

  • pytest tests/distributions/test_transforms.py -q: 176 passed (162 passed before the change).
  • make format and make lint: passed, including mypy across 553 source files.
  • make doctest: 75 passed.
  • make docs: reached rendering but failed because the local Graphviz neato executable is unavailable. GPU and full-project tests were not run locally.

@kumar-miskin

Copy link
Copy Markdown

I independently checked 2f1d3cf on CPU: all 176 transform tests pass. Twelve additional float32/float64 scalar/vector-event cases across three batch shapes also pass with transform caching disabled. For inputs spanning -4 to 3, inverse recovery agrees with the input, the log Jacobian agrees with an autograd-derived derivative, and transformed log probabilities agree with that independently computed change-of-variables expression. Gradients remain finite in these cases.

The checks cover ordinary negative/zero/positive outputs, not behavior near floating-point saturation at the -1 boundary. This is a focused, AI-assisted check, not full-suite or GPU validation or maintainer approval.

This branch has not been deployed

No deployments
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.

Incorrect codomain for ELUTransform

2 participants