Skip to content

Revise reset_hn_params and overwrite_h0_params #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions bayesml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,21 @@ def load_hn_params(self,filename):
+'or ``LearnModel.save_hn_params()``.')
)

@abstractmethod
def reset_hn_params(self):
pass

@abstractmethod
"""Reset the hyperparameters of the posterior distribution to their initial values.

They are reset to the output of `self.get_h0_params()`.
Note that the parameters of the predictive distribution are also calculated from them.
"""
self.set_hn_params(*self.get_h0_params().values())

def overwrite_h0_params(self):
pass
"""Overwrite the initial values of the hyperparameters of the posterior distribution by the learned values.

They are overwitten by the output of `self.get_hn_params()`.
Note that the parameters of the predictive distribution are also calculated from them.
"""
self.set_h0_params(*self.get_hn_params().values())

@abstractmethod
def update_posterior(self):
Expand Down