dora/active_sampling/gp_sampler.py
def acq_defs(y_mean=0, explore_priority=1.):
    """
    Generate a dictionary of acquisition functions.

    var_sum : Favours observations with high variance

    pred_upper_bound : Favours observations with high predicted target outputs

    sigmoid : Favours observations around decision boundaries

    Parameters
    ----------
    y_mean : int or np.ndarray
        The mean of the target outputs
    explore_priority : float
        Exploration priority against exploitation

    Returns
    -------
    dict
        A dictionary of acquisition functions to be used for the GP Sampler
    """
    # Aquisition Functions
    # u: Mean matrix (n x n_tasks)
    # v: Variance matrix (n x n_tasks)
    # Returns an array of n values
    return {
        'var_sum': lambda u, v: np.sum(v, axis=1),
        'pred_upper_bound': lambda u, v: np.max(u + 3 * explore_priority * np.sqrt(v),
                                        axis=1),
        'prod_max': lambda u, v: np.max((u + (y_mean +
                                        (explore_priority/.1) / 3.0)) *
                                        np.sqrt(v), axis=1),
        'prob_tail': lambda u, v: np.max((1 - stats.norm.cdf(
                                        (explore_priority/10000) *
                                         np.ones(u.shape), u,
                                         np.sqrt(v))), axis=1),
        'sigmoid': lambda u, v: np.abs(stats.logistic.cdf(u + np.sqrt(v),
                                       loc=0.5,
                                       scale=explore_priority) -
                                       stats.logistic.cdf(u - np.sqrt(v),
                                       loc=0.5,
                                       scale=explore_priority)).sum(axis=1)
    }

    Generate a dictionary of acquisition functions.

    var_sum : Favours observations with high variance

    pred_upper_bound : Favours observations with high predicted target outputs

    sigmoid : Favours observations around decision boundaries

    Parameters
    ----------
    y_mean : int or np.ndarray
        The mean of the target outputs
    explore_priority : float
        Exploration priority against exploitation

    Returns
    -------
    dict
        A dictionary of acquisition functions to be used for the GP Sampler
    
Generate a dictionary of acquisition functions.
var_sum : Favours observations with high variance

pred_upper_bound : Favours observations with high predicted target outputs

sigmoid : Favours observations around decision boundaries

Parameters

y_mean : int or np.ndarray
The mean of the target outputs
explore_priority : float
Exploration priority against exploitation

Returns

dict
A dictionary of acquisition functions to be used for the GP Sampler
Generate a dictionary of acquisition functions . var_sum : Favours observations with high variance pred_upper_bound : Favours observations with high predicted target outputs sigmoid : Favours observations around decision boundaries Parameters y_mean : int or np . ndarray The mean of the target outputs explore_priority : float Exploration priority against exploitation Returns dict A dictionary of acquisition functions to be used for the GP Sampler
def acq_defs(y_mean=0, explore_priority=1.):
    return {
        'var_sum': lambda u, v: np.sum(v, axis=1),
        'pred_upper_bound': lambda u, v: np.max(u + 3 * explore_priority * np.sqrt(v),
                                        axis=1),
        'prod_max': lambda u, v: np.max((u + (y_mean +
                                        (explore_priority/.1) / 3.0)) *
                                        np.sqrt(v), axis=1),
        'prob_tail': lambda u, v: np.max((1 - stats.norm.cdf(
                                        (explore_priority/10000) *
                                         np.ones(u.shape), u,
                                         np.sqrt(v))), axis=1),
        'sigmoid': lambda u, v: np.abs(stats.logistic.cdf(u + np.sqrt(v),
                                       loc=0.5,
                                       scale=explore_priority) -
                                       stats.logistic.cdf(u - np.sqrt(v),
                                       loc=0.5,
                                       scale=explore_priority)).sum(axis=1)
    }
def acq_defs ( y_mean = 0 , explore_priority = 1. ) : return { 'var_sum' : lambda u , v : np . sum ( v , axis = 1 ) , 'pred_upper_bound' : lambda u , v : np . max ( u + 3 * explore_priority * np . sqrt ( v ) , axis = 1 ) , 'prod_max' : lambda u , v : np . max ( ( u + ( y_mean + ( explore_priority / .1 ) / 3.0 ) ) * np . sqrt ( v ) , axis = 1 ) , 'prob_tail' : lambda u , v : np . max ( ( 1 - stats . norm . cdf ( ( explore_priority / 10000 ) * np . ones ( u . shape ) , u , np . sqrt ( v ) ) ) , axis = 1 ) , 'sigmoid' : lambda u , v : np . abs ( stats . logistic . cdf ( u + np . sqrt ( v ) , loc = 0.5 , scale = explore_priority ) - stats . logistic . cdf ( u - np . sqrt ( v ) , loc = 0.5 , scale = explore_priority ) ) . sum ( axis = 1 ) }
Generate a dictionary of acquisition functions.
Generate a dictionary of acquisition functions .
"""
    Generate a dictionary of acquisition functions.

    var_sum : Favours observations with high variance

    pred_upper_bound : Favours observations with high predicted target outputs

    sigmoid : Favours observations around decision boundaries

    Parameters
    ----------
    y_mean : int or np.ndarray
        The mean of the target outputs
    explore_priority : float
        Exploration priority against exploitation

    Returns
    -------
    dict
        A dictionary of acquisition functions to be used for the GP Sampler
    """ # Aquisition Functions # u: Mean matrix (n x n_tasks) # v: Variance matrix (n x n_tasks) # Returns an array of n values
y_mean
explore_priority