autofit.ClipperNone#
- class ClipperNone[source]#
Bases:
AbstractClipperThe no-op clipper, and the default.
Bounds are
±infandprojectis the identity, so a search configured with this is bit-identical to one with no clipper concept at all. Searches should test for it and skip the projection entirely rather than applying it as a no-op, so that the compiled step is unchanged too.Methods
The
(lower, upper)box, in physical parameter order.Project
vectoronto the prior support.- bounds_from_model(model)[source]#
The
(lower, upper)box, in physical parameter order.Unbounded coordinates are
-inf/+inf. The two arrays are returned separately because that is the shapeprojectbroadcasts against.Note that this is not the shape
scipy.optimize.minimizeaccepts: it reads a(lower, upper)tuple as a sequence of ``(min, max)`` pairs, which for a two-parameter model silently produces a wrong fit rather than an error. Callers handing these to scipy must build an explicitscipy.optimize.Bounds— see_bounds_from.- Parameters:
model – The model whose priors define the support.
- project(vector, model, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautofit/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>, scale=None, bijector=None)[source]#
Project
vectoronto the prior support.- Parameters:
vector – A parameter vector, either a single
(n_params,)vector or a batched(n_starts, n_params)array of them. Broadcasting handles both, so novmapis required of the caller. Physical unlessscaleorbijectoris given, in which case it is in that change of variables’ coordinates.model – The model whose priors define the support.
xp – The array module,
numpyorjax.numpy.scale – The per-parameter step scale from a
scaler, when the caller is stepping inphi = theta / scalerather than in physical parameters. The bounds are divided by it, so the projection happens in the caller’s own coordinates and no round-trip through physical space is needed. Scales are strictly positive, so dividing preserves the ordering of each(lower, upper)pair and+/-infstay+/-inf. Mutually exclusive withbijector.bijector – A resolved
AbstractBijector(.from_modelalready called), when the caller is stepping inphi = bijector.forward(theta). The inset bounds are computed in physical space (kind-aware — see the module docstring) and then mapped throughbijector.bounds_forward, which commutes with clipping because every bijector kind is monotone increasing. Mutually exclusive withscale.
- Returns:
A
(projected, clipped_mask)pair.clipped_maskis boolean, the sameshape as
vector, andTrueexactly where a coordinate was moved.