mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-02 14:45:15 +02:00
change the behavior the optimize_restarts to keep the original model parameters for the firt run
This commit is contained in:
parent
466b381443
commit
0547177f32
1 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ class Model(Parameterized):
|
|||
jobs = []
|
||||
pool = mp.Pool(processes=num_processes)
|
||||
for i in range(num_restarts):
|
||||
self.randomize()
|
||||
if i>0: self.randomize()
|
||||
job = pool.apply_async(opt_wrapper, args=(self,), kwds=kwargs)
|
||||
jobs.append(job)
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ class Model(Parameterized):
|
|||
for i in range(num_restarts):
|
||||
try:
|
||||
if not parallel:
|
||||
self.randomize()
|
||||
if i>0: self.randomize()
|
||||
self.optimize(**kwargs)
|
||||
else:
|
||||
self.optimization_runs.append(jobs[i].get())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue