mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-23 15:48:09 +02:00
add new inference X
This commit is contained in:
parent
78be1464be
commit
78b50db138
3 changed files with 149 additions and 0 deletions
|
|
@ -94,6 +94,9 @@ class VariationalPosterior(Parameterized):
|
|||
if self.has_uncertain_inputs():
|
||||
assert self.variance.shape == self.mean.shape, "need one variance per sample and dimenion"
|
||||
|
||||
def set_gradients(self, grad):
|
||||
self.mean.gradient, self.variance.gradient = grad
|
||||
|
||||
def _raveled_index(self):
|
||||
index = np.empty(dtype=int, shape=0)
|
||||
size = 0
|
||||
|
|
@ -158,6 +161,9 @@ class SpikeAndSlabPosterior(VariationalPosterior):
|
|||
self.gamma = Param("binary_prob",binary_prob, Logistic(1e-10,1.-1e-10))
|
||||
self.link_parameter(self.gamma)
|
||||
|
||||
def set_gradients(self, grad):
|
||||
self.mean.gradient, self.variance.gradient, self.gamma.gradient = grad
|
||||
|
||||
def __getitem__(self, s):
|
||||
if isinstance(s, (int, slice, tuple, list, np.ndarray)):
|
||||
import copy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue