mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-05 14:55:15 +02:00
pickling for Bayesian_GPLVM simplified
This commit is contained in:
parent
03933f9604
commit
db58239063
1 changed files with 46 additions and 37 deletions
|
|
@ -37,6 +37,7 @@ class Bayesian_GPLVM(sparse_GP, GPLVM):
|
||||||
|
|
||||||
if X == None:
|
if X == None:
|
||||||
X = self.initialise_latent(init, Q, likelihood.Y)
|
X = self.initialise_latent(init, Q, likelihood.Y)
|
||||||
|
self.init = init
|
||||||
|
|
||||||
if X_variance is None:
|
if X_variance is None:
|
||||||
X_variance = np.clip((np.ones_like(X) * 0.5) + .01 * np.random.randn(*X.shape), 0.001, 1)
|
X_variance = np.clip((np.ones_like(X) * 0.5) + .01 * np.random.randn(*X.shape), 0.001, 1)
|
||||||
|
|
@ -262,6 +263,14 @@ class Bayesian_GPLVM(sparse_GP, GPLVM):
|
||||||
fig.tight_layout(h_pad=.01) # , rect=(0, 0, 1, .95))
|
fig.tight_layout(h_pad=.01) # , rect=(0, 0, 1, .95))
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
return (self.likelihood, self.Q, self.X, self.X_variance,
|
||||||
|
self.init, self.M, self.Z, self.kern,
|
||||||
|
self.oldpsave, self._debug)
|
||||||
|
|
||||||
|
def __setstate__(self, state):
|
||||||
|
self.__init__(*state)
|
||||||
|
|
||||||
def _debug_filter_params(self, x):
|
def _debug_filter_params(self, x):
|
||||||
start, end = 0, self.X.size,
|
start, end = 0, self.X.size,
|
||||||
X = x[start:end].reshape(self.N, self.Q)
|
X = x[start:end].reshape(self.N, self.Q)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue