AbstractProblem

class pmrf.problems.AbstractProblem

Bases: Module

Abstract base class for callables to be “solved” (i.e. minimized or sampled).

A problem groups the PyTrees a solve is defined over into a single PyTree, and binds them to the terms evaluating them. Where an evaluator maps a model and a frequency to an array, and a term maps a PyTree to an array, a problem takes nothing further.

Problems compose: one may wrap another to add to its result, in which case it exposes the wrapped problem’s model as its own.

abstractmethod __call__(*args, **kwargs) Array

Evaluate the problem.

property inner: AbstractProblem

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

model: AbstractVar[Any]

The tree of parameters being solved for.