Priors¶
Prior classes for adding prior probability distributions to objective functions.
Classes¶
- class ionworkspipeline.data_fits.objective_functions.regularizers.Prior(name: str | list[str] | ndarray | tuple, distribution: Distribution, regularizer_weight=None)¶
A function that takes a dictionary of inputs and returns a value.
Parameters¶
- funcallable
The penalty function that takes a dictionary of inputs and returns a value.
- regularizer_weightfloat, optional
The weight applied to the penalty term. Default is 1.0.
Extends:
ionworkspipeline.data_fits.objective_functions.regularizers.regularizers.Regularizer- evaluate_to_array(inputs: dict) ndarray¶
Evaluate the regularizer function with dictionary inputs, returning an array.
Parameters¶
- inputsdict
Dictionary of input values.
Returns¶
- ndarray
Array containing the regularizer value.
- evaluate_to_scalar(inputs: dict) float¶
Evaluate the regularizer function with dictionary inputs, returning a scalar. The scalar value evaluates the canonical form, which is \((w * f(x))^2\).
Parameters¶
- inputsdict
Dictionary of input values.
Returns¶
- float
Scalar regularizer value.
- to_config() dict¶
Convert the prior to a configuration dictionary.
- class ionworkspipeline.data_fits.objective_functions.regularizers.PriorSet(priors: list[Prior], scalar_output: bool, x_to_inputs: callable, regularizer_set_weight=None)¶
A collection of prior terms that can be evaluated together.
Parameters¶
- regularizerslist, tuple or ndarray
Collection of penalty terms.
- scalar_outputbool
Whether the set returns scalar or array outputs.
- x_to_inputscallable
Function converting parameter vectors to input dictionaries.
- regularizer_set_weightfloat, optional
Weight applied to the entire penalty set. Default is 1.0.
Extends:
ionworkspipeline.data_fits.objective_functions.regularizers.regularizers.RegularizerSet- property base_regularizer_type¶
type: The base type for regularizers in this set.