jexplore.sampling.space ======================= .. py:module:: jexplore.sampling.space .. autoapi-nested-parse:: This module provides the definitions for the base target space classes. The prototyping class :py:attr:`jexplore.sampling.space.Space` and the class defining a simple box space :py:attr:`jexplore.sampling.space.Box` Classes ------- .. autoapisummary:: jexplore.sampling.space.Space jexplore.sampling.space.Box Module Contents --------------- .. py:class:: Space Bases: :py:obj:`Protocol` Markov sampling target space prototype class. Child space classes should implement an `inspace` method and a `wrap` method. :param dim: dimension of the target space. .. py:attribute:: dim :type: int Dimension of the target space .. py:method:: inspace(points) Check which of a set of point lay in the defined space. :param points: set of points to be checked, it can have the `state` shape :math:`(N_{chains}, D)` or the `samples` shape :math:`(N_{chains}, D, S)`. :return: a boolean mask of shape :math:`(N_{chains})` or :math:`(N_{chains}, S)` selecting points that lay in the defined space. .. py:method:: wrap(points) folds the wrapped dimensions of the target space. :param points: set of points to be processed, it can have the `state` shape :math:`(N_{chains}, D)` or the `samples` shape :math:`(N_{chains}, D, S)`. return: the same set of points with the wrapped dimensions folded. .. py:class:: Box(dim = None, size = jnp.inf, box = None, wrapped = None) Bases: :py:obj:`Space` Simple rectangular box space. :param dim: dimension of the box. Only used if the `box` parameter is not provided. :param size: size of the box (assumed having equal size in all dimensions) only used if the `box` parameter is not provided. Default: infinity. :param box: list of lists defining the segments boundaries for each box dimensions. If not provided a box with `dim` dimensions of equal size `size` is considered. :param wrapped: list of periodic dimensions indexes. These dimensions will be considererd unbound and the corresponding box `intervals` will be interpreted as principal domain intervals. Default: empty list. .. py:attribute:: bounds :type: jax.Array Box bounds .. py:attribute:: wrap_dims :type: list[int] Wrapped dimensions indexes .. py:attribute:: wrap_domain :type: jax.Array wrapped dimensions principal domain .. py:attribute:: dim Dimension of the target space .. py:method:: inspace(points) Check which of a set of point lay in the defined space. :param points: set of points to be checked, it can have the `state` shape :math:`(N_{chains}, D)` or the `samples` shape :math:`(N_{chains}, D, S)`. :return: a boolean mask of shape :math:`(N_{chains})` or :math:`(N_{chains}, S)` selecting points that lay in the defined space. .. py:method:: wrap(points) folds the wrapped dimensions of the target space. :param points: set of points to be processed, it can have the `state` shape :math:`(N_{chains}, D)` or the `samples` shape :math:`(N_{chains}, D, S)`. return: the same set of points with the wrapped dimensions folded.