-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels