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