962df011b0c0ff164d4158810acef0afc06f0ac7,smac/intensification/successive_halving.py,SuccessiveHalving,_init_sh_params,#SuccessiveHalving#Any#Any#Any#Any#,139

Before Change


            if self.cutoff is not None and max_budget is not None:
                warnings.warn("Successive Halving with runtime-cutoff as budget: "
                              "Both max budget (%d) and runtime-cutoff (%d) were provided. Max budget will be used." %
                              (self.max_budget, len(self.instances)))

            self.min_budget = min_budget
            self.max_budget = max_budget if max_budget else self.cutoff

After Change



        // BUDGETS

        if max_budget is not None and min_budget is not None \
                and max_budget < min_budget:
            raise ValueError("Max budget has to be larger than min budget")

        // - if only 1 instance was provided & quality objective, then use cutoff as budget
        // - else, use instances as budget
        if not self.run_obj_time and len(self.instances) <= 1:
            // budget with cutoff
            if min_budget is None or \
                    (max_budget is None and self.cutoff is None):
                raise ValueError("Successive Halving with runtime-cutoff as budget (i.e., only 1 instance) "
                                 "requires parameters min_budget and max_budget/cutoff for intensification!")

            if self.cutoff is not None and max_budget is not None:
                self.logger.warn("Successive Halving with runtime-cutoff as budget: "
                                 "Both max budget (%d) and runtime-cutoff (%d) were provided. Max budget will be used." %
                                 (max_budget, self.cutoff))

            self.min_budget = min_budget
            self.max_budget = max_budget if max_budget else self.cutoff
            self.cutoff_as_budget = True

        else:
            // budget with instances
            if self.run_obj_time and len(self.instances) <= 1:
                self.logger.warn("Successive Halving has objective "runtime" but only 1 instance-seed pair.")
            self.min_budget = 1 if min_budget is None else int(min_budget)
            self.max_budget = len(self.instances) if max_budget is None else int(max_budget)
            self.cutoff_as_budget = False

            if self.max_budget > len(self.instances):
                raise ValueError("Max budget cannot be greater than the number of instance-seed pairs")
            if self.max_budget < len(self.instances):
                self.logger.warn("Max budget (%d) does not include all instance-seed pairs (%d)" %
                                 (self.max_budget, len(self.instances)))

        self.logger.debug("Running Successive Halving with "%s" as budget" % self.cutoff_as_budget)

        // precomputing stuff for SH
        self.max_sh_iter = np.floor(np.log(self.max_budget / self.min_budget) / np.log(eta))
        self.init_chal = int(np.round(self.eta**self.max_sh_iter)) if init_chal is None else init_chal
        self.budgets = self.max_budget * np.power(self.eta, -np.linspace(self.max_sh_iter, 0, self.max_sh_iter + 1))

    def intensify(self, challengers: typing.List[Configuration],
                  incumbent: typing.Optional[Configuration],
                  run_history: RunHistory,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: automl/SMAC3
Commit Name: 962df011b0c0ff164d4158810acef0afc06f0ac7
Time: 2019-09-06
Author: ashraaghav@gmail.com
File Name: smac/intensification/successive_halving.py
Class Name: SuccessiveHalving
Method Name: _init_sh_params


Project Name: cesium-ml/cesium
Commit Name: 9be64784de6d7d5ed1e85ca4bb380d40cf95b14a
Time: 2016-02-04
Author: brettnaul@gmail.com
File Name: mltsp/featurize_tools.py
Class Name:
Method Name: parse_ts_data


Project Name: danforthcenter/plantcv
Commit Name: 96c26bd09d02bb9cddbc083c75ba2ea65b5d377a
Time: 2020-07-16
Author: noahfahlgren@gmail.com
File Name: plantcv/plantcv/color_palette.py
Class Name:
Method Name: color_palette