-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extend CRP to Pitman Yor and make hyper-parameters Loom compatible #256
base: zane/hardcode-version
Are you sure you want to change the base?
Extend CRP to Pitman Yor and make hyper-parameters Loom compatible #256
Conversation
This is taking code from Joao's branch - and modifies it so all tests pass.
Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, barring the structure_hypers=scalar in the tests.
@@ -1332,7 +1259,7 @@ def hypothetical(self, rowid): | |||
def _check_partitions(self): | |||
if not cu.check_env_debug(): | |||
return | |||
assert self.alpha() > 0. | |||
assert self.crp.hypers['alpha'] > 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to also check that the discount is between 0 and 1 (optionally, you could change the alpha check to the more permissive > -discount, even though given cgpm and loom's grid, we'll never enter the negative regime.
@@ -315,11 +315,11 @@ def gen_simple_engine(multiprocess=1): | |||
rng=gu.gen_rng(1), | |||
multiprocess=multiprocess, | |||
outputs=outputs, | |||
alpha=1., | |||
structure_hypers=1., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a dict with alpha and discount as keys?
@@ -331,11 +331,11 @@ def gen_simple_state(): | |||
state = State( | |||
X=data, | |||
outputs=outputs, | |||
alpha=1., | |||
structure_hypers=1., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
What does this do?
Extends the CRP to a Pitman-Yor Process and uses Loom-style hyper-parameter grids for inference; using and modifying code from this branch but ensuring all tests pass again.
Why do we want this?
We're using CGPM in combination with Loom for structure learning. Here we use for initial inference CGPM for clean-up with fully Bayesian inference. Currently, that process is wasteful because we discard all hyper-parameters.
How was this tested?
The test suite was modified so that all CRP tests pass for Pitman-Yor with discount parameter = 0.
This PR is best-reviewed commit-by-commit.