mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-02 14:45:15 +02:00
Merge branch 'devel' of github.com:SheffieldML/GPy into devel
This commit is contained in:
commit
fc579917b9
1 changed files with 6 additions and 4 deletions
|
|
@ -84,18 +84,20 @@ class VerboseOptimization(object):
|
||||||
|
|
||||||
def print_out(self, seconds):
|
def print_out(self, seconds):
|
||||||
if seconds<60:
|
if seconds<60:
|
||||||
self.timestring = "{:0>5.2f}".format(seconds)
|
ms = (seconds%1)*100
|
||||||
|
self.timestring = "{s:0>2d}s{ms:0>2d}".format(s=int(seconds), ms=int(ms))
|
||||||
else:
|
else:
|
||||||
m, s = divmod(seconds, 60)
|
m, s = divmod(seconds, 60)
|
||||||
if m>59:
|
if m>59:
|
||||||
h, m = divmod(m, 60)
|
h, m = divmod(m, 60)
|
||||||
if h>23:
|
if h>23:
|
||||||
d, h = divmod(h, 24)
|
d, h = divmod(h, 24)
|
||||||
self.timestring = '{d:0>2d}/{h:0>2d}:{m:0>2d}'.format(m=int(m), h=int(h), d=int(d))
|
self.timestring = '{d:0>2d}d{h:0>2d}h{m:0>2d}'.format(m=int(m), h=int(h), d=int(d))
|
||||||
else:
|
else:
|
||||||
self.timestring = '{h:0>2d}:{m:0>2d}:{s:0>2d}'.format(m=int(m), s=int(s), h=int(h))
|
self.timestring = '{h:0>2d}h{m:0>2d}m{s:0>2d}'.format(m=int(m), s=int(s), h=int(h))
|
||||||
else:
|
else:
|
||||||
self.timestring = '{m:0>2d}:{s:0>5.2f}'.format(m=int(m), s=s)
|
ms = (seconds%1)*100
|
||||||
|
self.timestring = '{m:0>2d}m{s:0>2d}s{ms:0>2d}'.format(m=int(m), s=int(s), ms=int(ms))
|
||||||
if self.ipython_notebook:
|
if self.ipython_notebook:
|
||||||
names_vals = [['optimizer', "{:s}".format(self.opt_name)],
|
names_vals = [['optimizer', "{:s}".format(self.opt_name)],
|
||||||
['runtime', "{:>s}".format(self.timestring)],
|
['runtime', "{:>s}".format(self.timestring)],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue