-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional Density Estimation notebook #40
Conversation
@@ -43,6 +43,7 @@ def motorcycle_data(): | |||
df = pd.read_csv("./data/motor.csv", index_col=0) | |||
X, Y = df["times"].values.reshape(-1, 1), df["accel"].values.reshape(-1, 1) | |||
Y = (Y - Y.mean()) / Y.std() | |||
X /= X.max() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this relevant to the problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rescales inputs between [0,1] instead of the [0,60], which makes the length-scales initialisation to 1 more sensible.
Can you summarise what did you add to fix the issue? |
@vdutor was it intentional that you did not save it as jupytext .py instead of .ipynb format? |
Hi @st-- , yes this notebook takes a little bit too long to generate on the fly. I was thinking that it makes sense to have some precompiled notebooks as well in our documentation to explain some more complicated models rather than keeping it to toy examples. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result is still different comparing to Neil's post. But I guess this is okay, as the perfect match is not possible because of the difference in the modelling.
Overall, LGTM. (check the comments before merging)
docs/notebooks/deep_cde.ipynb
Outdated
"source": [ | ||
"## Deep Gaussian process with latent variables\n", | ||
"\n", | ||
"To tackle the problem we suggest a Deep Gaussian process with a latent variable in the first layer. The latent variable will be able to capture the \n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of word shuffling: "We suggest a Deep Gaussian process with a latent variable in the first layer to improve the error bars on the given dataset. The latent variable allows to model the heteroscedasticity, while an extra layer makes the model more expressive to catch sharp transitions."
"source": [ | ||
"### Latent Variable Layer\n", | ||
"\n", | ||
"This layer concatenates the inputs with a latent variable. See Dutordoir, Salimbeni et al. Conditional Density with Gaussian processes (2018) <cite data-cite=\"dutordoir2018cde\"/> for full details. We choose a one-dimensional input and a full parameterisation for the latent variables. This means that we do not need to train a recognition network, which is useful for fitting but can only be done in the case of small datasets, as is the case here." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a ref [...] instead of the long text?
docs/notebooks/deep_cde.ipynb
Outdated
"source": [ | ||
"### Fit\n", | ||
"\n", | ||
"We can now fit the model. Because of the `DirectlyParameterizedEncoder` it is important to set the batch size to the number of datapoints and turn off shuffle. This is so that we use the associated latent variable for each datapoint. If we would use an Amortized Encoder network this would not be necessary." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"It is important to set the batch size to the number of datapoints and turn off shuffle, checkout DirectlyParameterizedEncoder
for details"? This needs a bit of explanation, what DirectlyParameterizedEncoder
is.
…lux into vincent/notebook/cde
Notebook building and fitting a deep (two layer) latent variable model using VI. No changes to the core of GPflux are required but careful setting of fitting options is necessary. For example, it is important to set
shuffle
toFalse
andbatch_size
to the number of datapoints to have correct optimisation of the latent variables.