rekall.tuner.coordinate_descent module¶
This module performs coordinate descent over the search space.
-
class
rekall.tuner.coordinate_descent.
CoordinateDescentTuner
(search_space, eval_fn, maximize=True, budget=500, log=True, log_dir=None, run_dir=None, run_name=None, start_config=None, start_score=None, score_fn=<function Tuner.<lambda>>, score_log_fn=<function Tuner.<lambda>>)¶ Bases:
rekall.tuner.tuner.Tuner
This tuner performs coordinate descent over the search space.
-
line_search
(config, cur_param, epsilon, budget, cur_score=0)¶ Vary cur_param within the bounds of the search_space (holding the other parameters constant), maximizing the accuracy function.
Let X be the current param, and let F(X) represent the accuracy function. Let Y be the range of X in the search_space.
- If F(X + epsilon * Y) > F(X):
- Find the smallest positive integer l such that F(X + l * epsilon * Y) < F(X + (l - 1) * epsilon * Y), and return X + (l - 1) * epsilon * Y as the new value of the parameter
- Otherwise:
- Find the smallest positive integer l such that F(X - l * epsilon * Y) < F(X - (l - 1) * epsilon * Y), and return X - (l - 1) * epsilon * Y as the new value of the parameter
-
tune_impl
(**kwargs)¶ Start with the midpoint of the search space Then cycle through co-ordinates. For each co-ordinate:
- If the co-ordinate is discrete, try all the choices
- If the co-ordinate is numerical, run line search with alpha and a budget of 10
If all the co-ordinates stay the same, try again with alpha = alpha * decay_rate.
Parameters: - alpha – initial alpha value for line search
- decay_rate – rate to decay alpha
- init_method – How to initialize the first config.
One of
['average', 'random']
. If not specified, default to ‘average’. ‘average’ initializes the config at the average of continuous ranges, ‘random’ randomly initializes the config. If start_config was specified upon initialization, use that value always. - line_search_budget – Budget to give to line search. Must be at least 2. Defaults to 10.
- randomize_param_order – Whether to randomize the order of coordinates for coordinate descent. Defaults to False.
-