debug +
This commit is contained in:
parent
ac4f81918e
commit
4a3b18b3a3
|
@ -315,10 +315,11 @@ class KDEyMLauto2(KDEyML):
|
||||||
|
|
||||||
return loss_accum
|
return loss_accum
|
||||||
|
|
||||||
bounds = [tuple((0.0001, np.log10(0.2)))]
|
bounds = [tuple((0.0001, 0.2))]
|
||||||
init_bandwidth = 0.1
|
init_bandwidth = 0.05
|
||||||
r = optimize.minimize(neg_loglikelihood_band_, x0=[init_bandwidth], method='SLSQP', bounds=bounds)
|
r = optimize.minimize(neg_loglikelihood_band_, x0=[init_bandwidth], method='SLSQP', bounds=bounds)
|
||||||
best_band = r.x[0]
|
best_band = r.x[0]
|
||||||
|
nit = r.nit
|
||||||
|
|
||||||
else:
|
else:
|
||||||
best_band = None
|
best_band = None
|
||||||
|
@ -347,6 +348,7 @@ class KDEyMLauto2(KDEyML):
|
||||||
if best_loss_val is None or loss_accum < best_loss_val:
|
if best_loss_val is None or loss_accum < best_loss_val:
|
||||||
best_loss_val = loss_accum
|
best_loss_val = loss_accum
|
||||||
best_band = bandwidth
|
best_band = bandwidth
|
||||||
|
nit=20
|
||||||
|
|
||||||
print(f'found bandwidth={best_band:.4f}') # (loss_val={best_loss_val:.5f})')
|
print(f'found bandwidth={best_band:.4f} after {nit=} iterations') # (loss_val={best_loss_val:.5f})')
|
||||||
self.bandwidth_ = best_band
|
self.bandwidth_ = best_band
|
||||||
|
|
Loading…
Reference in New Issue