diff --git a/GPy/kern/src/coregionalize.py b/GPy/kern/src/coregionalize.py index d5111c3b..41ddf841 100644 --- a/GPy/kern/src/coregionalize.py +++ b/GPy/kern/src/coregionalize.py @@ -134,3 +134,18 @@ class Coregionalize(Kern): def gradients_X_diag(self, dL_dKdiag, X): return np.zeros(X.shape) + + def to_dict(self): + """ + Convert the object into a json serializable dictionary. + + Note: It uses the private method _save_to_input_dict of the parent. + + :return dict: json serializable dictionary containing the needed information to instantiate the object + """ + + input_dict = super(Coregionalize, self)._save_to_input_dict() + input_dict["class"] = "GPy.kern.Coregionalize" + input_dict["W"] = self.W.values.tolist() + input_dict["kappa"] = self.kappa.values.tolist() + return input_dict