Skip to content

Commit 27f663d

Browse files
authored
Merge pull request #1542 from ColCarroll/scientific_notation
ADVI uses scientific notation for greater than 5 digits.
2 parents ff28eff + e672ee9 commit 27f663d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pymc3/variational/advi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ def advi(vars=None, start=None, model=None, n=5000, accurate_elbo=False,
148148
elbos[i] = e
149149
if i % (n // 10) == 0 and i > 0:
150150
avg_elbo = elbos[i - n // 10:i].mean()
151-
progress.set_description('Average ELBO = {:,.2f}'.format(avg_elbo))
151+
progress.set_description('Average ELBO = {:,.5g}'.format(avg_elbo))
152152
except KeyboardInterrupt:
153153
elbos = elbos[:i]
154154
avg_elbo = elbos[i - n // 10:].mean()
155-
pm._log.info('Interrupted at {:,d} [{:.0f}%]: Average ELBO = {:,.2f}'.format(
155+
pm._log.info('Interrupted at {:,d} [{:.0f}%]: Average ELBO = {:,.5g}'.format(
156156
i, 100 * i // n, avg_elbo))
157157
else:
158158
avg_elbo = elbos[-n // 10:].mean()
159-
pm._log.info('Finished [100%]: Average ELBO = {:,.2f}'.format(avg_elbo))
159+
pm._log.info('Finished [100%]: Average ELBO = {:,.5g}'.format(avg_elbo))
160160

161161
# Estimated parameters
162162
l = int(uw_i.size / 2)

0 commit comments

Comments
 (0)