as_terms

pmrf.terms.as_terms(objective: Callable[[Model], Array] | tuple[Callable, Frequency] | Sequence[Callable[[Model], Array] | tuple[Callable, Frequency]], frequency: Frequency | None = None) tuple[Callable[[Model], Array], ...]

Normalize a user-supplied objective into a tuple of terms.

Accepts either a single objective or a sequence of them. Each element can be an evaluator, an (evaluator, frequency) pair binding it to its own sweep, an existing term, or a plain callable that accepts only the model.

Parameters:
  • objective – The objective(s) to normalize.

  • frequency – The frequency used for any element that does not carry its own. Only required if at least one element is not already bound to a sweep.

Returns:

The resolved terms.

Return type:

tuple