137 questions
0
votes
0
answers
75
views
numpy TypeError with importing GPflow in ipython
I installed GPflow and just tried to import it with ipython. But, I got an error like below.
---------------------------------------------------------------------------
TypeError ...
1
vote
1
answer
47
views
Error when trying to replicate GPflow's Stochastic Variational Inference for Scalability SVGP notebook
I'm learning about Gaussian processes and I'm using GPflow to do some exercises and tests.
I was studying the notebook of Stochastic Variational Inference for scalability with SVGP (https://gpflow....
0
votes
1
answer
60
views
Register Keras neural network weights with GPflow kernel
I am trying to implement a neural kernel function (attentive kernels). The kernel uses a neural network to predict mixture component weights.
Here's my init:
class AttentiveKernel(gpflow.kernels....
0
votes
0
answers
31
views
Unable to import ParamList in GPflow 2.9.0
I am trying to reimplement the following DNN mean function in GPflow 2.9.0:
https://gpflow.readthedocs.io/en/v1.5.1-docs/notebooks/tailor/external-mean-function.html
However, I am unable to import ...
0
votes
1
answer
100
views
Set a prior over a linear mean function in gpflow 2.9.0
I set a prior over a linear mean function in my model in gpflow 2.9.0 but, when I inspect it through the monitor, the prior does not appear.
This is my model:
import gpflow
import numpy as np
import ...
1
vote
1
answer
190
views
How to add "ARD" in gpflow.kernels.RBF()
Regarding documents of GPFlow2.8.1, It looks there is no way to use ARD in gpflow.kernels.RBF(SquaredExponential).
Is it not possible to add ARD settings in RBF?
Following are the current code.(I use ...
0
votes
1
answer
166
views
GPFlow: 'NaturalGradient' object has no attribute '_name'
I was trying to replicate the Heteroskedastic Likelihood and Multi-Latent GP example from the GPFlow library site. Everything ran fine except for the last snippet of code under "Run Optimization ...
-1
votes
1
answer
241
views
The issue of insufficient memory when creating a Gaussian process model due to the excessively large size of the dataset
I was informed that there is not enough memory when creating the following Gaussian process model, and I would like to know if there is a feature in GPflow that allows loading data in batches instead ...
0
votes
1
answer
422
views
How to use a custom loss function in GPfLOW 2?
I am new to GPflow and I am trying to figure out how to write a custom loss function to optimize the model. For my purpose, I need to manipulate the predicted output of the GP through different data ...
0
votes
1
answer
162
views
How to do Hierarchical Heteroskedastic Sparse GPs in GPflow?
Is is possible to model a general trend from a population using GPflow and also have individual predictions, as in Hensman et al?
Specifically, I am trying to fit spatial data from a bunch of ...
1
vote
1
answer
210
views
GPflow 2: VGP model with MOK and multiple-input throws ValueError
I'm following the multi-output kernel notebook of GPflow 2.5.2 documentation. I try to replace the SVGP model by either VGP or GPR model because I have only little data and do not need the sparse ...
1
vote
1
answer
208
views
'GPR' object has no attribute 'X'
I am trying to run the code from https://github.com/befelix/safe_learning/blob/master/examples/1d_example.ipynb . This code is written for gpflow version 0.4.0. I want to update this code for gpflow ...
0
votes
1
answer
124
views
Numerical instabilities when bounding GPFlow hyperparameters
in Bounding hyperparameter optimization with Tensorflow bijector chain in GPflow 2.0, I found an excellent explanation of how to set boundaries to my hyperparameters.
Unfortunately, I noticed that ...
0
votes
0
answers
264
views
Gaussian processes for large data
Can someone please explain what is wrong with this code? I have installed gpflow on an M1 Mac and I am learning Gaussian process (GP) regression. I was trying to run this script found here but keep ...
0
votes
1
answer
241
views
How to add different priors for each of ARD lengthscales hyperparameters in GPflow
I've seen how to add a prior to the lengthscales hyperpameter in the MCMC notebook:
model.kernel.lengthscales.prior = tfd.Gamma(f64(1.0), f64(1.0))
From above, it seems we can only add a prior to a ...
0
votes
1
answer
219
views
Error in prediction formula for GPflow SGPR?
I believe there is an error in the next-to-last equation in this GPflow documentation page. I provide details here. Can this be right?
0
votes
1
answer
49
views
Handling diffferent number of observations at timepoints
I am working with a data set that contains at different number of observations at different time points. For example, at x(0), 2 observations are available while at x(1) 4 observations are available.
...
0
votes
1
answer
354
views
How to get the noise variance from the Stochastic Variational Gaussian Process (SVGP) in GPFlow
As the question states I'm wondering how to get the noise variance (not the signal variance) from the SVGP model in GPFlow.
To clarify, by noise variance I mean the parameter of the Gaussian ...
1
vote
0
answers
316
views
GPFlow model gives bad predictions on test set
Good day!
I was using GPFlow regression to model function on a sphere (spherical distance between point and North Pole). Here is my code:
model = gpflow.models.GPR(data=(nodes_train, fs_train), kernel=...
0
votes
1
answer
219
views
How can I use minibatches with a non-variational GPR in gpflow?
I have tried to adapt the instructions in this documentation to use minibatches for a training a GPR model, but nothing I have tried works. I cannot supply the batch iterator to the ...
2
votes
1
answer
867
views
Is there code or research about Heteroscedastic Gaussian Process in GPflow?
I'm now studying on GP models with heteroscedastic noise, and I want to know if there are codes or notes in GPflow community so I can learn about them. Thanks very much!
0
votes
1
answer
263
views
Is there a way to retrieve the weights from a GPflow GPR model?
Is there a way to retrieve the weights from a GPflow GPR model?
I do not necessarily need the explicit weights. However, I have two issues that may be solved using the weights:
I would like to ...
1
vote
1
answer
425
views
How can I compile batched training of a gpflow GPR into a tf.function?
I need to train a GPR model in multiple batches per epoch using a custom loss function. I would like to do this using GPflow and I would like to compile my training using tf.function to increase the ...
0
votes
1
answer
395
views
GPFlow Multiclass classification with vector inputs causes value error on shape mismatch
I am trying to follow the Multiclass classification in GPFlow (using v2.1.3) as described here:
https://gpflow.readthedocs.io/en/master/notebooks/advanced/multiclass_classification.html
The difference ...
2
votes
0
answers
149
views
Error while using VGP instead of SVGP in Heteroskedastic gpflow example (multilatent GP)
I am trying to understand why I am getting a ValueError when I try to replace SVGP with VGP in the heteroscedastic regression example (https://gpflow.readthedocs.io/en/develop/notebooks/advanced/...
0
votes
1
answer
123
views
Use of priors on hyper-parameters with SVGP model
I wanted to use priors on hyper-parameters as in (https://gpflow.readthedocs.io/en/develop/notebooks/advanced/mcmc.html) but with an SVGP model.
Following the steps of example 1, I got an error when I ...
1
vote
0
answers
84
views
How to create a weighted composite covariance function using GPML toolbox in MATLAB?
I'm trying to create a composite covariance function to model my data. Specifically I want to create a kernel which is weighted between @covSEard & @covRQard. For ex: I want to give a 30% weight ...
1
vote
1
answer
327
views
gpflow classification implementation
I want to implement a binary classification model using Gaussian process. According to the official documentation, I had the code as below.
The X has 2048 features and Y is either 0 or 1. After ...
0
votes
1
answer
293
views
GPflow multi-output change-point
I would like to construct a multi-output GP, whereby the correlation structure between outputs contains a changepoint. The change should only occur in the correlation structure of the Coregion kernel, ...
0
votes
2
answers
493
views
How to write a custom kernel in GPflow for the covariance matrix RBF plus noise only on the main block diagonal?
The required covariance matrix is
where t is 1D time and k={0, 1}
A sample from the kernel should look like:
with the orange sequence corresponding to k=0, and the blue one to k=1.
0
votes
1
answer
442
views
GPflow changepoint
How to find changepoint locations using gpflow.kernels.changepoint. Post fitting a GPR model with this kernel, how to trace it back to actual changepoints in data? Code snippet/pseudo code or any sort ...
0
votes
2
answers
406
views
GPflow2: Multi output kernels (MOK) with partially shared kernels
I have a question regarding multi output kernels in gpflow 2. For the application I am working on, I want to create a independent multi output kernel that shares kernels across some output dimensions ...
0
votes
1
answer
148
views
Questions about Bayesian GP-LVM implementation details
I want to understand how the Bayesian GPLVM implementation works in GPflow, but I am struggling with a few lines of the code. I would greatly appreciate any help me with the following questions:
I ...
1
vote
1
answer
163
views
How can I transfer parameters from one gpflow model to another to gain similar results?
Suppose I have a trained model
m = gpflow.models.SVGP(
likelihood=likelihood, kernel=kernel, inducing_variable=Z, num_data = len(X_train)
)
is it possible to transfer its parameters to another ...
1
vote
1
answer
378
views
GPflow 2 custom kernel construction: fine upon construction, but kernel of size None in optimization
I'm creating some GPflow models in which I need the observations pre and post of a threshold x0 to be independent a priori. I could achieve this with just GP models, or with a ChangePoints kernel with ...
0
votes
1
answer
44
views
How do I profile my code in GPflow2? What happened to dump_timeline and gpflowrc?
I am trying profiling my code in GPflow 2 as I need to know which part of my code consumes the most CPU time. In GPflow 1 there was a gpflowrc file where you could set dump_timeline = True but this ...
0
votes
1
answer
685
views
Why is GPflow's Scipy optimizer incompatible with decorating the optimization step with tf.function?
I am supplying different minibatches to optimize a GPflow model (SVGP). If I decorate the optimization_step with tf.function I get the following error:
NotImplementedError: Cannot convert a symbolic ...
0
votes
0
answers
434
views
AttributeError: 'Tensor' object has no attribute 'ndim' in GPflow
I run the following code to produce a graph where the mean function, the 95% confidence interval and 10 samples from the posterior are plotted as per https://gpflow.readthedocs.io/en/stable/notebooks/...
1
vote
0
answers
292
views
GP regression using Poisson likelihood
I am trying to implement GP regression using Poisson likelihood.
I followed the example in GPy by doing
poisson_likelihood = GPy.likelihoods.Poisson()
laplace_inf = GPy.inference....
-1
votes
1
answer
356
views
Is there a way to define a 'heterogeneous' kernel design to incorporate linear operators into the regression for GPflow (or GPytorch/GPy/...)?
I'm trying to perform a GP regression with linear operators as described in for example this paper by Särkkä: https://users.aalto.fi/~ssarkka/pub/spde.pdf In this example we can see from equation (8) ...
0
votes
1
answer
262
views
gpflow: Non-Independent Multioutput Kernel
I'm trying to implement my own MultioutputKernel (MOK) in gpflow,
however I'm stuck at the Multiple Dispatch for the (Kernel, Inducing Variable) combinations.
According to the docs, the fallback ...
0
votes
1
answer
376
views
Can I specify different kernels for different data types in GPflow?
For my model there are two different types of data. Let us say data of type X1 and data of type X2.
Is it possible to implement different kernels for both data types? So starting from data of type X1, ...
1
vote
1
answer
477
views
Multi-class classification with softmax likelihood
The GPflow docs provide an example for multi-class classification with the robust-max function. I am trying to train a multi-class classifier with the softmax likelihood instead, which is also ...
0
votes
1
answer
478
views
Reshape of Inducing Variables - GPflow
I have an SGPR model:
import numpy as np
import gpflow
X, Y = np.random.randn(50, 2), np.random.randn(50, 1)
Z1 = np.random.randn(13, 2)
k = gpflow.kernels.SquaredExponential()
m = gpflow.models....
1
vote
1
answer
736
views
How to fix some dimensions of a kernel lengthscale in gpflow?
I have a 2d kernel,
k = gpflow.kernels.RBF(lengthscales=[24*5,1e-5])
m = gpflow.models.GPR(data=(X,Y), kernel=k, mean_function=None)
and I want to fix the lengthscale in the 2nd dimension, and just ...
2
votes
1
answer
824
views
Partial derivatives of Gaussian Process wrt features
Given a Gaussian Process Model with multidimensional features and scalar observations, how do I compute derivatives of the output wrt to each input, in GPyTorch or GPFlow (or scikit-learn)?
0
votes
1
answer
423
views
GPFlow multiple independent realizations of same GP, irregular sampling times/lengths
In GPflow I have multiple time series and the sampling times are not aligned across time series, and the time series may have different length (longitudinal data). I assume that they are independent ...
1
vote
2
answers
1k
views
How to build a Gaussian Process regression model for observations that are constrained to be positive [closed]
I'm currently trying to train a GP regression model in GPflow which will predict precipitation values given some meteorological inputs. I'm using a Linear+RBF+WhiteNoise kernel, which seems ...
1
vote
2
answers
679
views
Custom Mean Function Construction for GPFlow Regression
I am trying to pass a custom mean function into GPflow 2.0. I have some (x,y,z) data with several observations for each x,y point. I wanted to pass the average z value for each (x,y) pair as the ...
2
votes
1
answer
350
views
GPflow - Updating Model with new Data
I have trained a model in GPflow and ultimately I would like to take this posterior distribution and use it as the prior in a new instance. I reviewed the docs and couldn't see anything. I did see ...