From 438148edf7dc70380b1b6999b620e2ab576f58e7 Mon Sep 17 00:00:00 2001 From: Manos Date: Tue, 5 Oct 2021 05:16:29 +0200 Subject: [PATCH] expt_lmdk_sel: Dealing with corner cases --- code/expt/expt_lmdk_sel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/expt/expt_lmdk_sel.py b/code/expt/expt_lmdk_sel.py index a273d2a..7e84939 100644 --- a/code/expt/expt_lmdk_sel.py +++ b/code/expt/expt_lmdk_sel.py @@ -61,8 +61,8 @@ def main(args): # Turn part to histogram hist_pt, _ = lmdk_lib.get_hist(pt, lmdks_pt) # Get an option for this part - res_pt = np.array([]) - if len(opts) > 0: + res_pt = opts[0] + if len(opts) > 1: res_pt, _ = exp_mech.exponential(hist_pt, opts, exp_mech.score, 1.0, e) # Merge options of all parts res[pt_i] = np.sum(res_pt)