mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
new: added to_dict() method to MixedNoise likelihood class
This commit is contained in:
parent
ba050dabfb
commit
fcb43ce5dd
1 changed files with 19 additions and 0 deletions
|
|
@ -80,3 +80,22 @@ class MixedNoise(Likelihood):
|
|||
_ysim = np.array([np.random.normal(lik.gp_link.transf(gpj), scale=np.sqrt(lik.variance), size=1) for gpj in gp_filtered.flatten()])
|
||||
Ysim[flt,:] = _ysim.reshape(n1,N2)
|
||||
return Ysim
|
||||
|
||||
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(MixedNoise, self)._save_to_input_dict()
|
||||
input_dict = {}
|
||||
input_dict["name"] = self.name
|
||||
input_dict["class"] = "GPy.likelihoods.MixedNoise"
|
||||
input_dict["likelihood_list"] = {}
|
||||
for ii in range(len(self.likelihoods_list)):
|
||||
input_dict["likelihood_list"][ii] = self.likelihoods_list[ii].to_dict()
|
||||
|
||||
return input_dict
|
||||
Loading…
Add table
Add a link
Reference in a new issue