InverseGammaPrior#

class jolideco.priors.InverseGammaPrior(alpha=10, beta=1.5, cycle_spin_subpix=False, generator=None)[source]#

Bases: Prior

Sparse prior for point sources

Defined by a product of inverse Gamma distributions. See e.g. [ref]

To reproduce:

from sympy import Symbol, Indexed, gamma, exp, Product, log
from jolideco.utils.sympy import concrete_expand_log

alpha = Symbol("alpha")
beta = Symbol("beta")

N = Symbol("N", integer=True, positive=True)
i = Symbol("i", integer=True, positive=True)

x = Indexed('x', i)

inverse_gamma = beta ** alpha / gamma(alpha) * x ** (-alpha - 1) * exp(-beta / x)
inverse_gamma

like = Product(inverse_gamma, (i, 1, N))

log_like = log(like)

concrete_expand_log(log_like)
alpha#

Alpha parameter

Type:

float

beta#

Beta parameter

Type:

float

cycle_spin_subpix#

Subpixel cycle spin.

Type:

bool

generator#

Random number generator

Type:

~torch.Generator

Initialize internal Module state, shared by both nn.Module and ScriptModule.

Attributes Summary

log_constant_term

Log constant term

mean

Mean of the distribution

mode

Mode of the distribution

Methods Summary

__call__(flux)

Evaluate the prior

to_dict()

Convert deconvolver configuration to dict, with simple data types.

Attributes Documentation

log_constant_term#

Log constant term

mean#

Mean of the distribution

mode#

Mode of the distribution

Methods Documentation

__call__(flux)[source]#

Evaluate the prior

Parameters:

flux (~pytorch.Tensor) – Reconstructed point source flux

Returns:

Log prior value.

Return type:

log_prior ; ~torch.tensor

to_dict()[source]#

Convert deconvolver configuration to dict, with simple data types.

Returns:

data – Parameter dict.

Return type:

dict