# Inferences for Deep Gaussian Process models in Pyro

In this tutorial, I want to illustrate how to use Pyro's Gaussian Processes module to create and train some deep Gaussian Process models. For the background on how to use this module, readers can check out some tutorials at http://pyro.ai/examples/.

The first part is a fun example to run HMC with a 2-layer regression GP models while the second part uses SVI to classify digit numbers.

```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns; sns.set()
from scipy.cluster.vq import kmeans2
import torch
import torch.nn as nn
from torch.distributions.transforms import AffineTransform
from torchvision import transforms
import pyro
import pyro.contrib.gp as gp
import pyro.distributions as dist
import pyro.infer as infer
import pyro.infer.mcmc as mcmc
from pyro.contrib import autoname
from pyro.contrib.examples.util import get_data_loader
pyro.set_rng_seed(0)
```

### HMC with Heaviside data¶

Let's create a dataset from Heaviside step function.

```
N = 25
X = torch.rand(N)
y = (X >= 0.5).float() + torch.randn(N) * 0.01
plt.plot(X.numpy(), y.numpy(), "kx");
```

We will make a 2-layer regression model. We use the decorator `name_count`

to avoid the conflict of parameter names from two layers.