typo: change sample to param
"For example the `scale` parameter of a Normal distribution needs to be positive. Thus the following `bad_guide` is problematic:\n",
"```python\n",
"def bad_guide():\n",
- " scale = pyro.sample(\"scale\", torch.tensor(1.0))\n",
+ " scale = pyro.param(\"scale\", torch.tensor(1.0))\n",
" pyro.sample(\"x\", dist.Normal(0.0, scale))\n",
"``` \n",
"while the following `good_guide` correctly uses a constraint to ensure positivity:\n",
"from pyro.distributions import constraints\n",
"\n",
"def good_guide():\n",
- " scale = pyro.sample(\"scale\", torch.tensor(0.05), \n",
+ " scale = pyro.param(\"scale\", torch.tensor(0.05), \n",
" constraint=constraints.positive)\n",
" pyro.sample(\"x\", dist.Normal(0.0, scale))\n",
"``` "
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.3"
+ "version": "3.8.2"
}
},
"nbformat": 4,
