Skip to content

Make leaf-node dispatch extensible#46

Open
SamuelBrand1 wants to merge 1 commit into
probsys:mainfrom
SamuelBrand1:extensible-config
Open

Make leaf-node dispatch extensible#46
SamuelBrand1 wants to merge 1 commit into
probsys:mainfrom
SamuelBrand1:extensible-config

Conversation

@SamuelBrand1

Copy link
Copy Markdown

This PR removes the pattern:

if node_type in [
            config.Constant,
            config.Linear,
            config.SquaredExponential,
            config.GammaExponential,
            config.Periodic,
            ]

which hard-codes the only possible kernels to have as leaf nodes, and replaces with

if NodeType <: GP.LeafNode

Which allows a user to define new <: LeafNode primitive kernels that can be recognised by the covariance_prior generative function.

test/test_extensible_config.jl gives an example of extending GPConfig defaults to give non zero probability of proposing a new leaf kernel with categorical(node_dist).

This PR unblocks #45

@fsaad

fsaad commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the PR, it will be reviewed and integrated for the next release.

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.

2 participants