From aab22824dd9e0ff31dde47086c9dc0f46cacf82c Mon Sep 17 00:00:00 2001 From: Teytaud Date: Thu, 7 Dec 2023 09:10:18 +0100 Subject: [PATCH] Update sphere.py: remove useless functions (#1581) * Update sphere.py: remove useless functions * Update sphere.py * Update sphere.py * black --- nevergrad/common/sphere.py | 104 ++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 20 deletions(-) diff --git a/nevergrad/common/sphere.py b/nevergrad/common/sphere.py index 934940659..f7101a240 100644 --- a/nevergrad/common/sphere.py +++ b/nevergrad/common/sphere.py @@ -224,30 +224,30 @@ def Riesz_noblur_gradient( return x -def Riesz_noblur_bigconv_loworder(n, shape, budget=default_budget): - return Riesz_noblur_gradient( - n, shape, default_steps, order=0.5, step_size=default_stepsize, conv=[24, 24] - ) +# def Riesz_noblur_bigconv_loworder(n, shape, budget=default_budget): +# return Riesz_noblur_gradient( +# n, shape, default_steps, order=0.5, step_size=default_stepsize, conv=[24, 24] +# ) -def Riesz_noblur_bigconv_midorder(n, shape, budget=default_budget): - return Riesz_noblur_gradient(n, shape, default_steps, order=1, step_size=default_stepsize, conv=[24, 24]) +# def Riesz_noblur_bigconv_midorder(n, shape, budget=default_budget): +# return Riesz_noblur_gradient(n, shape, default_steps, order=1, step_size=default_stepsize, conv=[24, 24]) -def Riesz_noblur_bigconv_highorder(n, shape, budget=default_budget): - return Riesz_noblur_gradient(n, shape, default_steps, order=2, step_size=default_stepsize, conv=[24, 24]) +# def Riesz_noblur_bigconv_highorder(n, shape, budget=default_budget): +# return Riesz_noblur_gradient(n, shape, default_steps, order=2, step_size=default_stepsize, conv=[24, 24]) -def Riesz_noblur_medconv_loworder(n, shape, budget=default_budget): - return Riesz_noblur_gradient(n, shape, default_steps, order=0.5, step_size=default_stepsize, conv=[8, 8]) +# def Riesz_noblur_medconv_loworder(n, shape, budget=default_budget): +# return Riesz_noblur_gradient(n, shape, default_steps, order=0.5, step_size=default_stepsize, conv=[8, 8]) -def Riesz_noblur_medconv_midorder(n, shape, budget=default_budget): - return Riesz_noblur_gradient(n, shape, default_steps, order=1, step_size=default_stepsize, conv=[8, 8]) +# def Riesz_noblur_medconv_midorder(n, shape, budget=default_budget): +# return Riesz_noblur_gradient(n, shape, default_steps, order=1, step_size=default_stepsize, conv=[8, 8]) -def Riesz_noblur_medconv_highorder(n, shape, budget=default_budget): - return Riesz_noblur_gradient(n, shape, default_steps, order=2, step_size=default_stepsize, conv=[8, 8]) +# def Riesz_noblur_medconv_highorder(n, shape, budget=default_budget): +# return Riesz_noblur_gradient(n, shape, default_steps, order=2, step_size=default_stepsize, conv=[8, 8]) def Riesz_noblur_lowconv_loworder(n, shape, budget=default_budget): @@ -262,6 +262,58 @@ def Riesz_noblur_lowconv_highorder(n, shape, budget=default_budget): return Riesz_noblur_gradient(n, shape, default_steps, order=2, step_size=default_stepsize, conv=[2, 2]) +def Riesz_blursum_lowconv_hugeorder(n, shape, budget=default_budget): + return Riesz_blursum_gradient(n, shape, default_steps, order=5, step_size=default_stepsize, conv=[2, 2]) + + +def Riesz_blursum_medconv_hugeorder(n, shape, budget=default_budget): + return Riesz_blursum_gradient(n, shape, default_steps, order=5, step_size=default_stepsize, conv=[8, 8]) + + +def Riesz_blursum_highconv_hugeorder(n, shape, budget=default_budget): + return Riesz_blursum_gradient(n, shape, default_steps, order=5, step_size=default_stepsize, conv=[24, 24]) + + +def Riesz_blursum_lowconv_tinyorder(n, shape, budget=default_budget): + return Riesz_blursum_gradient(n, shape, default_steps, order=0.3, step_size=default_stepsize, conv=[2, 2]) + + +def Riesz_blursum_medconv_tinyorder(n, shape, budget=default_budget): + return Riesz_blursum_gradient(n, shape, default_steps, order=0.3, step_size=default_stepsize, conv=[8, 8]) + + +def Riesz_blursum_highconv_tinyorder(n, shape, budget=default_budget): + return Riesz_blursum_gradient( + n, shape, default_steps, order=0.3, step_size=default_stepsize, conv=[24, 24] + ) + + +def Riesz_blurred_lowconv_hugeorder(n, shape, budget=default_budget): + return Riesz_blurred_gradient(n, shape, default_steps, order=5, step_size=default_stepsize, conv=[2, 2]) + + +def Riesz_blurred_medconv_hugeorder(n, shape, budget=default_budget): + return Riesz_blurred_gradient(n, shape, default_steps, order=5, step_size=default_stepsize, conv=[8, 8]) + + +def Riesz_blurred_highconv_hugeorder(n, shape, budget=default_budget): + return Riesz_blurred_gradient(n, shape, default_steps, order=5, step_size=default_stepsize, conv=[24, 24]) + + +def Riesz_blurred_lowconv_tinyorder(n, shape, budget=default_budget): + return Riesz_blurred_gradient(n, shape, default_steps, order=0.3, step_size=default_stepsize, conv=[2, 2]) + + +def Riesz_blurred_medconv_tinyorder(n, shape, budget=default_budget): + return Riesz_blurred_gradient(n, shape, default_steps, order=0.3, step_size=default_stepsize, conv=[8, 8]) + + +def Riesz_blurred_highconv_tinyorder(n, shape, budget=default_budget): + return Riesz_blurred_gradient( + n, shape, default_steps, order=0.3, step_size=default_stepsize, conv=[24, 24] + ) + + def Riesz_blursum_bigconv_loworder(n, shape, budget=default_budget): return Riesz_blursum_gradient( n, shape, default_steps, order=0.5, step_size=default_stepsize, conv=[24, 24] @@ -704,12 +756,24 @@ def metric_pack_conv(x, budget=default_budget): "Riesz_blurred_lowconv_loworder", "Riesz_blurred_lowconv_midorder", "Riesz_blurred_lowconv_highorder", - "Riesz_noblur_bigconv_loworder", - "Riesz_noblur_bigconv_midorder", - "Riesz_noblur_bigconv_highorder", - "Riesz_noblur_medconv_loworder", - "Riesz_noblur_medconv_midorder", - "Riesz_noblur_medconv_highorder", + "Riesz_blursum_lowconv_hugeorder", + "Riesz_blursum_medconv_hugeorder", + "Riesz_blursum_highconv_hugeorder", + "Riesz_blursum_lowconv_tinyorder", + "Riesz_blursum_medconv_tinyorder", + "Riesz_blursum_highconv_tinyorder", + "Riesz_blurred_lowconv_hugeorder", + "Riesz_blurred_medconv_hugeorder", + "Riesz_blurred_highconv_hugeorder", + "Riesz_blurred_lowconv_tinyorder", + "Riesz_blurred_medconv_tinyorder", + "Riesz_blurred_highconv_tinyorder", + # "Riesz_noblur_bigconv_loworder", + # "Riesz_noblur_bigconv_midorder", + # "Riesz_noblur_bigconv_highorder", + # "Riesz_noblur_medconv_loworder", + # "Riesz_noblur_medconv_midorder", + # "Riesz_noblur_medconv_highorder", "Riesz_noblur_lowconv_loworder", "Riesz_noblur_lowconv_midorder", "Riesz_noblur_lowconv_highorder",