pypesto.objective.aesara

Aesara objective

class pypesto.objective.aesara.AesaraObjective[source]

Bases: ObjectiveBase

Wrapper around an ObjectiveBase.

Computes the gradient at each evaluation, caching it for later calls. Caching is only enabled after the first time the gradient is asked for and disabled whenever the cached gradient is not used, in order not to increase computation time for derivative-free samplers.

Parameters:
  • objective (ObjectiveBase) – The pypesto.ObjectiveBase to wrap.

  • aet_x (TensorVariable) – Tensor variables that define the variables of aet_fun

  • aet_fun (TensorVariable) – Aesara function that maps aet_x to the variables of objective

  • coeff (Optional[float]) – Multiplicative coefficient for objective

__init__(objective, aet_x, aet_fun, coeff=1.0, x_names=None)[source]
Parameters:
call_unprocessed(x, sensi_orders, mode, **kwargs)[source]

See ObjectiveBase for more documentation.

Main method to overwrite from the base class. It handles and delegates the actual objective evaluation.

Return type:

dict[str, Union[float, ndarray, dict]]

Parameters:
check_mode(mode)[source]

See ObjectiveBase documentation.

Return type:

bool

Parameters:

mode (Literal['mode_fun', 'mode_res'])

check_sensi_orders(sensi_orders, mode)[source]

See ObjectiveBase documentation.

Return type:

bool

Parameters:

mode (Literal['mode_fun', 'mode_res'])