def get_model(model, n_ents, n_rels, ent_dim): if model == 'rescal': return models.Rescal(n_ents, n_rels, ent_dim) elif model == 'transE': return models.TransE(n_ents, n_rels, ent_dim) elif model == 'distmult': return models.Distmult(n_ents, n_rels, ent_dim) elif model == 'complex': return models.ComplEx(n_ents, n_rels, ent_dim) else: raise NotImplementedError("Model {} not implemented".format(model))
def get_model(): if config['model']=='rescal': return models.Rescal(n_ents,n_rels,config['ent_dim']) elif config['model']=='transE': return models.TransE(n_ents, n_rels, config['ent_dim']) elif config['model']=='distmult': return models.Distmult(n_ents, n_rels, config['ent_dim']) elif config['model']=='complex': return models.ComplEx(n_ents, n_rels, config['ent_dim']) else: raise NotImplementedError("Model {} not implemented".format(config['model']))