PriorPenalized

class pmrf.objectives.PriorPenalized(problem: AbstractProblem)

Bases: AbstractProblem

A problem penalized by the negative log prior of its parameters, in declared space.

Minimizing a penalized problem gives the maximum a posteriori estimate, where the problem alone gives the maximum likelihood estimate. Priors are extracted over the whole problem, so the terms’ own hyper-parameters are covered alongside the model’s parameters. The density is pmrf.log_prior() with space='declared', which differs from the physical density by a constant and so has the same mode.

Priors are metadata and are stripped by unwrapping, so they are extracted once on construction while the problem is still wrapped.

Parameters:

problem (pmrf.objectives.problems.AbstractProblem) – The problem to penalize.

__call__(*args, **kwargs) → Array

Evaluate the problem.

distributions: Any

The prior distributions of the problem’s parameters, over physical values.

property inner: AbstractProblem

The problem itself, or the one it wraps, looking through any nesting.

log_scale: Any

the sum of n log|scale| over scaled parameters with a prior.

Type:

The constant taking the physical log density to the declared one

property model: PyTree
problem: AbstractProblem

The problem being penalized.