Hi @fritzo, for this particular model, it will be achieved if we support
mean_function for GP models (currently GP module in Pyro assumes mean_function is 0). I will implement it soon if you only need this way.
About combining GP model with another model (to train at the same time), I guess we can use
def model(x, y):
a = pyro.param("a", torch.tensor(0.0))
b = pyro.param("b", torch.tensor(1.0))
trend = a * x + b
residual = y - trend
def guide(x, y):
For the syntax
pyro.sample("residual", residual_model, obs=residual), did you want to make your GP model a distribution? I can't find a good solution for it. We might be able to do so by separating the likelihood from
.model(), then the syntax will like
f = residual_model.model(x)
pyro.sample("residual", residual_model.likelihood(f), obs=residual)
If you want this way, I will think how to design again the current GP module.