restore_model

ampligraph.latent_features.restore_model(loc)

Restore a saved model from disk.

Examples

>>> from ampligraph.latent_features import restore_model
>>> import numpy as np
>>> EXAMPLE_LOC = 'saved_models' # Assuming that the model is present at this location
>>> restored_model = restore_model(EXAMPLE_LOC)
>>> y_pred_after = restored_model.predict(np.array([['f', 'y', 'e'], ['b', 'y', 'd']]))
>>> print(y_pred_after)
[1.261404, -1.324778]
Parameters:loc (string) – Directory containing the saved model
Returns:model – a neural knowledge graph embedding model
Return type:trained model