mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 12:02:38 +02:00
Updated sampling and plots to be correct shape, and changed plotting of sampling to be posterior samples p(f*|f), like it used to be, and samples_y to plot samples of p(y*|y)
This commit is contained in:
parent
6acf5dcfac
commit
ef778f75d4
5 changed files with 41 additions and 29 deletions
|
|
@ -137,7 +137,7 @@ class Poisson(Likelihood):
|
|||
"""
|
||||
return self.gp_link.transf(gp)
|
||||
|
||||
def samples(self, gp, Y_metadata=None, samples=1):
|
||||
def samples(self, gp, Y_metadata=None):
|
||||
"""
|
||||
Returns a set of samples of observations based on a given value of the latent variable.
|
||||
|
||||
|
|
@ -145,5 +145,7 @@ class Poisson(Likelihood):
|
|||
"""
|
||||
orig_shape = gp.shape
|
||||
gp = gp.flatten()
|
||||
Ysim = np.random.poisson(self.gp_link.transf(gp), [samples, gp.size]).T
|
||||
return Ysim.reshape(orig_shape+(samples,))
|
||||
# Ysim = np.random.poisson(self.gp_link.transf(gp), [samples, gp.size]).T
|
||||
# return Ysim.reshape(orig_shape+(samples,))
|
||||
Ysim = np.random.poisson(self.gp_link.transf(gp))
|
||||
return Ysim.reshape(orig_shape)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue