mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-27 14:25:16 +02:00
[progress] show progress of optimization using optimize(itpython_notebook=True)
This commit is contained in:
parent
1c6cef44b6
commit
17f42768da
1 changed files with 3 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ def exponents(fnow, current_grad):
|
||||||
class VerboseOptimization(object):
|
class VerboseOptimization(object):
|
||||||
def __init__(self, model, opt, maxiters, verbose=True, current_iteration=0, ipython_notebook=False):
|
def __init__(self, model, opt, maxiters, verbose=True, current_iteration=0, ipython_notebook=False):
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
if self.verbose:
|
if self.verbose or ipython_notebook:
|
||||||
self.model = model
|
self.model = model
|
||||||
self.iteration = current_iteration
|
self.iteration = current_iteration
|
||||||
self.ipython_notebook = ipython_notebook
|
self.ipython_notebook = ipython_notebook
|
||||||
|
|
@ -129,7 +129,7 @@ class VerboseOptimization(object):
|
||||||
self.current_gradient = np.nan
|
self.current_gradient = np.nan
|
||||||
|
|
||||||
def __exit__(self, type, value, traceback):
|
def __exit__(self, type, value, traceback):
|
||||||
if self.verbose:
|
if self.verbose or self.ipython_notebook:
|
||||||
self.model.remove_observer(self)
|
self.model.remove_observer(self)
|
||||||
self.stop = time.time()
|
self.stop = time.time()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue