mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
[fix #380] reloading ep
This commit is contained in:
parent
e4d76a133a
commit
61dff6e62b
1 changed files with 8 additions and 0 deletions
|
|
@ -40,6 +40,14 @@ class EPBase(object):
|
||||||
# TODO: update approximation in the end as well? Maybe even with a switch?
|
# TODO: update approximation in the end as well? Maybe even with a switch?
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __setstate__(self, state):
|
||||||
|
super(EPBase, self).__setstate__(state[0])
|
||||||
|
self.epsilon, self.eta, self.delta = state[1]
|
||||||
|
self.reset()
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
return [super(EPBase, self).__getstate__() , [self.epsilon, self.eta, self.delta]]
|
||||||
|
|
||||||
class EP(EPBase, ExactGaussianInference):
|
class EP(EPBase, ExactGaussianInference):
|
||||||
def inference(self, kern, X, likelihood, Y, mean_function=None, Y_metadata=None, precision=None, K=None):
|
def inference(self, kern, X, likelihood, Y, mean_function=None, Y_metadata=None, precision=None, K=None):
|
||||||
if self.always_reset:
|
if self.always_reset:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue