code: Minor corrections

This commit is contained in:
Manos Katsomallos 2021-10-01 06:55:52 +02:00
parent a137aa3741
commit 2dc2a5d182

View File

@ -430,11 +430,10 @@ def adaptive_cons(seq, lmdks, epsilon, inc_rt, dec_rt):
lmdk_cur += 1 lmdk_cur += 1
if lmdk_lib.should_sample(samp_rt) or i == 0: if lmdk_lib.should_sample(samp_rt) or i == 0:
# Add noise to original data # Add noise to original data
o = lmdk_lib.add_laplace_noise(p[1], 1, bgts[i]) rls_data[i] = [p[0], lmdk_lib.add_laplace_noise(p[1], 1, bgts[i])]
rls_data[i] = [p[0], o]
# Adjust sampling rate # Adjust sampling rate
if i > 0: 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 # Decrease
samp_rt -= samp_rt*dec_rt samp_rt -= samp_rt*dec_rt
else: else: