This commit is contained in:
Connor Olding 2023-05-04 15:04:51 -07:00
parent 2860ffdc3b
commit 200d6c000d

View File

@ -55,9 +55,7 @@ def make_objective(problem, n_dim, *, fix_stuff=0):
# and which is `b` between the equations and the code.
# hmm it seems like the code is right, judging by this:
# https://www.itl.nist.gov/div898/strd/nls/data/LINKS/DATA/MGH09.dat
helper = lambda x: np.where(x < 0, -1, 1) * (
np.abs(x) + tiny_offset
)
helper = lambda x: np.where(x < 0, -1, 1) * (np.abs(x) + tiny_offset)
# 1.0 - 1e-16 == 0.9999999999999999
# 1.0 + 1e-16 == 1.0
# 1.0 + 2e-16 == 1.0000000000000002
@ -303,7 +301,7 @@ if __name__ == "__main__":
run_anyway = 3
always_run_anyway = False
#percents = dict(frugal_percent=0.1, greedy_percent=1.5)
# percents = dict(frugal_percent=0.1, greedy_percent=1.5)
percents = dict(frugal_percent=1.0, greedy_percent=2.0)
book = book_of_optimizers
@ -400,8 +398,7 @@ if __name__ == "__main__":
prices.setdefault(opt_name, 0.0)
sorted_res = sorted(all_res)
score_insignificance = sum(
len(all_res[fopt])
for _, fopt in zip(range(len(place_scores)), sorted_res)
len(all_res[fopt]) for _, fopt in zip(range(len(place_scores)), sorted_res)
)
price_insignificance = sum(
len(all_res[fopt])
@ -466,7 +463,9 @@ if __name__ == "__main__":
# if opt_score < 1: continue
stats = f"{opt_score:18.16f}"
name = opt_name.removesuffix("_cube")
color = "\033[1m" if opt_score > 1.0 else "\033[33m" if opt_score < 1.0 else ""
color = (
"\033[1m" if opt_score > 1.0 else "\033[33m" if opt_score < 1.0 else ""
)
s = f"{mark(opt_name)} {name:<32}{reset} with {color}{stats}{reset}"
# s += f" {color}{float(delta):+.0f}{reset}"
print(s)