Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self,
k=constants.DEFAULT_EMBEDDING_SIZE,
eta=constants.DEFAULT_ETA,
epochs=constants.DEFAULT_EPOCH,
batches_count=constants.DEFAULT_BATCH_COUNT,
seed=constants.DEFAULT_SEED,
embedding_model_params={},
optimizer=constants.DEFAULT_OPTIM,
optimizer_params={'lr': constants.DEFAULT_LR},
loss=constants.DEFAULT_LOSS,
loss_params={},
regularizer=constants.DEFAULT_REGULARIZER,
regularizer_params={},
initializer=constants.DEFAULT_INITIALIZER,
initializer_params={'uniform': DEFAULT_XAVIER_IS_UNIFORM},
large_graphs=False,
verbose=constants.DEFAULT_VERBOSE):
"""Initialize an EmbeddingModel
Also creates a new Tensorflow session for training.
Parameters
def __init__(self,
k=constants.DEFAULT_EMBEDDING_SIZE,
eta=constants.DEFAULT_ETA,
epochs=constants.DEFAULT_EPOCH,
batches_count=constants.DEFAULT_BATCH_COUNT,
seed=constants.DEFAULT_SEED,
embedding_model_params={'negative_corruption_entities': constants.DEFAULT_CORRUPTION_ENTITIES,
'corrupt_sides': constants.DEFAULT_CORRUPT_SIDE_TRAIN},
optimizer=constants.DEFAULT_OPTIM,
optimizer_params={'lr': constants.DEFAULT_LR},
loss=constants.DEFAULT_LOSS,
loss_params={},
regularizer=constants.DEFAULT_REGULARIZER,
regularizer_params={},
initializer=constants.DEFAULT_INITIALIZER,
initializer_params={'uniform': DEFAULT_XAVIER_IS_UNIFORM},
verbose=constants.DEFAULT_VERBOSE):
"""Initialize an EmbeddingModel
Also creates a new Tensorflow session for training.
Parameters
def __init__(self,
k=constants.DEFAULT_EMBEDDING_SIZE,
eta=constants.DEFAULT_ETA,
epochs=constants.DEFAULT_EPOCH,
batches_count=constants.DEFAULT_BATCH_COUNT,
seed=constants.DEFAULT_SEED,
embedding_model_params={'norm': constants.DEFAULT_NORM_TRANSE,
'normalize_ent_emb': constants.DEFAULT_NORMALIZE_EMBEDDINGS,
'negative_corruption_entities': constants.DEFAULT_CORRUPTION_ENTITIES,
'corrupt_sides': constants.DEFAULT_CORRUPT_SIDE_TRAIN},
optimizer=constants.DEFAULT_OPTIM,
optimizer_params={'lr': constants.DEFAULT_LR},
loss=constants.DEFAULT_LOSS,
loss_params={},
regularizer=constants.DEFAULT_REGULARIZER,
regularizer_params={},
initializer=constants.DEFAULT_INITIALIZER,
initializer_params={'uniform': DEFAULT_XAVIER_IS_UNIFORM},
verbose=constants.DEFAULT_VERBOSE):
"""
Initialize an EmbeddingModel.
def __init__(self,
k=constants.DEFAULT_EMBEDDING_SIZE,
eta=constants.DEFAULT_ETA,
epochs=constants.DEFAULT_EPOCH,
batches_count=constants.DEFAULT_BATCH_COUNT,
seed=constants.DEFAULT_SEED,
embedding_model_params={'num_filters': 32,
'filter_sizes': [1],
'dropout': 0.1},
optimizer=constants.DEFAULT_OPTIM,
optimizer_params={'lr': constants.DEFAULT_LR},
loss=constants.DEFAULT_LOSS,
loss_params={},
regularizer=constants.DEFAULT_REGULARIZER,
regularizer_params={},
initializer=constants.DEFAULT_INITIALIZER,
initializer_params={'uniform': DEFAULT_XAVIER_IS_UNIFORM},
large_graphs=False,
verbose=constants.DEFAULT_VERBOSE):
"""Initialize an EmbeddingModel
Parameters
def __init__(self, seed=constants.DEFAULT_SEED):
"""Initialize the model
Parameters
----------
seed : int
The seed used by the internal random numbers generator.
"""
super().__init__(k=1, eta=1, epochs=1, batches_count=1, seed=seed, verbose=False)
def __init__(self,
k=constants.DEFAULT_EMBEDDING_SIZE,
eta=constants.DEFAULT_ETA,
epochs=constants.DEFAULT_EPOCH,
batches_count=constants.DEFAULT_BATCH_COUNT,
seed=constants.DEFAULT_SEED,
embedding_model_params={'negative_corruption_entities': constants.DEFAULT_CORRUPTION_ENTITIES,
'corrupt_sides': constants.DEFAULT_CORRUPT_SIDE_TRAIN},
optimizer=constants.DEFAULT_OPTIM,
optimizer_params={'lr': constants.DEFAULT_LR},
loss=constants.DEFAULT_LOSS,
loss_params={},
regularizer=constants.DEFAULT_REGULARIZER,
regularizer_params={},
initializer=constants.DEFAULT_INITIALIZER,
initializer_params={'uniform': DEFAULT_XAVIER_IS_UNIFORM},
verbose=constants.DEFAULT_VERBOSE):
"""Initialize an EmbeddingModel
Also creates a new Tensorflow session for training.
Parameters
def __init__(self,
k=constants.DEFAULT_EMBEDDING_SIZE,
eta=constants.DEFAULT_ETA,
epochs=constants.DEFAULT_EPOCH,
batches_count=constants.DEFAULT_BATCH_COUNT,
seed=constants.DEFAULT_SEED,
embedding_model_params={'normalize_ent_emb': constants.DEFAULT_NORMALIZE_EMBEDDINGS,
'negative_corruption_entities': constants.DEFAULT_CORRUPTION_ENTITIES,
'corrupt_sides': constants.DEFAULT_CORRUPT_SIDE_TRAIN},
optimizer=constants.DEFAULT_OPTIM,
optimizer_params={'lr': constants.DEFAULT_LR},
loss=constants.DEFAULT_LOSS,
loss_params={},
regularizer=constants.DEFAULT_REGULARIZER,
regularizer_params={},
initializer=constants.DEFAULT_INITIALIZER,
initializer_params={'uniform': DEFAULT_XAVIER_IS_UNIFORM},
verbose=constants.DEFAULT_VERBOSE):
"""Initialize an EmbeddingModel
Also creates a new Tensorflow session for training.