diff options
author | sjpark <sjpark@amazon.com> | 2023-10-27 14:02:25 -0700 |
---|---|---|
committer | sjpark <sjpark@amazon.com> | 2023-10-27 14:02:25 -0700 |
commit | 883cb8f9d87dd2702fe59a43ea1699390754a599 (patch) | |
tree | 5f78c239fadd85206c30a307f9da58c4bf47602d | |
parent | bef8ce644cd526455b3d7ad35f23b2e89d47cab1 (diff) | |
download | damon-hack-883cb8f9d87dd2702fe59a43ea1699390754a599.tar.gz |
idea/autotune_sim: Ignore consecutive success
Signed-off-by: sjpark <sjpark@amazon.com>
-rwxr-xr-x | ideas/autotune_sim/autotune_sim.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/ideas/autotune_sim/autotune_sim.py b/ideas/autotune_sim/autotune_sim.py index 5b2ea6d..52ddbf6 100755 --- a/ideas/autotune_sim/autotune_sim.py +++ b/ideas/autotune_sim/autotune_sim.py @@ -49,16 +49,11 @@ def run_simulation(print_for_plot): target_in_error = 5 tuner = Tuner(the_algorithm, goal) - nr_consecutive_in_target = 0 if print_for_plot: print('%d_%d_%d_%d' % (a, b, quota, answer)) for i in range(max_steps): score = score_of(quota, a, b, normal_error_percent) if abs(score - goal) / goal * 100 < target_error: - nr_consecutive_in_target += 1 - else: - nr_consecutive_in_target = 0 - if nr_consecutive_in_target == target_in_error: break quota = tuner.get_next_quota(score) if print_for_plot: @@ -68,7 +63,7 @@ def run_simulation(print_for_plot): print() if i == max_steps - 1: return -1 - return i - nr_consecutive_in_target + return i def main(): parser = argparse.ArgumentParser() |