Skip to content

Commit c588d01

Browse files
committed
Add function for using hyperopt found params.
1 parent e3cc303 commit c588d01

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,24 @@ def generate_cut_outs_raw(scan, window_size=48, threshold_distance=np.inf, cente
333333
cut_outs[i,:] = window
334334

335335
return cut_outs
336+
337+
338+
def hyperopt(pred_conf):
339+
ho_wBG = 0.38395839618267696
340+
ho_wWC = 0.599481486880304
341+
ho_wWA = 0.4885948464627302
342+
343+
# Unused
344+
ho_sigma = 2.93
345+
ho_binsz = 0.10
346+
347+
# Compute "optimal" "tight" window-size dependent on blur-size.
348+
ho_blur_win = ho_sigma*5
349+
ho_blur_win = int(2*(ho_blur_win//2)+1) # Make odd
350+
351+
# Weight network outputs
352+
newconf = pred_conf * [ho_wBG, ho_wWC, ho_wWA]
353+
# And re-normalize to get "real" probabilities
354+
newconf /= np.sum(newconf, axis=-1, keepdims=True)
355+
356+
return newconf, {'bin_size': ho_binsz, 'blur_win': ho_blur_win, 'blur_sigma': ho_sigma}

0 commit comments

Comments
 (0)