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

Implement PositivePowerTransform #2904

Merged
merged 3 commits into from
Jul 20, 2021
Merged

Implement PositivePowerTransform #2904

merged 3 commits into from
Jul 20, 2021

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Jul 20, 2021

This implements a PositivePowerTransform. Whereas PowerTransform allows arbitrary exponent and requires positive domain and codomain, this requires positive exponent and allows real domain and codomain.

The intended use case is in sparse regression problems where this can be combined with TransformReparam and AutoNormal / AutoLowRankMultivariateNormal guides, achieving a horseshoe-like prior while attempting to keep the transformed posterior unimodal:

scale = pyro.sample("scale", LogNormal(0, 1))
sparsity = pyro.sample("sparsity", LogNormal(0, 1))
with poutine.reparam(config={"x": TransformReparam()}):
    x = pyro.sample(
        "x",
        TransformedDistribution(
            Normal(0, scale),
            PositivePowerReparam(sparsity),
        ),
    )

Tested

  • added a transform test

pyro/distributions/transforms/power.py Outdated Show resolved Hide resolved
@neerajprad neerajprad merged commit 09e4401 into dev Jul 20, 2021
@fritzo fritzo deleted the power-transform branch September 27, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants