File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 1310
1310
"source": [
1311
1311
"with model:\n",
1312
1312
" # We'll use SVGD\n",
1313
- " # So creating empirical approximation in advance is a good decision\n",
1314
- " approx = pm.Empirical.from_noise(size=500, jitter=1)\n",
1313
+ " inference = pm.SVGD(n_particles=500, jitter=1)\n",
1314
+ " # shortcut reference to approximation\n",
1315
+ " approx = inference.approx\n",
1315
1316
" # Here we need `more_replacements` to change train_set to test_set\n",
1316
1317
" test_probs = approx.sample_node(z, more_replacements={\n",
1317
1318
" Xt: X_test\n",
1342
1343
"train_accuracy = train_ok.mean(-1)"
1343
1344
]
1344
1345
},
1345
- {
1346
- "cell_type": "code",
1347
- "execution_count": 56,
1348
- "metadata": {
1349
- "collapsed": true
1350
- },
1351
- "outputs": [],
1352
- "source": [
1353
- "inference = pm.SVGD(histogram=approx)"
1354
- ]
1355
- },
1356
1346
{
1357
1347
"cell_type": "markdown",
1358
1348
"metadata": {},
You can’t perform that action at this time.
0 commit comments