Skip to content

Commit e8da421

Browse files
ferrinetaku-y
authored andcommitted
fix notebooks' comments following @taku-y recommendations
1 parent 55b99a9 commit e8da421

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

docs/source/notebooks/convolutional_vae_keras_advi.ipynb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
{
3434
"cell_type": "code",
3535
"execution_count": 1,
36-
"metadata": {},
36+
"metadata": {
37+
"collapsed": true
38+
},
3739
"outputs": [],
3840
"source": [
3941
"#!pip install --upgrade keras\n",
@@ -107,7 +109,6 @@
107109
"from keras.layers import InputLayer, BatchNormalization, Dense, Conv2D, Deconv2D, Activation, Flatten, Reshape\n",
108110
"import numpy as np\n",
109111
"import pymc3 as pm\n",
110-
"from pymc3.variational import advi_minibatch\n",
111112
"from theano import shared, config, function, clone, pp\n",
112113
"import theano.tensor as tt\n",
113114
"import keras\n",
@@ -189,7 +190,9 @@
189190
{
190191
"cell_type": "code",
191192
"execution_count": 5,
192-
"metadata": {},
193+
"metadata": {
194+
"collapsed": true
195+
},
193196
"outputs": [],
194197
"source": [
195198
"from keras.models import Sequential\n",
@@ -532,7 +535,9 @@
532535
{
533536
"cell_type": "code",
534537
"execution_count": 44,
535-
"metadata": {},
538+
"metadata": {
539+
"collapsed": true
540+
},
536541
"outputs": [],
537542
"source": [
538543
"with pm.Model() as model:\n",
@@ -758,7 +763,7 @@
758763
"name": "python",
759764
"nbconvert_exporter": "python",
760765
"pygments_lexer": "ipython3",
761-
"version": "3.6.1"
766+
"version": "3.6.0"
762767
},
763768
"latex_envs": {
764769
"bibliofile": "biblio.bib",

docs/source/notebooks/lda-advi-aevb.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@
231231
{
232232
"cell_type": "code",
233233
"execution_count": 6,
234-
"metadata": {},
234+
"metadata": {
235+
"collapsed": true
236+
},
235237
"outputs": [],
236238
"source": [
237239
"n_topics = 10\n",
@@ -256,7 +258,7 @@
256258
"metadata": {},
257259
"source": [
258260
"## Encoder\n",
259-
"Given a document, the encoder calculates variational parameters of the (transformed) latent variables, more specifically, parameters of Gaussian distributions in the unconstrained real coordinate space. The `encode()` method is required to output variational means and stds as a tuple, as shown in the following code. As explained above, the number of variational parameters is `2 * (n_topics) - 1`. Specifically, the shape of `zs_mean` (or `zs_std`) in the method is `(minibatch_size, n_topics - 1)`. It should be noted that `zs_std` is defined as log-transformed standard deviation and this is automativally exponentiated (thus bounded to be positive) in `advi_minibatch()`, the estimation function. \n",
261+
"Given a document, the encoder calculates variational parameters of the (transformed) latent variables, more specifically, parameters of Gaussian distributions in the unconstrained real coordinate space. The `encode()` method is required to output variational means and stds as a tuple, as shown in the following code. As explained above, the number of variational parameters is `2 * (n_topics) - 1`. Specifically, the shape of `zs_mean` (or `zs_std`) in the method is `(minibatch_size, n_topics - 1)`. It should be noted that `zs_std` is defined as $\\rho = log(exp(std) - 1)$ in `ADVI` and bounded to be positive. The inverse parametrization is $std = log(1+exp(\\rho))$ and considered to be numericaly stable.\n",
260262
"\n",
261263
"To enhance generalization ability to unseen words, a bernoulli corruption process is applied to the inputted documents. Unfortunately, I have never see any significant improvement with this. "
262264
]
@@ -724,7 +726,7 @@
724726
"name": "python",
725727
"nbconvert_exporter": "python",
726728
"pygments_lexer": "ipython3",
727-
"version": "3.6.1"
729+
"version": "3.6.0"
728730
},
729731
"latex_envs": {
730732
"bibliofile": "biblio.bib",

0 commit comments

Comments
 (0)