def export_trial_configuration(self, trial): default_conf = ModelConfig() new_conf = trial.space_sample.DT_Module.config conf_set = [] for f in default_conf._fields: if new_conf.__getattribute__(f) != default_conf.__getattribute__(f): conf_set.append(f'\n\t{f}={new_conf.__getattribute__(f)}') str = f'ModelConfig({",".join(conf_set)})\n\nfit params:{trial.space_sample.fit_params.param_values}' return str
def _compile(self): self.config = ModelConfig(**self.param_values)