glearn.Covariance.get_sigmas#

Covariance.get_sigmas(sigma=None, sigma0=None)#

Returns \(\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

After training process when optimal values of the hyperparameters \(\sigma\) and \(\varsigma\) is obtained, this function can be used to return these hyperparameters.

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)