12fac3a0ecc05215985c6b42b39447a3f2e04c0c,autokeras/search.py,BayesianSearcher,search,#BayesianSearcher#Any#Any#Any#Any#,163

Before Change


            history_item = self.add_model(model, x_train, y_train, x_test, y_test)
            self.search_tree.add_child(-1, history_item["model_id"])
            self.gpr.first_fit(Graph(model).extract_descriptor(), history_item["accuracy"])
            pickle.dump(self, open(os.path.join(self.path, "searcher"), "wb"))
            del model
            backend.clear_session()

        else:
            model_ids = self.search_tree.get_leaves()
            new_model, father_id = self.maximize_acq(model_ids)

            history_item = self.add_model(new_model, x_train, y_train, x_test, y_test)
            self.search_tree.add_child(father_id, history_item["model_id"])
            self.gpr.incremental_fit(Graph(new_model).extract_descriptor(), history_item["accuracy"])
            pickle.dump(self, open(os.path.join(self.path, "searcher"), "wb"))
            del new_model
            backend.clear_session()

    def maximize_acq(self, model_ids):

After Change


        self.gpr = IncrementalGaussianProcess()
        self.search_tree = SearchTree()

    def search(self, x_train, y_train, x_test, y_test):
        if not self.history:
            model = DefaultClassifierGenerator(self.n_classes, self.input_shape).generate()
            history_item = self.add_model(model, x_train, y_train, x_test, y_test)
            self.search_tree.add_child(-1, history_item["model_id"])
            self.gpr.first_fit(Graph(model).extract_descriptor(), history_item["accuracy"])
            pickle_to_file(self, os.path.join(self.path, "searcher"))
            del model
            backend.clear_session()

        else:
            model_ids = self.search_tree.get_leaves()
            new_model, father_id = self.maximize_acq(model_ids)

            history_item = self.add_model(new_model, x_train, y_train, x_test, y_test)
            self.search_tree.add_child(father_id, history_item["model_id"])
            self.gpr.incremental_fit(Graph(new_model).extract_descriptor(), history_item["accuracy"])
            pickle_to_file(self, os.path.join(self.path, "searcher"))
            del new_model
            backend.clear_session()

    def maximize_acq(self, model_ids):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: keras-team/autokeras
Commit Name: 12fac3a0ecc05215985c6b42b39447a3f2e04c0c
Time: 2018-04-06
Author: jin@tamu.edu
File Name: autokeras/search.py
Class Name: BayesianSearcher
Method Name: search


Project Name: jhfjhfj1/autokeras
Commit Name: 12fac3a0ecc05215985c6b42b39447a3f2e04c0c
Time: 2018-04-06
Author: jin@tamu.edu
File Name: autokeras/search.py
Class Name: BayesianSearcher
Method Name: search


Project Name: jhfjhfj1/autokeras
Commit Name: 12fac3a0ecc05215985c6b42b39447a3f2e04c0c
Time: 2018-04-06
Author: jin@tamu.edu
File Name: autokeras/search.py
Class Name: HillClimbingSearcher
Method Name: search