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: