Skip to content

Commit f39ca9c

Browse files
authored
remove unused flags (#272)
1 parent 6b59568 commit f39ca9c

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

compiler_opt/es/blackbox_optimizers.py

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import enum
3333
import math
3434

35-
from absl import flags
3635
import numpy as np
3736
import numpy.typing as npt
3837
import scipy.optimize as sp_opt
@@ -59,6 +58,9 @@ class LinearModel(enum.Enum):
5958
RIDGE = linear_model.Ridge
6059

6160

61+
DEFAULT_ARMIJO = 1e-4
62+
63+
6264
def filter_top_directions(
6365
perturbations: npt.NDArray[np.float32],
6466
function_values: npt.NDArray[np.float32], est_type: EstimatorType,
@@ -324,34 +326,6 @@ def set_state(self, state: SequenceOfFloats) -> None:
324326
325327
See class descriptions for more detailed notes on each algorithm.
326328
"""
327-
328-
_GRAD_TYPE = flags.DEFINE_string('grad_type', 'MC', 'Gradient estimator.')
329-
_TR_INIT_RADIUS = flags.DEFINE_float('tr_init_radius', 1,
330-
'Initial radius for TR method.')
331-
_TR_GROW_THRESHOLD = flags.DEFINE_float('tr_grow_threshold', 1e-4,
332-
'Growth test for TR method.')
333-
_TR_GROW_FACTOR = flags.DEFINE_float('tr_grow_factor', 1.1,
334-
'Growth factor for TR method.')
335-
_TR_SHRINK_NEG_THRESHOLD = flags.DEFINE_float('tr_shrink_neg_threshold', 0.1,
336-
'Shrink test for TR method')
337-
_TR_SHRINK_FACTOR = flags.DEFINE_float('tr_shrink_factor', 0.9,
338-
'Shrink factor for TR method.')
339-
_TR_REJECT_THRESHOLD = flags.DEFINE_float('tr_reject_threshold', 0.5,
340-
'Reject test for TR method.')
341-
_TR_REJECT_FACTOR = flags.DEFINE_float(
342-
'tr_reject_factor', 0.5, 'Rejection shrink factor for TR method.')
343-
_TR_DENSE_HESSIAN = flags.DEFINE_bool('tr_dense_hessian', True,
344-
'Store dense Hessian for TR.')
345-
_TR_SUB_TERMINATION = flags.DEFINE_float(
346-
'tr_sub_termination', 1e-3,
347-
'Subproblem gradient norm termination for TR method.')
348-
_TR_SUBPROBLEM_MAXITER = flags.DEFINE_integer(
349-
'tr_subproblem_maxiter', 10,
350-
'Maximum iterations when TR subproblem line search fails.')
351-
_TR_MINIMUM_RADIUS = flags.DEFINE_float('tr_minimum_radius', 0.1,
352-
'Minimum radius of trust region.')
353-
354-
DEFAULT_ARMIJO = 1e-4
355329
"""Gradient estimators.
356330
The blackbox pipeline has two steps:
357331
estimate gradient/Hessian --> optimizer --> next weight

0 commit comments

Comments
 (0)