89d58cff936536b94f74021635412650b56e22e5,deeppavlov/models/evolution/evolution_param_generator.py,ParamsEvolution,sample_params,#ParamsEvolution#,431

Before Change


            params_copy = deepcopy(params)
        params_sample = dict()
        for param, param_val in params_copy.items():
            if isinstance(param_val, list):
                params_sample[param] = random.choice(param_val)
            elif isinstance(param_val, dict):
                if "evolve_bool" in param_val and param_val["evolve_bool"]:
                    sample = bool(random.choice([True, False]))
                elif "evolve_range" in param_val:
                    sample = self._sample_from_ranges(param_val)
                params_sample[param] = sample
            else:
                params_sample[param] = params_copy[param]
        return params_sample

    def _sample_from_ranges(self, opts):
        from_ = opts["evolve_range"][0]

After Change


                    sample = bool(random.choice([True, False]))
                elif "evolve_range" in param_val:
                    sample = self._sample_from_ranges(param_val)
                elif "evolve_choice" in param_val:
                    sample = random.choice(param_val["values"])
                params_sample[param] = sample
            else:
                params_sample[param] = params_copy[param]
        return params_sample
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: 89d58cff936536b94f74021635412650b56e22e5
Time: 2018-06-20
Author: dilyara.rimovna@gmail.com
File Name: deeppavlov/models/evolution/evolution_param_generator.py
Class Name: ParamsEvolution
Method Name: sample_params


Project Name: tensorlayer/tensorlayer
Commit Name: 741ad9fb33a98023d76c6b962ae77183745d4ffa
Time: 2019-01-17
Author: jingqing.zhang15@imperial.ac.uk
File Name: tensorlayer/models/core.py
Class Name: Model
Method Name: __call__


Project Name: deepmipt/DeepPavlov
Commit Name: c3f62292951d971607561821d6cdd67bfe77fb27
Time: 2018-06-26
Author: dilyara.rimovna@gmail.com
File Name: deeppavlov/models/evolution/evolution_param_generator.py
Class Name: ParamsEvolution
Method Name: sample_params