cdbb8791ec13d03fd1fcf2580111db677a3ebc29,autokeras/tuner.py,AutoTuner,search,#AutoTuner#Any#,117

Before Change


        self.best_hp = best_trial.hyperparameters
        preprocess_graph, keras_graph, model = self.get_best_models()[0]
        preprocess_graph.save(self.best_preprocess_graph_path)
        keras_graph.save(self.best_keras_graph_path)

        // Fully train the best model with original callbacks.
        if not any([isinstance(callback, tf.keras.callbacks.EarlyStopping)
                    for callback in callbacks]) or self.fit_on_val_data:

After Change


        is injected to accelerate the search process. At the end of the search, the
        best model will be fully trained with the specified number of epochs.
        
        if self._finished:
            return
        // Insert early-stopping for acceleration.
        if not callbacks:
            callbacks = []
        new_callbacks = self._deepcopy_callbacks(callbacks)
        if not any([isinstance(callback, tf.keras.callbacks.EarlyStopping)
                    for callback in callbacks]):
            new_callbacks.append(tf.keras.callbacks.EarlyStopping(patience=10))

        super().search(callbacks=new_callbacks, **fit_kwargs)

        // Fully train the best model with original callbacks.
        if not any([isinstance(callback, tf.keras.callbacks.EarlyStopping)
                    for callback in callbacks]) or self.fit_on_val_data:
            best_trial = self.oracle.get_best_trials(1)[0]
            best_hp = best_trial.hyperparameters
            preprocess_graph, keras_graph = self.hyper_graph.build_graphs(best_hp)
            fit_kwargs["callbacks"] = self._deepcopy_callbacks(callbacks)
            self._prepare_run(preprocess_graph, fit_kwargs, fit=True)
            if self.fit_on_val_data:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: keras-team/autokeras
Commit Name: cdbb8791ec13d03fd1fcf2580111db677a3ebc29
Time: 2019-12-15
Author: jhfjhfj1@gmail.com
File Name: autokeras/tuner.py
Class Name: AutoTuner
Method Name: search


Project Name: wkentaro/labelme
Commit Name: a8b94863d2178d84b7e6c66eae38d0964eeca165
Time: 2020-07-13
Author: www.kentaro.wada@gmail.com
File Name: examples/instance_segmentation/labelme2coco.py
Class Name:
Method Name: main


Project Name: tensorlayer/tensorlayer
Commit Name: 5307ae3f7d1c4b6bd2285f946db82d944f3844db
Time: 2019-02-19
Author: jingqing.zhang15@imperial.ac.uk
File Name: examples/text_classification/tutorial_imdb_fasttext.py
Class Name:
Method Name: train_test_and_save_model