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
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
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