Repository: keras-team/autokeras

Issue:
Add content to nas.md
<!---
Please label your issue with `feature_request`.
-->

### Feature Description
<!---
A clear and concise description of idea/feature. If it is related to some problem you are facing, then explain the problem.
-->
Add content to nas.md.
Add code examples for running different searchers on CIFAR10 in the examples folder.
The example should call the CnnModule.
The CIFAR10 dataset should be directly loaded from pytorch. (refer to example code of pytorch on CIFAR10 online)

### Reason
<!---
A clear and concise description of why this feature would be useful for the project.
-->

### Solution
<!---
A clear and concise description of what you want to happen.
-->

### Alternative Solutions
<!---
A clear and concise description of any alternative solutions or features you've considered.
-->

### Additional Context
<!---
Add any other context or screenshots about the feature request here.
-->



Discussion:
More contents needed for implement your own searcher.

Resolving patch:
diff --git a/autokeras/search.py b/autokeras/search.py
--- a/autokeras/search.py
+++ b/autokeras/search.py
@@ -234,7 +234,16 @@ def generate(self, multiprocessing_queue):
         """
         pass
 
-    def update(self, *args):
+    @abstractmethod
+    def update(self, other_info, model_id, graph, metric_value):
+        """ Update the controller with evaluation result of a neural architecture.
+
+        Args:
+            other_info: Anything. In the case of default bayesian searcher, it is the father ID in the search tree.
+            model_id: An integer.
+            graph: An instance of Graph. The trained neural architecture.
+            metric_value: The final evaluated metric value.
+        """
         pass
 
     def add_model(self, metric_value, loss, graph, model_id):
diff --git a/nas/greedy.py b/nas/greedy.py
--- a/nas/greedy.py
+++ b/nas/greedy.py
@@ -12,7 +12,6 @@ class GreedyOptimizer:
     def __init__(self, searcher, metric):
         self.searcher = searcher
         self.metric = metric
-        self.search_tree = SearchTree()
 
     def generate(self, descriptors, timeout, sync_message):
         """Generate new neighbor architectures from the best model.
@@ -46,9 +45,6 @@ def generate(self, descriptors, timeout, sync_message):
             raise TimeoutError
         return out
 
-    def add_child(self, father_id, model_id):
-        self.search_tree.add_child(father_id, model_id)
-
 
 class GreedySearcher(Searcher):
     """ Class to search for neural architectures using Greedy search strategy.
@@ -90,15 +86,8 @@ def generate(self, multiprocessing_queue):
 
         return results
 
-    def update(self, other_info, model_id, *args):
-        """ Update the controller with evaluation result of a neural architecture.
-
-        Args:
-            other_info: Anything. In our case it is the father ID in the search tree.
-            model_id: An integer.
-        """
-        father_id = other_info
-        self.optimizer.add_child(father_id, model_id)
+    def update(self, other_info, model_id, graph, metric_value):
+        return
 
     def load_neighbour_best_model(self):
         return self.load_model_by_id(self.get_neighbour_best_model_id())
diff --git a/nas/random.py b/nas/random.py
--- a/nas/random.py
+++ b/nas/random.py
@@ -7,8 +7,6 @@
 
 class RandomSearcher(Searcher):
     """ Class to search for neural architectures using Random search strategy.
-    Attributes:
-        search_tree: The network morphism search tree
     """
 
     def __init__(self, n_output_node, input_shape, path, metric, loss, generators, verbose,
@@ -19,7 +17,6 @@ def __init__(self, n_output_node, input_shape, path, metric, loss, generators, v
                                              path, metric, loss, generators,
                                              verbose, trainer_args, default_model_len,
                                              default_model_width)
-        self.search_tree = SearchTree()
 
     def generate(self, multiprocessing_queue):
         """Generate the next neural architecture.
@@ -51,12 +48,5 @@ def generate(self, multiprocessing_queue):
 
         return [(generated_graph, new_father_id)]
 
-    def update(self, other_info, model_id, *args):
-        """ Update the controller with evaluation result of a neural architecture.
-
-        Args:
-            other_info: Anything. In our case it is the father ID in the search tree.
-            model_id: An integer.
-        """
-        father_id = other_info
-        self.search_tree.add_child(father_id, model_id)
\ No newline at end of file
+    def update(self, other_info, model_id, graph, metric_value):
+        return
\ No newline at end of file


Test patch: