Repository: GPflow/GPflow

Issue:
Some documentation still treats kernels as if they have an input_dim parameter
In the notebook ["Multi-output Gaussian processes in GPflow"](https://gpflow.readthedocs.io/en/develop/notebooks/advanced/multioutput.html), there are Python statements like the following, where the initializers of kernels each have an integer argument:

```python
kernel = gpf.kernels.SharedIndependent(gpf.kernels.RBF(1) + gpf.kernels.Linear(1), output_dim=P)
kern_list = [gpf.kernels.RBF(D) + gpf.kernels.Linear(1) for _ in range(P)]
kern_list = [gpf.kernels.RBF(D) + gpf.kernels.Linear(D) for _ in range(L)]
```

Judging from the definition of `D`, it looks like those integer arguments are meant to be the `input_dim` arguments for the kernel initializers, but those arguments [no longer exist](https://gpflow.readthedocs.io/en/develop/notebooks/gpflow2_upgrade_guide.html#Kernel-Input-Dims).

I don't know if this problem occurs in other notebooks, but it wouldn't surprise me.


Discussion:
Oufffff. Good catch! It was a huge effort porting all the notebooks across, and I wish we hadn't missed this one - but thanks for spotting it now! Would you like to help us out & contribute by fixing the notebook & opening a pull request ? Happy to help you out with the details if you like. We also have a Slack workspace at https://gpflow.slack.com if you'd want to join the chat! (Invite link in the README.md)
I can't promise that I'll have the time to do that, unfortunately.
> I can't promise that I'll have the time to do that, unfortunately.

That's okay - if you don't manage to do it hopefully someone else will get to it at some point!

Resolving patch:
diff --git a/doc/source/notebooks/advanced/changepoints.pct.py b/doc/source/notebooks/advanced/changepoints.pct.py
--- a/doc/source/notebooks/advanced/changepoints.pct.py
+++ b/doc/source/notebooks/advanced/changepoints.pct.py
@@ -63,7 +63,7 @@ def plotkernelsample(k, ax, xmin=-3, xmax=3, title=None):
 np.random.seed(3)
 
 base_k1 = gpflow.kernels.Matern32(lengthscales=0.3)
-base_k2 = gpflow.kernels.Constant(1)
+base_k2 = gpflow.kernels.Constant()
 k = gpflow.kernels.ChangePoints([base_k1, base_k2, base_k1], locations=[-1, 1], steepness=10.0)
 
 f, ax = plt.subplots(1, 1, figsize=(10, 3))
diff --git a/doc/source/notebooks/advanced/multioutput.pct.py b/doc/source/notebooks/advanced/multioutput.pct.py
--- a/doc/source/notebooks/advanced/multioutput.pct.py
+++ b/doc/source/notebooks/advanced/multioutput.pct.py
@@ -168,7 +168,9 @@ def plot_model(m, lower=-8.0, upper=8.0):
 
 # %%
 # create multi-output kernel
-kernel = gpf.kernels.SharedIndependent(gpf.kernels.RBF(1) + gpf.kernels.Linear(1), output_dim=P)
+kernel = gpf.kernels.SharedIndependent(
+    gpf.kernels.SquaredExponential() + gpf.kernels.Linear(), output_dim=P
+)
 # initialization of inducing input locations (M random points from the training inputs)
 Z = Zinit.copy()
 # create multi-output inducing variables from Z
@@ -212,7 +214,7 @@ def optimize_model_with_scipy(model):
 
 # %%
 # Create list of kernels for each output
-kern_list = [gpf.kernels.RBF(D) + gpf.kernels.Linear(1) for _ in range(P)]
+kern_list = [gpf.kernels.SquaredExponential() + gpf.kernels.Linear() for _ in range(P)]
 # Create multi-output kernel from kernel list
 kernel = gpf.kernels.SeparateIndependent(kern_list)
 # initialization of inducing input locations (M random points from the training inputs)
@@ -244,7 +246,7 @@ def optimize_model_with_scipy(model):
 
 # %%
 # Create list of kernels for each output
-kern_list = [gpf.kernels.RBF(D) + gpf.kernels.Linear(1) for _ in range(P)]
+kern_list = [gpf.kernels.SquaredExponential() + gpf.kernels.Linear() for _ in range(P)]
 # Create multi-output kernel from kernel list
 kernel = gpf.kernels.SeparateIndependent(kern_list)
 # initialization of inducing input locations, one set of locations per output
@@ -298,7 +300,7 @@ def optimize_model_with_scipy(model):
 
 # %%
 # Create list of kernels for each output
-kern_list = [gpf.kernels.RBF(D) + gpf.kernels.Linear(D) for _ in range(L)]
+kern_list = [gpf.kernels.SquaredExponential() + gpf.kernels.Linear() for _ in range(L)]
 # Create multi-output kernel from kernel list
 kernel = gpf.kernels.LinearCoregionalization(
     kern_list, W=np.random.randn(P, L)


Test patch: