2f1f42eeb68c64ff991c0ae2e8253a9305e90f74,autokeras/auto/tuner.py,AutoTuner,run_trial,#AutoTuner#Any#Any#Any#Any#,8

Before Change


        Preprocess the x and y before calling the base run_trial.
        fit_kwargs.update(dict(zip(tf.keras.Model.fit.__code__.co_varnames,
                                   fit_args)))
        fit_args = []
        x, y, val_x, val_y = self.hypermodel.preprocess(hp, *fit_args, **fit_kwargs)
        fit_kwargs["x"] = x
        fit_kwargs["y"] = y
        fit_kwargs["validation_data"] = (val_x, val_y)

After Change



    def run_trial(self, trial, hp, fit_args, fit_kwargs):
        Preprocess the x and y before calling the base run_trial.
        new_fit_kwargs = copy.copy(fit_kwargs)
        new_fit_kwargs.update(
            dict(zip(inspect.getfullargspec(tf.keras.Model.fit).args, fit_args)))
        x, y, validation_data = self.hypermodel.preprocess(
            hp,
            new_fit_kwargs.get("x", None),
            new_fit_kwargs.get("y", None),
            new_fit_kwargs.get("validation_data", None))

        new_fit_kwargs["x"], new_fit_kwargs["validation_data"] = \
            utils.prepare_model_input(
                x=x,
                y=y,
                validation_data=validation_data,
                batch_size=fit_kwargs.get("batch_size", 32))

        new_fit_kwargs["batch_size"] = None
        new_fit_kwargs["y"] = None
        super(AutoTuner, self).run_trial(trial, hp, [], new_fit_kwargs)

    def get_best_hp(self, num_models=1):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: keras-team/autokeras
Commit Name: 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74
Time: 2019-07-04
Author: jhfjhfj1@gmail.com
File Name: autokeras/auto/tuner.py
Class Name: AutoTuner
Method Name: run_trial


Project Name: keras-team/autokeras
Commit Name: 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74
Time: 2019-07-04
Author: jhfjhfj1@gmail.com
File Name: autokeras/auto/tuner.py
Class Name: AutoTuner
Method Name: run_trial


Project Name: NervanaSystems/coach
Commit Name: 39a28aba95b0d8eeb56f7a17b7dad140e601b591
Time: 2018-02-21
Author: zach.dwiel@intel.com
File Name: agents/clipped_ppo_agent.py
Class Name: ClippedPPOAgent
Method Name: train_network


Project Name: NervanaSystems/coach
Commit Name: 8248caf35eeb43046f2b28937627d43cbf950c9a
Time: 2018-02-21
Author: zach.dwiel@intel.com
File Name: agents/ppo_agent.py
Class Name: PPOAgent
Method Name: train_policy_network