FunctionLogger.batch_call#
- FunctionLogger.batch_call(x: ndarray, f_vals=None)[source]#
Evaluate and cache a batch of points in input order.
- Parameters:
- xnp.ndarray
A nonempty array with shape
(N, D)in transformed coordinates.- f_valsarray-like, optional
Values of the logged function at the corresponding rows of
x, before any parameter-transform Jacobian is added. It must have lengthN; NaN rows are evaluated by the target. At uncertainty handling level 2 every row has to be NaN: a supplied value comes without the SD that an observation needs at that level.
- Returns:
- valuesnp.ndarray
The recorded values in transformed coordinates, with shape
(N,).- SDsnp.ndarray or None
The target SD for each row when noise handling is enabled, otherwise
None.- indicesnp.ndarray
Cache indices corresponding to the input rows.
- Raises:
- RuntimeError
If this logger was not created with
vectorized_target=True.- ValueError
If the input or any supplied or returned value has an invalid shape or value, or if
f_valssupplies a value at uncertainty handling level 2. The supplied values are validated before the target is called, and its outputs before any row is recorded.
For the logger owned by a VBMC instance, the logged function is VBMC’s
assembled log joint, so values passed directly to batch_call include any
separately supplied prior. This differs from
VBMC(precomputed_evaluations=(X, y)): there, y contains outputs of the
log_density argument, and VBMC adds a separately supplied prior once. See
the VBMC interface for that higher-level workflow.