josiann.moves.discrete.SetStretch

class josiann.moves.discrete.SetStretch(*, position_set, a=2.0, bounds=None, repr_attributes=(), **kwargs)[source]

Fusion of the Set and Stretch moves. We exploit multiple walkers in parallel a move each to the closest point in the set of possible positions instead of the point proposed by the stretch.

Instantiate a Move.

Parameters:
  • position_set (Sequence[Sequence[float]]) – sets of only possible values for x in each dimension.

  • a (float (default: 2.0)) – parameter for tuning the distribution of Z. Smaller values make samples tightly distributed around 1 while bigger values make samples more spread out with a peak getting closer to 0.

  • bounds (Optional[ndarray[tuple[int, ...], dtype[float64 | int64]]] (default: None)) – optional sequence of (min, max) bounds for values to propose in each dimension.

  • repr_attributes (tuple[str, ...] (default: ())) – tuple of attribute names to include in the move’s representation.

  • kwargs (Any)

Methods

SetStretch.__init__

Instantiate a Move.

SetStretch.get_proposal

Generate a new proposed vector x.

SetStretch.set_bounds

Set bounds for the move.

Methods

SetStretch.__init__(*, position_set, a=2.0, bounds=None, repr_attributes=(), **kwargs)[source]

Instantiate a Move.

Parameters:
  • position_set (Sequence[Sequence[float]]) – sets of only possible values for x in each dimension.

  • a (float (default: 2.0)) – parameter for tuning the distribution of Z. Smaller values make samples tightly distributed around 1 while bigger values make samples more spread out with a peak getting closer to 0.

  • bounds (Optional[ndarray[tuple[int, ...], dtype[float64 | int64]]] (default: None)) – optional sequence of (min, max) bounds for values to propose in each dimension.

  • repr_attributes (tuple[str, ...] (default: ())) – tuple of attribute names to include in the move’s representation.

  • kwargs (Any)

SetStretch.get_proposal(x, state)

Generate a new proposed vector x.

Parameters:
Return type:

ndarray[tuple[int, ...], dtype[TypeVar(DT_ARR, bound= float64 | int64)]]

Returns:

New proposed vector x of shape (ndim,).

SetStretch.set_bounds(bounds)

Set bounds for the move.

Parameters:

bounds (tuple[float, float] | Sequence[tuple[float, float]] | None) – sequence of (min, max) bounds for values to propose in each dimension.

Return type:

None