def __init__(self, config: dict, enable_tune: bool = False, **kwargs):
     super().__init__(config=config, enable_tune=enable_tune, **kwargs)
     exp_params = config['exp_params']
     input_shape = get_example_shape(exp_params['data'])
     localizer = create_model(**config['model_params'],
                              input_shape=input_shape)
     self.localizer = localizer
Пример #2
0
def vae1d(config: dict, run_args: dict) -> VAEExperiment:
    exp_params = config['exp_params']
    c, l = get_example_shape(exp_params['data'])
    model = create_model(**config['model_params'], num_samples=l, channels=c)
    return VAEExperiment(model,
                         params=exp_params,
                         enable_tune=run_args.get('enable_tune', False))
Пример #3
0
def vae3d(config: dict, run_args: dict) -> VAEExperiment:
    exp_params = config['exp_params']
    c, d, h, w = get_example_shape(exp_params['data'])
    model = create_model(**config['model_params'],
                         width=w,
                         height=h,
                         depth=d,
                         channels=c)
    return VAEExperiment(model, params=exp_params)
 def __init__(self, config: dict, enable_tune: bool = False, **kwargs):
     super().__init__(config=config, enable_tune=enable_tune, **kwargs)
     input_shape = get_example_shape(config['exp_params']['data'])
     self.constraint = create_model(**config['constraint_params'],
                                    input_shape=input_shape)
     self.constraint.requires_grad = False
     self.constraint.eval()
     self.model = create_model(**config['model_params'],
                               input_shape=input_shape)
Пример #5
0
def classification_embed2d(config: dict, run_args: dict):
    base_experiment, _ = experiment_main(
        load_config(config['base_experiment']), run_args)
    encoder = base_experiment.model.get_encoder()
    encoder.requires_grad = False
    exp_params = config['exp_params']
    c, h, w = get_example_shape(exp_params['data'])
    model = create_model(**config['model_params'],
                         width=w,
                         height=h,
                         channels=c,
                         encoder=encoder)
    return ClassificationExperiment(model, params=exp_params)
Пример #6
0
 def __init__(self,
              config: dict,
              enable_tune: bool = False,
              **kwargs) -> None:
     super(VAEExperiment, self).__init__(config=config,
                                         enable_tune=enable_tune,
                                         **kwargs)
     params = config['exp_params']
     c, h, w = get_example_shape(params['data'])
     self.model = create_model(**config['model_params'],
                               width=w,
                               height=h,
                               channels=c,
                               enable_fid='fid_weight' in params,
                               progressive_growing=len(
                                   params['progressive_growing'])
                               if 'progressive_growing' in params else 0)
 def __init__(self, config: dict, enable_tune: bool = False, **kwargs):
     super().__init__(config=config, enable_tune=enable_tune, **kwargs)
     self.classifier = create_model(**config['model_params'],
                                    input_shape=get_example_shape(
                                        config['exp_params']['data']))