Skip to content

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

@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