precompute_curves¶
- flipbook.precompute_curves(model_fn: Callable[[ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]], t: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], chain: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Chain, *, steps: slice | tuple[int | None, int | None] | Sequence[int] | ndarray[tuple[Any, ...], dtype[integer[Any]]] | None = None, walkers: str | int | Sequence[int] | ndarray[tuple[Any, ...], dtype[integer[Any]]] = 'all', log_prob: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None = None, param_transform: Callable[[ndarray[tuple[Any, ...], dtype[float64]]], ndarray[tuple[Any, ...], dtype[float64]]] | None = None, vectorized: bool = False, n_jobs: int = 1, chunk_size: int = 32, topk_by_logp: int | None = None, max_curves_per_frame: int | None = None) Iterator[dict[str, object]][source]¶
Pre-compute model curves for later use.
- Parameters:
- model_fncallable
Callable implementing
f(theta, t) -> y.- tarray_like
One-dimensional array of time samples.
- chainarray_like or Chain
Chain data or
Chaininstance.- stepsslice, tuple, sequence of int, optional
Steps to pre-compute. When
Noneall steps are considered.- walkers{‘all’, int, sequence of int}, optional
Walker selection specification.
- log_probarray_like, optional
Log-probability values for the chain.
- param_transformcallable, optional
Optional transformation applied prior to model evaluation.
- vectorizedbool, optional
Indicates that
model_fnsupports vectorized evaluation.- n_jobsint, optional
Number of worker threads for non-vectorized evaluation.
- chunk_sizeint, optional
Batch size for threaded evaluation.
- topk_by_logpint, optional
If provided, restricts walkers to the top-K by log probability per step.
- max_curves_per_frameint, optional
Maximum number of curves retained per step.
- Returns:
- generator of dict
Generator yielding dictionaries with keys
'step_index','walker_indices','curves', and'log_prob'.