(self, arguments: List[str])
return ax_client
Method to setup the Ax Client
Method to setup the Ax Client
Method to setup the Ax Client
def setup_ax_client(self, arguments: List[str]) -> AxClient:
        """Method to setup the Ax Client"""
        parameters: List[Dict[Any, Any]] = []
        for key, value in self.ax_params.items():
            param = OmegaConf.to_container(value, resolve=True)
            assert isinstance(param, Dict)
            if param["type"] == "range":
                bounds = param["bounds"]
                if not (all(isinstance(x, int) for x in bounds)):
                    # Type mismatch. Promote all to float
                    param["bounds"] = [float(x) for x in bounds]

            parameters.append(param)
            parameters[-1]["name"] = key
        commandline_params = self.parse_commandline_args(arguments)
        for cmd_param in commandline_params:
            for param in parameters:
                if param["name"] == cmd_param["name"]:
                    for key, value in cmd_param.items():
                        param[key] = value
                    break
            else:
                parameters.append(cmd_param)

        log.info(
            f"AxSweeper is optimizing the following parameters: {encoder_parameters_into_string(parameters)}"
        )
        ax_client = AxClient(
            verbose_logging=self.ax_client_config.verbose_logging,
            random_seed=self.ax_client_config.random_seed,
        )
        ax_client.create_experiment(parameters=parameters, **self.experiment)

        return ax_client
def setup_ax_client ( self , arguments : List [ str ] ) -> AxClient : parameters : List [ Dict [ Any , Any ] ] = [ ] for key , value in self . ax_params . items ( ) : param = OmegaConf . to_container ( value , resolve = True ) assert isinstance ( param , Dict ) if param [ "type" ] == "range" : bounds = param [ "bounds" ] if not ( all ( isinstance ( x , int ) for x in bounds ) ) : # Type mismatch. Promote all to float param [ "bounds" ] = [ float ( x ) for x in bounds ] parameters . append ( param ) parameters [ - 1 ] [ "name" ] = key commandline_params = self . parse_commandline_args ( arguments ) for cmd_param in commandline_params : for param in parameters : if param [ "name" ] == cmd_param [ "name" ] : for key , value in cmd_param . items ( ) : param [ key ] = value break else : parameters . append ( cmd_param ) log . info ( f"AxSweeper is optimizing the following parameters: {encoder_parameters_into_string(parameters)}" ) ax_client = AxClient ( verbose_logging = self . ax_client_config . verbose_logging , random_seed = self . ax_client_config . random_seed , ) ax_client . create_experiment ( parameters = parameters , * * self . experiment ) return ax_client