08af7771d1f1149f3da5a98bcdbf7e65abd409ba,nni/retiarii/strategies/tpe_strategy.py,TPEStrategy,run,#TPEStrategy#Any#Any#,43

Before Change


            sample_space.extend(recorded_candidates)
        self.tpe_sampler.update_sample_space(sample_space)

        try:
            _logger.info("stargety start...")
            while True:
                model = base_model
                _logger.info("apply mutators...")
                _logger.info("mutators: %s", str(applied_mutators))
                self.tpe_sampler.generate_samples(self.model_id)
                for mutator in applied_mutators:
                    _logger.info("mutate model...")
                    mutator.bind_sampler(self.tpe_sampler)
                    model = mutator.apply(model)
                // run models
                submit_models(model)
                wait_models(model)
                self.tpe_sampler.receive_result(self.model_id, model.metric)
                self.model_id += 1
                _logger.info("Strategy says: %s", model.metric)
        except Exception:
            _logger.error(logging.exception("message"))

After Change



            _logger.warning("num of running models: %d", len(self.running_models))
            to_be_deleted = []
            for _id, _model in self.running_models.items():
                if is_stopped_exec(_model):
                    if _model.metric is not None:
                        self.tpe_sampler.receive_result(_id, _model.metric)
                        _logger.warning("tpe receive results: %d, %s", _id, _model.metric)
                    to_be_deleted.append(_id)
            for _id in to_be_deleted:
                del self.running_models[_id]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: Microsoft/nni
Commit Name: 08af7771d1f1149f3da5a98bcdbf7e65abd409ba
Time: 2020-12-27
Author: Quanlu.Zhang@microsoft.com
File Name: nni/retiarii/strategies/tpe_strategy.py
Class Name: TPEStrategy
Method Name: run


Project Name: deepgram/kur
Commit Name: f9e27737834aa42092518755743a26a4785e198c
Time: 2017-01-31
Author: ajsyp@syptech.net
File Name: kur/providers/batch_provider.py
Class Name: BatchProvider
Method Name: __iter__


Project Name: home-assistant/home-assistant
Commit Name: 9f54bcc21b1744f2850a35e54903f3581d14badb
Time: 2015-12-23
Author: marhje52@kth.se
File Name: homeassistant/components/mysensors.py
Class Name:
Method Name: setup


Project Name: home-assistant/home-assistant
Commit Name: 2863c2d593184ba4edfda242892b50b466cedcf6
Time: 2015-03-21
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/bootstrap.py
Class Name:
Method Name: setup_component