mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-11 15:15:15 +02:00
New likelihood: HeteroscedasticGaussian
This commit is contained in:
parent
7a5872e11d
commit
f780693577
2 changed files with 4 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from .bernoulli import Bernoulli
|
||||
from .exponential import Exponential
|
||||
from .gaussian import Gaussian
|
||||
from .gaussian import HeteroscedasticGaussian
|
||||
from .gamma import Gamma
|
||||
from .poisson import Poisson
|
||||
from .student_t import StudentT
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ class Gaussian(Likelihood):
|
|||
dF_dtheta = -0.5/lik_var + 0.5*(np.square(Y) + np.square(m) + v - 2*m*Y)/(lik_var**2)
|
||||
return F, dF_dmu, dF_dv, dF_dtheta.reshape(1, Y.shape[0], Y.shape[1])
|
||||
|
||||
class Heteroscedastic_Gaussian(Gaussian):
|
||||
class HeteroscedasticGaussian(Gaussian):
|
||||
def __init__(self, Y_metadata, gp_link=None, variance=1., name='het_Gauss'):
|
||||
if gp_link is None:
|
||||
gp_link = link_functions.Identity()
|
||||
|
|
@ -335,7 +335,7 @@ class Heteroscedastic_Gaussian(Gaussian):
|
|||
print("Warning, Exact inference is not implemeted for non-identity link functions,\
|
||||
if you are not already, ensure Laplace inference_method is used")
|
||||
|
||||
super(Heteroscedastic_Gaussian, self).__init__(gp_link, np.ones(Y_metadata['output_index'].shape[0])*variance, name)
|
||||
super(HeteroscedasticGaussian, self).__init__(gp_link, np.ones(Y_metadata['output_index'].shape[0])*variance, name)
|
||||
|
||||
def exact_inference_gradients(self, dL_dKdiag,Y_metadata=None):
|
||||
return dL_dKdiag[Y_metadata['output_index']][:,0]
|
||||
|
|
@ -351,4 +351,4 @@ class Heteroscedastic_Gaussian(Gaussian):
|
|||
var += np.atleast_3d(np.eye(var.shape[0])*self.variance)
|
||||
else:
|
||||
var += self.variance
|
||||
return mu, var
|
||||
return mu, var
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue