The connect_via_gaussian_process function#

Aliases#

halerium.core.connect_via_gaussian_process
halerium.core.regression.connect_via_gaussian_process
connect_via_gaussian_process(name_prefix, inputs, outputs, inputs_location=None, inputs_scale=None, outputs_location=None, outputs_scale=None, connect_outputs_scale_parameter=False, interpolation_points=100, interpolation_range=4.0, kernel_correlation_length=0.4, kernel_size=21)#

Gaussian process regression.

Calculate mean (and variance) fields to be used for Gaussian process regression.

Mean (and variance) are calculated by applying a set of 1-d functions to each entry of the combined operands element-wise. The 1-d functions are defined by 1-d Gaussian random fields on a regularly spaced grid. The function evaluation is then calculated by linear interpolation between the adjacent grid points. The total support space of the 1-d functions is approximately the interval [-interpolation_range*operand_scale, interpolation_range*operand_scale]. Evaluation points outside these bounds will yield the same as evaluations at the nearest bound.

The mean is then calculated by summing over element-wise function applications for each entry in operands yielding an array with shape result_shape.

For the variances a separate set of 1-d functions is used. Their results are also combined to a operator of shape result_shape, but the reduction function is sum(exp(…)).

The 1-d fields are created as StaticVariables which is placed into the sub-entities mean and log_variance which are in turn placed into an Entity with the provided name. Two StaticVariables are created in each sub-entity: source_field and field. field and source_field are related by a convolution with the provided kernel. field = convolve(source_field, kernel). The fields are of shape (*input_op.shape, *result_shape, length). This means prod((*input_op.shape, *result_shape)) 1-d fields are created.

Parameters:
  • name_prefix (str) – The name prefix for the entities containing the regression parameters. For each variable in outputs, the name to be given to the entity containing the regression parameters, will be named name_prefix + ‘_’ + variable.name.

  • inputs (list, tuple, Operator) – The input operand or operands of the regression.

  • outputs (list, tuple, VariableBase) – The output variable or variables of the regression.

  • inputs_location (optional) – The list of locations for scaling the inputs. These values will be subtracted from the inputs. The default is None (no subtraction).

  • inputs_scale (optional) – The list of scales for scaling the inputs. The inputs will be divided by these values (after subtracting any location parameters). The default is None (no division).

  • outputs_location (optional) – The list of locations for unscaling the outputs. These will be added to the results of the regression (after multiplying by any scale parameter). The default is None (no addition).

  • outputs_scale (optional) – The list of scales for unscaling the outputs. The results of the regression will be multiplied by these values. The default is None (no multiplication).

  • connect_outputs_scale_parameter (bool, str, None, optional) – If True and the outputs’ distribution has a scale parameter (i.e. “variance” or similar), this is also connected to the inputs via regression. This allows one to learn the intrinsic scatter of the outputs as a function of the inputs. If False, the scale parameters of the outputs are left untouched.

  • interpolation_points (int) – The amount of support points to be used for the function fields.

  • interpolation_range (float) –

    The support range of the function field w.r.t the operand scales. The effective support range is the interval [-interpolation_range * op_scale,

    interpolation_range * op_scale * (length/2-1)/(length/2)]

  • kernel_correlation_length (float) – The kernel correlation length. It defines the scale of (auto-)correlation function between the points of the function fields w.r.t. the operand scale. i.e. a kernel_correlation_length of 0.4 means an effective correlation length of operand_scale*0.4.

  • kernel_size (int) – Must be smaller than interpolation_points. The size of the convolution kernel used to apply the correlation structure. Effectively this means the kernel gets truncated after distance (kernel_size-1)/2 grid points.

Returns:

parameters – a list of the entities holding the StaticVariables that define the function fields.

Return type:

List