Skip to content

Commit

Permalink
Update brownian.py
Browse files Browse the repository at this point in the history
added to_dict method
  • Loading branch information
jopago authored Jan 13, 2019
1 parent b503c71 commit 400a488
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions GPy/kern/src/brownian.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ def __init__(self, input_dim=1, variance=1., active_dims=None, name='Brownian'):

self.variance = Param('variance', variance, Logexp())
self.link_parameters(self.variance)

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(RBF, self)._save_to_input_dict()
input_dict["class"] = "GPy.kern.Brownian"
return input_dict

def K(self,X,X2=None):
if X2 is None:
Expand Down

0 comments on commit 400a488

Please sign in to comment.