def meta_args_to_add(cls) -> [MetaArgument]: return [ MetaArgument('cls_pbt_targets', Register.optimization_targets, allow_duplicates=True, help_name='optimization target(s)'), MetaArgument('cls_pbt_mutations', Register.pbt_mutations, help_name='mutations to the copied checkpoint training state'), ]
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ return super().meta_args_to_add() + [ MetaArgument('cls_network_stem', Register.network_stems, help_name='network stem', allowed_num=1, optional_for_loading=True), MetaArgument('cls_network_heads', Register.network_heads, help_name='network heads', allow_duplicates=True, optional_for_loading=True), MetaArgument('cls_network_cells', Register.network_cells, help_name='network cells', allow_duplicates=True), MetaArgument('cls_network_cells_primitives', Register.primitive_sets, help_name='network cells primitives', allow_duplicates=True), ]
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ kwargs = Register.get_my_kwargs(cls) methods = Register.methods.filter_match_all(search=kwargs.get('search')) return super().meta_args_to_add() + [ MetaArgument('cls_device', Register.devices_managers, help_name='device manager', allowed_num=1), MetaArgument('cls_trainer', Register.trainers, help_name='trainer', allowed_num=1), MetaArgument('cls_method', methods, help_name='method', allowed_num=1), ]
def meta_args_to_add(cls) -> [MetaArgument]: return [ MetaArgument('cls_hpo_pymoo_sampler', Register.hpo_pymoo_samplers, help_name='sampling method', allowed_num=1), MetaArgument('cls_hpo_pymoo_crossover', Register.hpo_pymoo_crossovers, help_name='crossover method', allowed_num=1), MetaArgument('cls_hpo_pymoo_mutation', Register.hpo_pymoo_mutations, help_name='mutation method', allowed_num=1), ]
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ return super().meta_args_to_add() + [ MetaArgument('cls_network_body', Register.network_bodies, help_name='network', allowed_num=1), ]
def meta_args_to_add(cls, has_log_dict=True) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ callbacks = Register.training_callbacks if not has_log_dict: callbacks = callbacks.filter_match_all(requires_log_dict=False) return super().meta_args_to_add() + [ MetaArgument('cls_callbacks', callbacks, help_name='training callbacks', allow_duplicates=True), MetaArgument('cls_exp_loggers', Register.exp_loggers, help_name='experiment logger', allow_duplicates=True), ]
def meta_args_to_add(cls) -> [MetaArgument]: return [ MetaArgument( 'cls_pbt_selector', Register.pbt_selectors, allowed_num=1, help_name= 'selector to decide which checkpoints to keep and pursue'), ]
def meta_args_to_add(cls, estimator_filter: dict = None) -> [MetaArgument]: estimators = Register.hpo_estimators if isinstance(estimator_filter, dict): estimators = estimators.filter_match_all(**estimator_filter) return [ MetaArgument('cls_hpo_estimators', estimators, help_name='performance estimators', allowed_num=(1, -1), allow_duplicates=True), MetaArgument('cls_hpo_pymoo_algorithm', Register.hpo_pymoo_algorithms, help_name='hyper-parameter algorithm', allowed_num=1), MetaArgument('cls_hpo_pymoo_termination', Register.hpo_pymoo_terminators, help_name='algorithm termination criteria', allowed_num=1), ]
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ kwargs = Register.get_my_kwargs(cls) aug_sets = Register.augmentation_sets.filter_match_all(on_images=kwargs.get('images')) return super().meta_args_to_add() + [ MetaArgument('cls_augmentations', aug_sets, help_name='data augmentation'), ]
def meta_args_to_add(cls, num_optimizers=1) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ return super().meta_args_to_add() + [ MetaArgument('cls_profile_fun', Register.profile_functions, help_name='profile function', allowed_num=1), ]
def meta_args_to_add(cls, estimator_filter: dict = None, algorithm=True) -> [MetaArgument]: estimators = Register.hpo_estimators if isinstance(estimator_filter, dict): estimators = estimators.filter_match_all(**estimator_filter) meta = [ MetaArgument('cls_hpo_estimators', estimators, help_name='estimator', allow_duplicates=True, allowed_num=(1, -1)) ] if algorithm: meta.append( MetaArgument('cls_hpo_self_algorithm', Register.hpo_self_algorithms, help_name='hyper-parameter optimizer', allowed_num=1)) return meta
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ networks = Register.networks.filter_match_all(search=True) return super().meta_args_to_add() + [ MetaArgument('cls_device', Register.devices_managers, help_name='device manager', allowed_num=1), MetaArgument('cls_profiler', Register.profilers, help_name='profiler', allowed_num=1), MetaArgument('cls_data', Register.data_sets, help_name='data set', allowed_num=1), MetaArgument( 'cls_network', networks, help_name='network', allowed_num=1), ]
def meta_args_to_add(cls, algorithm=True) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ benchmark_sets = Register.benchmark_sets.filter_match_all(mini=True, tabular=True) return super().meta_args_to_add(algorithm=algorithm) + [ MetaArgument('cls_benchmark', benchmark_sets, allowed_num=1, help_name='mini benchmark set to optimize on'), ]
def meta_args_to_add(cls, algorithm=True) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ benchmark_sets = Register.benchmark_sets.filter_match_all(mini=True, tabular=True) return super().meta_args_to_add(algorithm=algorithm) + [ MetaArgument( 'cls_benchmarks', benchmark_sets, help_name= 'optional benchmark sets, to evaluate specific architectures'), ]
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ return super().meta_args_to_add() + [ MetaArgument( 'cls_benchmark', Register.benchmark_sets, allowed_num=(0, 1), use_index=False, help_name= 'immediately look up the search result in this benchmark set (optional)' ), ]
def meta_args_to_add(cls) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ benchmark_sets = Register.benchmark_sets.filter_match_all(mini=True, tabular=True) return super().meta_args_to_add() + [ MetaArgument( 'cls_benchmarks', benchmark_sets, allowed_num=(2, -1), allow_duplicates=True, help_name='mini benchmark sets to correlate with each other'), ] + SelfHPOUtils.meta_args_to_add( algorithm=True, estimator_filter=dict(requires_bench=True))
def meta_args_to_add(cls, num_optimizers=1, search=True) -> [MetaArgument]: """ list meta arguments to add to argparse for when this class is chosen, classes specified in meta arguments may have their own respective arguments """ kwargs = Register.get_my_kwargs(cls) metrics = Register.metrics.filter_match_all( distill=kwargs.get('distill')) criteria = Register.criteria.filter_match_all( distill=kwargs.get('distill')) networks = Register.networks.filter_match_all(search=search) return super().meta_args_to_add() + [ MetaArgument('cls_data', Register.data_sets, help_name='data set', allowed_num=1), MetaArgument( 'cls_network', networks, help_name='network', allowed_num=1), MetaArgument('cls_criterion', criteria, help_name='criterion', allowed_num=1), MetaArgument('cls_metrics', metrics, help_name='training metric'), MetaArgument('cls_initializers', Register.initializers, help_name='weight initializer'), MetaArgument('cls_regularizers', Register.regularizers, help_name='regularizer'), MetaArgument('cls_optimizers', Register.optimizers, help_name='optimizer', allow_duplicates=True, allowed_num=num_optimizers, use_index=True), MetaArgument('cls_schedulers', Register.schedulers, help_name='scheduler', allow_duplicates=True, allowed_num=(0, num_optimizers), use_index=True), ]
def __init__(self, master, interactive: Interactive, node: GuiArgsTreeNode, meta: MetaArgument): self._config_enabled = False super().__init__(master, borderwidth=sizes.get('borderwidth'), text="%s (allowed: %s)" % (meta.argument.name, meta.limit_str()), relief=None, show=True) self.interactive = interactive self.node = node self.meta = meta self.children_widgets = [] self.str_add = '+' self.str_rem = '-' area_bottom = tk.Frame(master=self.sub_frame, bg=colors.get('background_default')) area_bottom.pack(side=tk.BOTTOM, expand=1, fill=tk.X) self.var_rem_str = tk.StringVar(value=self.str_rem) self.var_rem_str.trace_add('write', self._cb_rem_str) self.rem_menu_button = tk.Menubutton(self.title_frame, text=self.str_rem, borderwidth=1, relief="raised", indicatoron=True) self.rem_menu = tk.Menu(self.rem_menu_button, tearoff=False) self.rem_menu_button.configure(menu=self.rem_menu) self.rem_menu_button.pack(side=tk.RIGHT) self.var_add_str = tk.StringVar(value=self.str_add) self.var_add_str.trace_add('write', self._cb_add_str) self.add_menu_button = tk.Menubutton(self.title_frame, text=self.str_add, borderwidth=1, relief="raised", indicatoron=True) self.add_menu = tk.Menu(self.add_menu_button, tearoff=False) self.add_menu_button.configure(menu=self.add_menu) self.add_menu_button.pack(side=tk.RIGHT)