SummedTerms

class pmrf.problems.SummedTerms(model: Any, terms: Any)

Bases: AbstractProblem

A problem summing a set of terms over a tree of parameters.

Each term is a callable that accepts the tree and returns a result. pmrf.BoundEvaluator can be used to bind an evaluator (such as a loss or likelihood) to a frequency sweep, whilst a term that requires no frequency, such as a penalty on the parameters, can be passed as a plain callable.

Parameters:
  • model (Any) – The tree of parameters to evaluate, typically an RF model.

  • terms (tuple[Callable[[pmrf.models.base.Model], jax.jaxlib._jax.Array], ...]) – The terms to sum. Each maps the tree to a scalar or array result.

__call__(*args, **kwargs) Array

Evaluate the problem.

model: Any

The tree of parameters being solved for.

terms: tuple[Callable[[Model], Array], ...]

The terms summed to produce the result.