From c77c9968c7720b3ae54cf32ce873c9db0affc6ef Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 20 May 2023 19:05:02 -0700 Subject: [PATCH] prepare dummy lists for 5D and 6D problems --- thursday/go_benchmark_it.py | 36 +++++++++++++++++++++++++--------- thursday/go_benchmark_lists.py | 12 ++++++++++++ thursday/go_benchmarks.py | 12 ++++++++++++ 3 files changed, 51 insertions(+), 9 deletions(-) diff --git a/thursday/go_benchmark_it.py b/thursday/go_benchmark_it.py index c8811d1..7eada18 100644 --- a/thursday/go_benchmark_it.py +++ b/thursday/go_benchmark_it.py @@ -1,15 +1,9 @@ from .go_benchmark_lists import * -from .go_benchmarks import problems_2d, problems_3d, problems_4d +from .go_benchmarks import all_problems from .parties import parties from .utilities import OWrap, COWrap, m1, m33, m36, prog import numpy as np -all_problems = { - 2: problems_2d, - 3: problems_3d, - 4: problems_4d, -} - tiny_offset = 1.1102230246251565e-16 @@ -72,14 +66,26 @@ def make_objective(problem, size, *, fix_stuff=0): obj.fun = lambda x: _fun(x + adjust) if fix_stuff >= 1: - stuff = {2: too_positive_2, 3: too_positive_3, 4: too_positive_4}[size] + stuff = { + 2: too_positive_2, + 3: too_positive_3, + 4: too_positive_4, + 5: too_positive_5, + 6: too_positive_6, + }[size] if name.lower() in stuff: # too positively correlated, do some evil. ind = stuff.index(name.lower()) flippy = ind % size + 1 # uniformly select a dimension to "flip" if fix_stuff >= 2: - stuff = {2: too_centered_2, 3: too_centered_3, 4: too_centered_4}[size] + stuff = { + 2: too_centered_2, + 3: too_centered_3, + 4: too_centered_4, + 5: too_positive_5, + 6: too_positive_6, + }[size] if name.lower() in stuff: # uniformly select offsets to "trip". ind = stuff.index(name.lower()) @@ -139,10 +145,22 @@ GO_BENCHMARK_4D_PROBLEMS = list( map(λ, totally_fine_4 + too_positive_4 + too_centered_4) ) +λ = lambda q: make_objective(find_objective(q, 5), 5, fix_stuff=2) +GO_BENCHMARK_5D_PROBLEMS = list( + map(λ, totally_fine_5 + too_positive_5 + too_centered_5) +) + +λ = lambda q: make_objective(find_objective(q, 6), 6, fix_stuff=2) +GO_BENCHMARK_6D_PROBLEMS = list( + map(λ, totally_fine_6 + too_positive_6 + too_centered_6) +) + GO_BENCHMARKS = { 2: GO_BENCHMARK_2D_PROBLEMS, 3: GO_BENCHMARK_3D_PROBLEMS, 4: GO_BENCHMARK_4D_PROBLEMS, + 5: GO_BENCHMARK_5D_PROBLEMS, + 6: GO_BENCHMARK_6D_PROBLEMS, } for problem_list in GO_BENCHMARKS.values(): diff --git a/thursday/go_benchmark_lists.py b/thursday/go_benchmark_lists.py index 5b0295d..4fd4cdc 100644 --- a/thursday/go_benchmark_lists.py +++ b/thursday/go_benchmark_lists.py @@ -369,3 +369,15 @@ totally_fine_4 = [ "xinsheyang04", "zacharov", ] + +too_variable_5 = [] +too_centered_5 = [] +too_far_away_5 = [] +too_positive_5 = [] +totally_fine_5 = [] + +too_variable_6 = [] +too_centered_6 = [] +too_far_away_6 = [] +too_positive_6 = [] +totally_fine_6 = [] diff --git a/thursday/go_benchmarks.py b/thursday/go_benchmarks.py index 0081863..a38187c 100644 --- a/thursday/go_benchmarks.py +++ b/thursday/go_benchmarks.py @@ -49,6 +49,18 @@ if _looky_here: at_least_2d = p_by_d.get("2+", []) at_least_3d = p_by_d.get("3+", []) + at_least_2d at_least_4d = p_by_d.get("4+", []) + at_least_3d +at_least_5d = p_by_d.get("5+", []) + at_least_4d +at_least_6d = p_by_d.get("6+", []) + at_least_5d problems_2d = p_by_d.get("2", []) + at_least_2d problems_3d = p_by_d.get("3", []) + at_least_3d problems_4d = p_by_d.get("4", []) + at_least_4d +problems_5d = p_by_d.get("5", []) + at_least_5d +problems_6d = p_by_d.get("6", []) + at_least_6d + +all_problems = { + 2: problems_2d, + 3: problems_3d, + 4: problems_4d, + 5: problems_5d, + 6: problems_6d, +}