From 2dc2a5d182f9f674f53013cff1bf62cc08d28006 Mon Sep 17 00:00:00 2001 From: Manos Date: Fri, 1 Oct 2021 06:55:52 +0200 Subject: [PATCH] code: Minor corrections --- code/lib/lmdk_bgt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/lib/lmdk_bgt.py b/code/lib/lmdk_bgt.py index c9978dc..0e6c764 100644 --- a/code/lib/lmdk_bgt.py +++ b/code/lib/lmdk_bgt.py @@ -430,11 +430,10 @@ def adaptive_cons(seq, lmdks, epsilon, inc_rt, dec_rt): lmdk_cur += 1 if lmdk_lib.should_sample(samp_rt) or i == 0: # Add noise to original data - o = lmdk_lib.add_laplace_noise(p[1], 1, bgts[i]) - rls_data[i] = [p[0], o] + rls_data[i] = [p[0], lmdk_lib.add_laplace_noise(p[1], 1, bgts[i])] # Adjust sampling rate if i > 0: - if abs(rls_data[i - 1][1] - o) < 1/bgts[i]: + if abs(rls_data[i - 1][1] - rls_data[i][1]) < 1/bgts[i]: # Decrease samp_rt -= samp_rt*dec_rt else: