From ab06753b847a56582b2d78830121602393041ca1 Mon Sep 17 00:00:00 2001 From: Manos Katsomallos Date: Fri, 18 Feb 2022 19:15:59 +0100 Subject: [PATCH] avg_dist: Minor correction --- code/expt/avg_dist.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/expt/avg_dist.py b/code/expt/avg_dist.py index 941a8de..625da65 100644 --- a/code/expt/avg_dist.py +++ b/code/expt/avg_dist.py @@ -45,7 +45,7 @@ def main(args): # Logging print('.', end='', flush=True) 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) # Calculate average distance @@ -54,7 +54,7 @@ def main(args): t_prv, t_nxt = gdp.get_limits(t, seq, lmdks) avg_cur += (abs(t - t_prv) - 1 + abs(t - t_nxt) - 1 )/len(seq) # Normalized average based on repetitions - avg_dist[i] += avg_cur/args.reps + avg_dist[i] += avg_cur/args.iter # Rescaling (min-max normalization) # https://en.wikipedia.org/wiki/Feature_scaling#Rescaling_(min-max_normalization) avg_dist = (avg_dist - avg_dist.min())/(avg_dist.max() - avg_dist.min()) @@ -88,7 +88,7 @@ def main(args): Parse arguments. Optional: - reps - The number of repetitions. + iter - The total iterations. time - The time limit of the sequence. ''' def parse_args(): @@ -98,7 +98,7 @@ def parse_args(): # 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 total iterations.', type=int, default=1) parser.add_argument('-t', '--time', help='The time limit of the sequence.', type=int, default=100) # Parse arguments.