32
32
import enum
33
33
import math
34
34
35
- from absl import flags
36
35
import numpy as np
37
36
import numpy .typing as npt
38
37
import scipy .optimize as sp_opt
@@ -59,6 +58,9 @@ class LinearModel(enum.Enum):
59
58
RIDGE = linear_model .Ridge
60
59
61
60
61
+ DEFAULT_ARMIJO = 1e-4
62
+
63
+
62
64
def filter_top_directions (
63
65
perturbations : npt .NDArray [np .float32 ],
64
66
function_values : npt .NDArray [np .float32 ], est_type : EstimatorType ,
@@ -324,34 +326,6 @@ def set_state(self, state: SequenceOfFloats) -> None:
324
326
325
327
See class descriptions for more detailed notes on each algorithm.
326
328
"""
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
355
329
"""Gradient estimators.
356
330
The blackbox pipeline has two steps:
357
331
estimate gradient/Hessian --> optimizer --> next weight
0 commit comments