399da723c59cc862d4d40a7eb1e6d7792208de17,pfnopt/storages/rdb.py,RDBStorage,set_trial_param,#RDBStorage#Any#Any#Any#,248

Before Change


        // type: (int, str, float) -> None

        session = self.scoped_session()
        trial = session.query(TrialModel).filter(TrialModel.trial_id == trial_id).one()

        param_distribution = session.query(TrialParamDistributionModel). \
            filter(TrialParamDistributionModel.trial_id == trial.trial_id). \
            filter(TrialParamDistributionModel.param_name == param_name).one()

        // check if the parameter already exists
        trial_param = session.query(TrialParamModel). \
            filter(TrialParamModel.trial_id == trial_id). \
            filter(TrialParamModel.param_distribution.has(param_name=param_name)).one_or_none()
        if trial_param is not None:
            assert trial_param.param_value == param_value
            return

        trial_param = TrialParamModel()
        trial_param.trial_id = trial_id
        trial_param.param_distribution_id = param_distribution.param_distribution_id
        trial_param.param_value = param_value
        session.add(trial_param)

        try:

After Change



        session = self.scoped_session()

        trial = models.TrialModel.find_by_id(trial_id, session, allow_none=False)
        param_distribution = models.TrialParamDistributionModel.find_by_trial_and_param_name(
            trial, param_name, session, allow_none=False)

        // check if the parameter already exists
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 9

Instances


Project Name: pfnet/optuna
Commit Name: 399da723c59cc862d4d40a7eb1e6d7792208de17
Time: 2018-04-24
Author: sano@preferred.jp
File Name: pfnopt/storages/rdb.py
Class Name: RDBStorage
Method Name: set_trial_param


Project Name: pfnet/optuna
Commit Name: 399da723c59cc862d4d40a7eb1e6d7792208de17
Time: 2018-04-24
Author: sano@preferred.jp
File Name: pfnopt/storages/rdb.py
Class Name: RDBStorage
Method Name: set_trial_param


Project Name: pfnet/optuna
Commit Name: 399da723c59cc862d4d40a7eb1e6d7792208de17
Time: 2018-04-24
Author: sano@preferred.jp
File Name: pfnopt/storages/rdb.py
Class Name: RDBStorage
Method Name: set_trial_value


Project Name: pfnet/optuna
Commit Name: 399da723c59cc862d4d40a7eb1e6d7792208de17
Time: 2018-04-24
Author: sano@preferred.jp
File Name: pfnopt/storages/rdb.py
Class Name: RDBStorage
Method Name: set_trial_state


Project Name: pfnet/optuna
Commit Name: 399da723c59cc862d4d40a7eb1e6d7792208de17
Time: 2018-04-24
Author: sano@preferred.jp
File Name: pfnopt/storages/rdb.py
Class Name: RDBStorage
Method Name: set_trial_user_attr