Skip to content

Extend CRP to Pitman Yor and make hyper-parameters Loom compatible#256

Open
Schaechtle wants to merge 3 commits intozane/hardcode-versionfrom
schaechtle/loom-compatible-parametrization
Open

Extend CRP to Pitman Yor and make hyper-parameters Loom compatible#256
Schaechtle wants to merge 3 commits intozane/hardcode-versionfrom
schaechtle/loom-compatible-parametrization

Conversation

@Schaechtle
Copy link
Collaborator

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.

@Schaechtle Schaechtle requested a review from Joaoloula July 11, 2024 15:39
@fsaad
Copy link
Collaborator

fsaad commented Jul 11, 2024

Use ' for string not ".

Copy link

@Joaoloula Joaoloula left a 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.

if not cu.check_env_debug():
return
assert self.alpha() > 0.
assert self.crp.hypers['alpha'] > 0.

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.

multiprocess=multiprocess,
outputs=outputs,
alpha=1.,
structure_hypers=1.,

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?

X=data,
outputs=outputs,
alpha=1.,
structure_hypers=1.,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants