hyperparameter

MuyGPyS.gp.hyperparameters module reference.

class MuyGPyS.gp.hyperparameter.scalar.ScalarHyperparameter(val, bounds='fixed')[source]

A MuyGPs kernel or model Hyperparameter.

Hyperparameters are defined by a value and optimization bounds. Values must be scalar numeric types, and bounds are either a len == 2 iterable container whose elements are numeric scalars in increasing order, or the string fixed. If bounds == "fixed" (the default behavior), the hyperparameter value will remain fixed during optimization. val must remain within the range of the upper and lower bounds, if not fixed.

Parameters:
  • val (Union[str, float]) – A scalar within the range of the upper and lower bounds (if given). val can also be the strings "sample" or "log_sample", which will result in randomly sampling a value within the range given by the bounds.

  • bounds (Union[str, Tuple[float, float]]) – Iterable container of len 2 containing lower and upper bounds (in that order), or the string "fixed".

Raises:
  • ValueError – Any bounds string other than "fixed" will produce an error.

  • ValueError – A non-iterable non-string type for bounds will produce an error.

  • ValueError – A bounds iterable of len other than 2 will produce an error.

  • ValueError – Iterable bounds values of non-numeric types will produce an error.

  • ValueError – A lower bound that is not less than an upper bound will produce an error.

  • ValueErrorval == "sample" or val == "log_sample" will produce an error if self._bounds == "fixed".

  • ValueError – Any string other than "sample" or "log_sample" will produce an error.

  • ValueError – A val outside of the range specified by self._bounds will produce an error.

__call__()[source]

Value accessor.

Return type:

float

Returns:

The current value of the hyperparameter.

fixed()[source]

Report whether the parameter is fixed, and is to be ignored during optimization.

Return type:

bool

Returns:

True if fixed, False otherwise.

get_bounds()[source]

Bounds accessor.

Return type:

Tuple[float, float]

Returns:

The lower and upper bound tuple.

class MuyGPyS.gp.sigma_sq.SigmaSq(response_count=1)[source]

A \(\sigma^2\) covariance scale parameter.

\(\sigma^2\) is a scaling parameter that one multiplies with the found diagonal variances of a MuyGPyS.gp.muygps.MuyGPS or MuyGPyS.gp.muygps.MultivariateMuyGPS regression in order to obtain the predicted posterior variance. Trained values assume a number of dimensions equal to the number of response dimensions, and correspond to scalar scaling parameters along the corresponding dimensions.

Parameters:

response_count (int) – The integer number of response dimensions.

__call__()[source]

Value accessor.

Return type:

ndarray

Returns:

The current value of the hyperparameter.

property shape: Tuple[int, ...]

Report the shape of the SigmaSq value.

Returns:

The shape of the SigmaSq value.

property trained: bool

Report whether the value has been set.

Returns:

True if trained, False otherwise.