Minor corrections
This commit is contained in:
		@ -45,7 +45,7 @@ def main(args):
 | 
			
		||||
    x_margin = bar_width*(len(dist_type)/2 + 1)
 | 
			
		||||
    plt.xlim(x_i.min() - x_margin, x_i.max() + x_margin)
 | 
			
		||||
    # The y axis
 | 
			
		||||
    plt.ylabel('Privacy loss')  # Set y axis label.
 | 
			
		||||
    plt.ylabel('Overall privacy loss')  # Set y axis label.
 | 
			
		||||
    plt.yscale('log')
 | 
			
		||||
    plt.ylim(epsilon/10, 100*len(seq))
 | 
			
		||||
    # plt.ylim(0, 10000)
 | 
			
		||||
@ -55,15 +55,15 @@ def main(args):
 | 
			
		||||
      e = np.zeros(len(lmdk_n))
 | 
			
		||||
      a = np.zeros(len(lmdk_n))
 | 
			
		||||
      for i, n in enumerate(lmdk_n):
 | 
			
		||||
        for r in range(args.reps):
 | 
			
		||||
        for r in range(args.iter):
 | 
			
		||||
          # Generate landmarks
 | 
			
		||||
          lmdks = lmdk_lib.get_lmdks(seq, n, d)
 | 
			
		||||
          # Uniform budget allocation
 | 
			
		||||
          e_cur = lmdk_bgt.uniform(seq, lmdks, epsilon)
 | 
			
		||||
          _, _, a_cur = gdp.tpl_lmdk_mem(e_cur, p, p, seq, lmdks)
 | 
			
		||||
          # Save privacy loss
 | 
			
		||||
          e[i] += np.sum(e_cur)/args.reps
 | 
			
		||||
          a[i] += np.sum(a_cur)/args.reps
 | 
			
		||||
          e[i] += np.sum(e_cur)/args.iter
 | 
			
		||||
          a[i] += np.sum(a_cur)/args.iter
 | 
			
		||||
      # Set label
 | 
			
		||||
      label = lmdk_lib.dist_type_to_str(d_i)
 | 
			
		||||
      if d_i == 1:
 | 
			
		||||
@ -94,21 +94,21 @@ def main(args):
 | 
			
		||||
    print(' [OK]', flush=True)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
'''
 | 
			
		||||
  Parse arguments.
 | 
			
		||||
 | 
			
		||||
  Optional:
 | 
			
		||||
    reps - The number of repetitions.
 | 
			
		||||
    time - The time limit of the sequence.
 | 
			
		||||
'''
 | 
			
		||||
def parse_args():
 | 
			
		||||
  '''
 | 
			
		||||
    Parse arguments.
 | 
			
		||||
 | 
			
		||||
    Optional:
 | 
			
		||||
      iter - The number of repetitions.
 | 
			
		||||
      time - The time limit of the sequence.
 | 
			
		||||
  '''
 | 
			
		||||
  # Create argument parser.
 | 
			
		||||
  parser = argparse.ArgumentParser()
 | 
			
		||||
 | 
			
		||||
  # Mandatory arguments.
 | 
			
		||||
 | 
			
		||||
  # Optional arguments.
 | 
			
		||||
  parser.add_argument('-r', '--reps', help='The number of repetitions.', type=int, default=1)
 | 
			
		||||
  parser.add_argument('-i', '--iter', help='The number of repetitions.', type=int, default=1)
 | 
			
		||||
  parser.add_argument('-t', '--time', help='The time limit of the sequence.', type=int, default=100)
 | 
			
		||||
 | 
			
		||||
  # Parse arguments.
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user