From 4a3b18b3a343a9df9aa83d29d986befe0584e349 Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Wed, 25 Sep 2024 11:33:51 +0200 Subject: [PATCH] debug + --- KDEy/kdey_devel.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/KDEy/kdey_devel.py b/KDEy/kdey_devel.py index 0b42c86..a0e3b26 100644 --- a/KDEy/kdey_devel.py +++ b/KDEy/kdey_devel.py @@ -315,10 +315,11 @@ class KDEyMLauto2(KDEyML): return loss_accum - bounds = [tuple((0.0001, np.log10(0.2)))] - init_bandwidth = 0.1 + bounds = [tuple((0.0001, 0.2))] + init_bandwidth = 0.05 r = optimize.minimize(neg_loglikelihood_band_, x0=[init_bandwidth], method='SLSQP', bounds=bounds) best_band = r.x[0] + nit = r.nit else: best_band = None @@ -347,6 +348,7 @@ class KDEyMLauto2(KDEyML): if best_loss_val is None or loss_accum < best_loss_val: best_loss_val = loss_accum 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