Skip to content

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

@huylenguyen

Description

@huylenguyen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions