glearn.Covariance.set_sigmas#

Covariance.set_sigmas(sigma, sigma0)#

Sets \(\sigma\) and \(\varsigma\) hyperparameters of the covariance model.

Parameters:
sigmafloat, default=None

The hyperparameter \(\sigma\) of the covariance model where \(\sigma^2\) represents the variance of the correlated errors of the model. \(\sigma\) should be positive. If None is given, an optimal value for \(\sigma\) is found during the training process.

sigma0float, default=None

The hyperparameter \(\varsigma\) of the covariance model where \(\varsigma^2\) represents the variance of the input noise to the model. \(\varsigma\) should be positive. If None is given, an optimal value for \(\varsigma\) is found during the training process.

Notes

Note

After training process when optimal values of the hyperparameters \(\sigma\) and \(\varsigma\) is obtained, this function is automatically called to update these hyperparameters as the attributes of the covariance class.

Examples

Set hyperparameters \(\sigma = 2\) and \(\varsigma = 3\).

>>> # Generate a set of points
>>> from glearn.sample_data import generate_points
>>> x = generate_points(num_points=20, dimension=2)

>>> # Create a covariance object
>>> from glearn import Covariance
>>> cov = Covariance(x, sigma=0.0, sigma0=1.0)
>>> cov.get_sigmas()
(0.0, 1.0)

>>> # Change sigmas
>>> cov.set_sigmas(2.0, 3.0)
>>> cov.get_sigmas()
(2.0, 3.0)