Skip to content

Commit 29ecd0f

Browse files
Christopher Fonnesbecktwiecki
authored andcommitted
Fixed output formatting
1 parent 2d2d5a5 commit 29ecd0f

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

pymc3/examples/advi.ipynb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
{
3939
"cell_type": "code",
40-
"execution_count": null,
40+
"execution_count": 3,
4141
"metadata": {
4242
"collapsed": false
4343
},
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"cell_type": "code",
62-
"execution_count": null,
62+
"execution_count": 4,
6363
"metadata": {
6464
"collapsed": false,
6565
"scrolled": false
@@ -69,7 +69,16 @@
6969
"name": "stdout",
7070
"output_type": "stream",
7171
"text": [
72-
" [-----------------83%----------- ] 16758 of 20000 complete in 18.5 sec"
72+
"Iteration 0 [0%]: ELBO = -1372.98\n",
73+
"Iteration 2000 [10%]: ELBO = -294.57\n",
74+
"Iteration 4000 [20%]: ELBO = -193.17\n",
75+
"Iteration 6000 [30%]: ELBO = -166.75\n",
76+
"Iteration 8000 [40%]: ELBO = -156.82\n",
77+
"Iteration 10000 [50%]: ELBO = -154.36\n",
78+
"Iteration 12000 [60%]: ELBO = -152.1\n",
79+
"Iteration 14000 [70%]: ELBO = -151.64\n",
80+
"Iteration 16000 [80%]: ELBO = -151.18\n",
81+
"Iteration 18000 [90%]: ELBO = -151.24\n"
7382
]
7483
}
7584
],
@@ -259,7 +268,7 @@
259268
"name": "python",
260269
"nbconvert_exporter": "python",
261270
"pygments_lexer": "ipython3",
262-
"version": "3.4.3"
271+
"version": "3.5.1"
263272
}
264273
},
265274
"nbformat": 4,

pymc3/variational/advi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def run_adagrad(uw, grad, elbo, inarray, n, learning_rate=.001, epsilon=.1,
7070
uw_i, g, e = f()
7171
elbos[i] = e
7272
if verbose and not i % (n//10):
73-
print('Iteration {0} [{1}%]: ELBO = {2:.2f}'.format(i, 100*i/n, e))
73+
print('Iteration {0} [{1}%]: ELBO = {2}'.format(i, 100*i//n, e.round(2)))
7474

7575
return uw_i, elbos
7676

0 commit comments

Comments
 (0)