mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
added additional needed parameters to to_dict() method for Coregionalize kernel + added _build_from_input dict method
This commit is contained in:
parent
f79144bf47
commit
4c3c2ac755
1 changed files with 10 additions and 0 deletions
|
|
@ -146,6 +146,16 @@ class Coregionalize(Kern):
|
|||
|
||||
input_dict = super(Coregionalize, self)._save_to_input_dict()
|
||||
input_dict["class"] = "GPy.kern.Coregionalize"
|
||||
# W and kappa must be serializable
|
||||
input_dict["W"] = self.W.values.tolist()
|
||||
input_dict["kappa"] = self.kappa.values.tolist()
|
||||
input_dict["output_dim"] = self.output_dim
|
||||
return input_dict
|
||||
|
||||
@staticmethod
|
||||
def _build_from_input_dict(kernel_class, input_dict):
|
||||
useGPU = input_dict.pop('useGPU', None)
|
||||
# W and kappa must be converted back to numpy arrays
|
||||
input_dict['W'] = np.array(input_dict['W'])
|
||||
input_dict['kappa'] = np.array(input_dict['kappa'])
|
||||
return Coregionalize(**input_dict)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue