Skip to content
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

bug: Objectives not being optimised in the right direction #471

Open
huylenguyen opened this issue Aug 29, 2024 · 5 comments
Open

bug: Objectives not being optimised in the right direction #471

huylenguyen opened this issue Aug 29, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@huylenguyen
Copy link

Bug Report

GPJax version:

0.9.0

Current behavior:

The new changes from the previous gpjax.objectives.ConjugateMLL to the new gpjax.objectives.conjugate_mll implementation has removed the negative parameter from the previous superclass gpjax.objectives.AbstractObjective without correctly modifying the new code to negate the MLL. Optimisation of model parameters does not work.

Expected behavior:

Optimisation of model parameters should fit model to data.

Steps to reproduce:

Run the Simple Example on the README.

Related code:

To make optimisation work, we now have to do

opt_posterior, history = gpx.fit(
    model=posterior,
    objective=lambda p, d: -1 * gpx.objectives.conjugate_mll(p, d),
    train_data=D,
    optim=optimiser,
    num_iters=500,
    safe=True,
    key=key,
)

instead of providing gpx.objectives.conjugate_mll to the objective parameter.

Other information:

This also applies to log_posterior_density.

@huylenguyen huylenguyen added the bug Something isn't working label Aug 29, 2024
@thomaspinder
Copy link
Collaborator

Hi @huylenguyen - thanks for catching that the README needs updating. Would you be willing to open a PR to fix the README?

@huylenguyen
Copy link
Author

@thomaspinder Happy to!

@thomaspinder
Copy link
Collaborator

Wonderful! Please add me as a reviewer when the PR is ready.

@miguelgondu
Copy link
Contributor

Hi both,

Small question: has this been incorporated yet?

@thomaspinder
Copy link
Collaborator

Hey @miguelgondu - no, I've not had the chance myself and have not heard anything further on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants