prepare dummy lists for 5D and 6D problems

This commit is contained in:
Connor Olding 2023-05-20 19:05:02 -07:00
parent 2ec495e5f8
commit c77c9968c7
3 changed files with 51 additions and 9 deletions

View File

@ -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():

View File

@ -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 = []

View File

@ -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,
}