Skip to content

Commit f921cae

Browse files
committed
Revise reset_hn_params and overwrite_h0_params
1 parent 452c28e commit f921cae

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

bayesml/base.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,21 @@ def load_hn_params(self,filename):
257257
+'or ``LearnModel.save_hn_params()``.')
258258
)
259259

260-
@abstractmethod
261260
def reset_hn_params(self):
262-
pass
263-
264-
@abstractmethod
261+
"""Reset the hyperparameters of the posterior distribution to their initial values.
262+
263+
They are reset to the output of `self.get_h0_params()`.
264+
Note that the parameters of the predictive distribution are also calculated from them.
265+
"""
266+
self.set_hn_params(*self.get_h0_params().values())
267+
265268
def overwrite_h0_params(self):
266-
pass
269+
"""Overwrite the initial values of the hyperparameters of the posterior distribution by the learned values.
270+
271+
They are overwitten by the output of `self.get_hn_params()`.
272+
Note that the parameters of the predictive distribution are also calculated from them.
273+
"""
274+
self.set_h0_params(*self.get_hn_params().values())
267275

268276
@abstractmethod
269277
def update_posterior(self):

0 commit comments

Comments
 (0)