dora/active_sampling/base_sampler.py
def grid_sample(lower, upper, n):
    """
    Used to seed an algorithm with a regular pattern of corners and centres.

    This can be used to provide search parameters and the indices.

    Parameters
    ----------
    lower : array_like
        Lower or minimum bounds for the parameter space
    upper : array_like
        Upper or maximum bounds for the parameter space
    n : int
        Index of location

    Returns
    -------
    np.ndarray
        Sampled location in feature space
    """
    lower = np.asarray(lower)
    upper = np.asarray(upper)
    dims = lower.shape[0]
    n_corners = 2 ** dims
    if n < n_corners:
        xq = lower + (upper - lower) * \
            (n & 2 ** np.arange(dims) > 0).astype(float)
    elif n == n_corners:
        xq = lower + 0.5 * (upper - lower)
    else:
        assert(False)
    return xq

    Used to seed an algorithm with a regular pattern of corners and centres.

    This can be used to provide search parameters and the indices.

    Parameters
    ----------
    lower : array_like
        Lower or minimum bounds for the parameter space
    upper : array_like
        Upper or maximum bounds for the parameter space
    n : int
        Index of location

    Returns
    -------
    np.ndarray
        Sampled location in feature space
    
Used to seed an algorithm with a regular pattern of corners and centres.
This can be used to provide search parameters and the indices.

Parameters

lower : array_like
Lower or minimum bounds for the parameter space
upper : array_like
Upper or maximum bounds for the parameter space
n : int
Index of location

Returns

np.ndarray
Sampled location in feature space
Used to seed an algorithm with a regular pattern of corners and centres . This can be used to provide search parameters and the indices . Parameters lower : array_like Lower or minimum bounds for the parameter space upper : array_like Upper or maximum bounds for the parameter space n : int Index of location Returns np . ndarray Sampled location in feature space
def grid_sample(lower, upper, n):
    lower = np.asarray(lower)
    upper = np.asarray(upper)
    dims = lower.shape[0]
    n_corners = 2 ** dims
    if n < n_corners:
        xq = lower + (upper - lower) * \
            (n & 2 ** np.arange(dims) > 0).astype(float)
    elif n == n_corners:
        xq = lower + 0.5 * (upper - lower)
    else:
        assert(False)
    return xq
def grid_sample ( lower , upper , n ) : lower = np . asarray ( lower ) upper = np . asarray ( upper ) dims = lower . shape [ 0 ] n_corners = 2 ** dims if n < n_corners : xq = lower + ( upper - lower ) * ( n & 2 ** np . arange ( dims ) > 0 ) . astype ( float ) elif n == n_corners : xq = lower + 0.5 * ( upper - lower ) else : assert ( False ) return xq
Used to seed an algorithm with a regular pattern of corners and centres.
Used to seed an algorithm with a regular pattern of corners and centres .
"""
    Used to seed an algorithm with a regular pattern of corners and centres.

    This can be used to provide search parameters and the indices.

    Parameters
    ----------
    lower : array_like
        Lower or minimum bounds for the parameter space
    upper : array_like
        Upper or maximum bounds for the parameter space
    n : int
        Index of location

    Returns
    -------
    np.ndarray
        Sampled location in feature space
    """
lower
upper
n