mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-13 05:52:38 +02:00
prevent the predicted variance to be negative
This commit is contained in:
parent
51a4e881da
commit
d01545c92b
1 changed files with 2 additions and 0 deletions
|
|
@ -209,6 +209,8 @@ class GP(Model):
|
|||
var = Kxx - np.sum(WiKx*Kx, 0)
|
||||
var = var.reshape(-1, 1)
|
||||
|
||||
var[var<0.] = 0.
|
||||
|
||||
#force mu to be a column vector
|
||||
if len(mu.shape)==1: mu = mu[:,None]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue