Skip to content

Commit

Permalink
Merge 0bbc6a2 into 3cb4570
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrine committed Oct 27, 2018
2 parents 3cb4570 + 0bbc6a2 commit 8aa5622
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/source/notebooks/variational_api_quickstart.ipynb
Expand Up @@ -1451,7 +1451,9 @@
"\n",
"Now let's use minibatches. At every iteration, we will draw 500 random values:\n",
"\n",
"> Remember to set `total_size` in observed"
"> Remember to set `total_size` in observed\n",
"\n",
"**total_size** is an important parameter that allows pymc3 to infer the right way of rescaling densities. If it is not set, you are likely to get completely wrong results. For more information please refer to the comprehensive documentation of `pm.Minibatch`."
]
},
{
Expand Down Expand Up @@ -1684,7 +1686,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0b4"
"version": "3.6.3"
}
},
"nbformat": 4,
Expand Down
8 changes: 8 additions & 0 deletions pymc3/data.py
Expand Up @@ -124,6 +124,14 @@ class Minibatch(tt.TensorVariable):
minibatch : minibatch tensor
Used for training
Notes
-----
Below is a common use case of Minibatch within the variational inference.
Importantly, we need to make PyMC3 "aware" of minibatch being used in inference.
Otherwise, we will get wrong :math:`logp` for the model.
To do so, we need to pass total_size parameter to the observed node, which correctly scale
the density of the model logp that effected by Minibatch. See more in examples below.
Examples
--------
Consider we have data
Expand Down

0 comments on commit 8aa5622

Please sign in to comment.