コード例 #1
0
def construct_model(conf, model_name, **kwargs):
    params = conf.to_param_dict(RECNET_REQUIRED_PARAMS, RECNET_OPTIONAL_PARAMS)
    model = RecNet(**params)
    for block in model.conv_blocks:
        initialize_weights(block, conf.get_attr('weight_init', default={}))

    return model
コード例 #2
0
def construct_model(conf, model_name, **kwargs):
  if model_name == 'CNNDiscriminator':
    params = conf.to_param_dict(REQUIRED_PARAMS, OPTIONAL_PARAMS)
    model = CNNDiscriminator(**params)
    initialize_weights(model, conf.get_attr('weight_init', default={}))
  else:
    raise ValueError('Unknown discriminator {}'.format(model_name))
  return model
コード例 #3
0
ファイル: unet.py プロジェクト: wenxiang2333/csmri-refinement
def construct_model(conf, model_name, **kwargs):
    params = conf.to_param_dict(REQUIRED_PARAMS, OPTIONAL_PARAMS)
    model = UNET(**params)
    initialize_weights(model, conf.get_attr('weight_init', default={}))
    return model