Beispiel #1
0
 def _get_experiment(self, name):
     channel = grpc.beta.implementations.insecure_channel(
         self.manager_addr, self.manager_port)
     with api_pb2.beta_create_Manager_stub(channel) as client:
         exp = client.GetExperiment(
             api_pb2.GetExperimentRequest(experiment_name=name), 10)
         return exp.experiment
Beispiel #2
0
    def _get_experiment_param(self):
        # this function need to
        # 1) get the number of layers
        # 2) get the I/O size
        # 3) get the available operations
        # 4) get the optimization direction (i.e. minimize or maximize)
        # 5) get the objective name
        # 6) get the algorithm settings

        channel = grpc.beta.implementations.insecure_channel(MANAGER_ADDRESS, MANAGER_PORT)
        with api_pb2.beta_create_Manager_stub(channel) as client:
            api_experiment_param = client.GetExperiment(api_pb2.GetExperimentRequest(experiment_name=self.experiment_name), 10)

        # Get Search Space
        self.experiment_name = api_experiment_param.experiment.name
        self.opt_direction = api_experiment_param.experiment.spec.objective.type
        self.objective_name = api_experiment_param.experiment.spec.objective.objective_metric_name

        nas_config = api_experiment_param.experiment.spec.nas_config
        
        graph_config = nas_config.graph_config
        self.num_layers = int(graph_config.num_layers)
        self.input_sizes = list(map(int, graph_config.input_sizes))
        self.output_sizes = list(map(int, graph_config.output_sizes))

        search_space_raw = nas_config.operations
        search_space_object = SearchSpace(search_space_raw)
        self.search_space = search_space_object.search_space
        self.num_operations = search_space_object.num_operations
        
        self.print_search_space()

        # Get Experiment Parameters
        params_raw = api_experiment_param.experiment.spec.algorithm.algorithm_setting
        self.algorithm_settings = parseAlgorithmSettings(params_raw)

        self.print_algorithm_settings()