From 5eb60ab286172e1be1b5511704b5af79f94ec922 Mon Sep 17 00:00:00 2001 From: Manos Date: Wed, 29 Sep 2021 12:58:19 +0200 Subject: [PATCH] code: Checking for rows correctly --- code/lib/lmdk_bgt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/lib/lmdk_bgt.py b/code/lib/lmdk_bgt.py index f1cae78..5fe6ba7 100644 --- a/code/lib/lmdk_bgt.py +++ b/code/lib/lmdk_bgt.py @@ -370,7 +370,7 @@ def adaptive_cont(seq, lmdks, epsilon, inc_rt, dec_rt): skipped = 0 for i, p in enumerate(seq): # Check if current point is a landmark - r = p[2] in lmdks + r = any((lmdks[:]==p).all(1)) if r: lmdk_cur += 1 if lmdk_lib.should_sample(samp_rt) or i == 0: @@ -447,7 +447,7 @@ def skip_cont(seq, lmdks, epsilon): rls_data = [None]*len(seq) for i, p in enumerate(seq): # Check if current point is a landmark - r = p[2] in lmdks + r = any((lmdks[:]==p).all(1)) # Add noise o = lmdk_lib.randomized_response(r, bgts[i]) if r: @@ -636,7 +636,7 @@ def uniform_cont(seq, lmdks, epsilon): # Budgets bgts = uniform(seq, lmdks, epsilon) for i, p in enumerate(seq): - r = p[2] in lmdks + r = any((lmdks[:]==p).all(1)) # [original, perturbed] rls_data[i] = [r, lmdk_lib.randomized_response(r, bgts[i])] return rls_data, bgts