Added copyrights and documentation to new models and kernels

This commit is contained in:
Siivola Eero 2018-09-05 17:58:44 +03:00
parent 9a6e645bc6
commit ee7f23869b
4 changed files with 23 additions and 13 deletions

View file

@ -1,9 +1,19 @@
# Copyright (c) 2018, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .kern import CombinationKernel
import numpy as np
from paramz.caching import Cache_this
# A thin wrapper around the base kernel to tell that we are dealing with a partial derivative of a Kernel
class DiffKern(CombinationKernel):
"""
Diff kernel is a thin wrapper for using partial derivatives of kernels as kernels. Eg. in combination with
Multioutput kernel this allows the user to train GPs with observations of latent function and latent
function derivatives
The parameters the kernel needs are:
-'base_kern': a member of Kernel class that is used for observations
-'dimension': integer that indigates in which dimensions the partial derivative observations are
"""
def __init__(self, base_kern, dimension):
super(DiffKern, self).__init__([base_kern], 'DiffKern')
self.base_kern = base_kern

View file

@ -1,3 +1,6 @@
# Copyright (c) 2018, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .kern import Kern, CombinationKernel
from .multioutput_kern import MultioutputKern, ZeroKern
import numpy as np

View file

@ -1,3 +1,6 @@
# Copyright (c) 2018, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
from .kern import Kern, CombinationKernel
import numpy as np
from functools import reduce, partial

View file

@ -22,19 +22,13 @@ logger = logging.getLogger("GP")
class MultioutputGP(GP):
"""
General purpose Gaussian process model
:param X: input observations
:param Y: output observations
:param kernel: a GPy kernel, defaults to rbf+white
:param likelihood: a GPy likelihood
Gaussian process model for using observations from multiple likelihoods and different kernels
:param X_list: input observations in a list for each likelihood
:param Y: output observations in a list for each likelihood
:param kernel_list: kernels in a list for each likelihood
:param likelihood_list: likelihoods in a list
:param kernel_cross_covariances: Cross covariances between different likelihoods. See class MultioutputKern for more
:param inference_method: The :class:`~GPy.inference.latent_function_inference.LatentFunctionInference` inference method to use for this GP
:rtype: model object
:param Norm normalizer:
normalize the outputs Y.
Prediction will be un-normalized using this normalizer.
If normalizer is None, we will normalize using Standardize.
If normalizer is False, no normalization will be done.
.. Note:: Multiple independent outputs are allowed using columns of Y
"""
def __init__(self, X_list, Y_list, kernel_list, likelihood_list, name='multioutputgp', kernel_cross_covariances={}, inference_method=None):
#Input and Output