Skip to content

Remove MOGPR due to unmaintained dependencies #131

@jdries

Description

@jdries

MOGPR depends on a library that has not yet made the transition to numpy2, and indicates that this is non-trivial:
SheffieldML/GPy#1112

Also the GPFlow alternative is pinned numpy<2

Assuming there is no room to support the scikit learn porting, we will be forced to remove mogpr from the next release.

According to AI, GPyTorch is the best alternative which does have maintenance

Code suggested by AI:

import torch
import gpytorch
from gpytorch.models import ExactGP
from gpytorch.kernels import MaternKernel, ScaleKernel, LCMKernel
from gpytorch.likelihoods import MultitaskGaussianLikelihood
from gpytorch.distributions import MultitaskMultivariateNormal


class MultitaskGPModel(ExactGP):
    def __init__(self, train_x, train_y, likelihood, num_tasks):
        super().__init__(train_x, train_y, likelihood)
        self.mean_module = gpytorch.means.MultitaskMean(
            gpytorch.means.ConstantMean(), num_tasks=num_tasks
        )
        # LCM kernel: list of base kernels + coregionalization
        # MaternKernel(nu=1.5) is equivalent to GPy's Matern32
        self.covar_module = LCMKernel(
            base_kernels=[MaternKernel(nu=1.5) for _ in range(num_tasks)],
            num_tasks=num_tasks,
            rank=1,  # equivalent to W_rank=1
        )

    def forward(self, x):
        mean_x = self.mean_module(x)
        covar_x = self.covar_module(x)
        return MultitaskMultivariateNormal(mean_x, covar_x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions