- class LiteralModel(triples_factory, interaction, entity_representations, relation_representations=None, **kwargs)¶
Base class for models with entity literals that uses combinations from
Initialize the module.
TriplesNumericLiteralsFactory) – The triples factory facilitates access to the dataset.
LiteralInteraction) – The interaction module (e.g., TransE)
interaction_kwargs – Additional key-word based parameters given to the interaction module’s constructor, if not already instantiated.
RepresentationModule]]]) – The relation representation or sequence of representations
loss – The loss to use. If None is given, use the loss default specific to the model subclass.
predict_with_sigmoid – Whether to apply sigmoid onto the scores when predicting scores. Applying sigmoid at prediction time may lead to exactly equal scores for certain triples with very high, or very low score. When not trained with applying sigmoid (or using BCEWithLogitsLoss), the scores are not calibrated to perform well with sigmoid.
preferred_device – The preferred device for model training and inference.
random_seed – A random seed to use for initialising the model’s weights. Should be set when aiming at reproducibility.