class_docstr: Class for handling KGE models which follows the ranking based protocol.
  
  Example
  -------
  >>> # create model and compile using user defined optimizer settings and
  >>> # user defined settings of an existing loss
  >>> from ampligraph.datasets import load_fb15k_237
  >>> from ampligraph.latent_features import ScoringBasedEmbeddingModel
  >>> from ampligraph.latent_features.loss_functions import SelfAdversarialLoss
  >>> import tensorflow as tf
  >>> X = load_fb15k_237()
  >>> loss = SelfAdversarialLoss({'margin': 0.1, 'alpha': 5, 'reduction': 'sum'})
  >>> model = ScoringBasedEmbeddingModel(eta=5,
  >>>                                    k=300,
  >>>                                    scoring_type='ComplEx',
  >>>                                    seed=0)
  >>> model.compile(optimizer='adam', loss=loss)
  >>> model.fit(X['train'],
  >>>           batch_size=10000,
  >>>           epochs=5)
  Epoch 1/5
  29/29 [==============================] - 3s 87ms/step - loss: 13496.5752
  Epoch 2/5
  29/29 [==============================] - 1s 36ms/step - loss: 13488.8682
  Epoch 3/5
  29/29 [==============================] - 1s 35ms/step - loss: 13436.2725
  Epoch 4/5
  29/29 [==============================] - 1s 35ms/step - loss: 13259.0840
  Epoch 5/5
  29/29 [==============================] - 1s 34ms/step - loss: 12977.0117
class_docstr_tok: ["Class","for","handling","KGE","models","which","follows","the","ranking","based","protocol",".","Example","--","--","--","-",">",">",">","#","create","model","and","compile","using","user","defined","optimizer","settings","and",">",">",">","#","user","defined","settings","of","an","existing","loss",">",">",">","from","ampligraph.datasets","import","load_fb15k_237",">",">",">","from","ampligraph.latent_features","import","ScoringBasedEmbeddingModel",">",">",">","from","ampligraph.latent_features.loss_functions","import","SelfAdversarialLoss",">",">",">","import","tensorflow","as","tf",">",">",">","X","=","load_fb15k_237","(",")",">",">",">","loss","=","SelfAdversarialLoss","(","{","'margin","'",":","0.1",",","'alpha","'",":","5",",","'reduction","'",":","'sum","'","}",")",">",">",">","model","=","ScoringBasedEmbeddingModel","(","eta=5",",",">",">",">","k=300",",",">",">",">","scoring_type='ComplEx","'",",",">",">",">","seed=0",")",">",">",">","model.compile","(","optimizer='adam","'",",","loss=loss",")",">",">",">","model.fit","(","X","[","'train","'","]",",",">",">",">","batch_size=10000",",",">",">",">","epochs=5",")","Epoch","1\/5","29\/29","[","==============================","]","-","3s","87ms\/step","-","loss",":","13496.5752","Epoch","2\/5","29\/29","[","==============================","]","-","1s","36ms\/step","-","loss",":","13488.8682","Epoch","3\/5","29\/29","[","==============================","]","-","1s","35ms\/step","-","loss",":","13436.2725","Epoch","4\/5","29\/29","[","==============================","]","-","1s","35ms\/step","-","loss",":","13259.0840","Epoch","5\/5","29\/29","[","==============================","]","-","1s","34ms\/step","-","loss",":","12977.0117"]
docstr: Compile the model.
  
  Parameters
  ----------
  optimizer: str (name of optimizer) or optimizer instance
      The optimizer used to minimize the loss function. For pre-defined options, choose between
      `"sgd"`, `"adagrad"`, `"adam"`, `"rmsprop"`, etc.
      See `tf.keras.optimizers <https://www.tensorflow.org/api_docs/python/tf/keras/optimizers>`_
      for up-to-date details.
  
      If a string is passed, then the default parameters of the optimizer will be used.
  
      If you want to use custom hyperparameters you need to create an instance of the optimizer and
      pass the instance to the compile function ::
  
          import tensorflow as tf
          adam_opt = tf.keras.optimizers.Adam(learning_rate=0.003)
          model.compile(loss='pairwise', optim=adam_opt)
  
  loss: str (name of objective function), objective function or `ampligraph.latent_features.loss_functions.Loss`
  
      If a string is passed, you can use one of the following losses which will be used with their
      default setting:
  
      - `"pairwise"`:  the model will use the pairwise margin-based loss function.
      - `"nll"`: the model will use the negative loss likelihood.
      - `"absolute_margin"`: the model will use the absolute margin likelihood.
      - `"self_adversarial"`: the model will use the adversarial sampling loss function.
      - `"multiclass_nll"`: the model will use the multiclass nll loss. ::
  
          model.compile(loss='absolute_margin', optim='adam')
  
      If you want to modify the default parameters of the loss function, you need to explictly create an instance
      of the loss with required hyperparameters and then pass this instance. ::
  
          from ampligraph.latent_features import AbsoluteMarginLoss
          ab_loss = AbsoluteMarginLoss(loss_params={'margin': 3})
          model.compile(loss=ab_loss, optim='adam')
  
      An objective function is any callable with the signature
      ``loss = fn(score_true, score_corr, eta)`` ::
  
          # Create a user defined loss function with the above signature
          def userLoss(scores_pos, scores_neg):
              # user defined loss - takes in 2 params and returns loss
              neg_exp = tf.exp(scores_neg)
              pos_exp = tf.exp(scores_pos)
              # Apply softmax to the scores
              score = pos_exp / (tf.reduce_sum(neg_exp, axis=0) + pos_exp)
              loss = -tf.math.log(score)
              return loss
          # Pass this loss while compiling the model
          model.compile(loss=userLoss, optim='adam')
  
  entity_relation_initializer: str (name of initializer function), initializer function or         `tf.keras.initializers.Initializer` or list.
  
      Initializer of the entity and relation embeddings. This is either a single value or a list of size 2.
      If a single value is passed, then both the entities and relations will be initialized based on
      the same initializer; if a list, the first initializer will be used for entities and the second
      for relations.
  
      If a string is passed, then the default parameters will be used. Choose between
      `"random_normal"`, `"random_uniform"`, `"glorot_normal"`, `"he_normal"`, etc.
  
      See `tf.keras.initializers <https://www.tensorflow.org/api_docs/python/tf/keras/initializers>`_
      for up-to-date details. ::
  
          model.compile(loss='pairwise', optim='adam',
                        entity_relation_initializer='random_normal')
  
      If the user wants to use custom hyperparameters, then an instance of the
      ``tf.keras.initializers.Initializer`` needs to be passed. ::
  
          import tensorflow as tf
          init = tf.keras.initializers.RandomNormal(stddev=0.00003)
          model.compile(loss='pairwise', optim='adam',
                        entity_relation_initializer=init)
  
      If the user wants to define custom initializer it can be any callable with the signature `init = fn(shape)` ::
  
          def my_init(shape):
              return tf.random.normal(shape)
          model.compile(loss='pairwise', optim='adam',
                        entity_relation_initializer=my_init)
  
  entity_relation_regularizer: str (name of regularizer function) or regularizer function or         `tf.keras.regularizers.Regularizer` instance or list
      Regularizer of entities and relations.
      If a single value is passed, then both the entities and relations will be regularized based on
      the same regularizer; if a list, the first regularizer will be used for entities and second
      for relations.
  
      If a string is passed, then the default parameters of the regularizers will be used. Choose between
      `"l1"`, `"l2"`, `"l1_l2"`, etc.
  
      See `tf.keras.regularizers <https://www.tensorflow.org/api_docs/python/tf/keras/regularizers>`_
      for up-to-date details. ::
  
          model.compile(loss='pairwise', optim='adam',
                        entity_relation_regularizer='l2')
  
      If the user wants to use custom hyperparameters, then an instance of the
      ``tf.keras.regularizers.Regularizer`` needs to be passed. ::
  
          import tensorflow as tf
          reg = tf.keras.regularizers.L1L2(l1=0.001, l2=0.1)
          model.compile(loss='pairwise', optim='adam',
                        entity_relation_regularizer=reg)
  
      If the user wants to define custom regularizer it can be any callable with signature
      ``reg = fn(weight_matrix)``. ::
  
          def my_reg(weight_mx):
                return 0.01 * tf.math.reduce_sum(tf.math.abs(weight_mx))
          model.compile(loss='pairwise', optim='adam',
                        entity_relation_regularizer=my_reg)
  
  Example
  -------
  >>> from ampligraph.datasets import load_fb15k_237
  >>> from ampligraph.latent_features import ScoringBasedEmbeddingModel
  >>> X = load_fb15k_237()
  >>> model = ScoringBasedEmbeddingModel(eta=5,
  >>>                                    k=300,
  >>>                                    scoring_type='ComplEx',
  >>>                                    seed=0)
  >>> model.compile(optimizer='adam', loss='nll')
  >>> model.fit(X['train'],
  >>>           batch_size=10000,
  >>>           epochs=5)
  Epoch 1/5
  29/29 [==============================] - 2s 61ms/step - loss: 67361.3047
  Epoch 2/5
  29/29 [==============================] - 1s 35ms/step - loss: 67318.6094
  Epoch 3/5
  29/29 [==============================] - 1s 34ms/step - loss: 67020.0703
  Epoch 4/5
  29/29 [==============================] - 1s 34ms/step - loss: 65867.3750
  Epoch 5/5
  29/29 [==============================] - 1s 34ms/step - loss: 63517.9062
docstr_tok: ["Compile","the","model",".","Parameters","--","--","--","--","--","optimizer",":","str","(","name","of","optimizer",")","or","optimizer","instance","The","optimizer","used","to","minimize","the","loss","function",".","For","pre-defined","options",",","choose","between","`","``","sgd","''","`",",","`","``","adagrad","''","`",",","`","``","adam","''","`",",","`","``","rmsprop","''","`",",","etc",".","See","`","tf.keras.optimizers","<","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/keras\/optimizers",">","`","_","for","up-to-date","details",".","If","a","string","is","passed",",","then","the","default","parameters","of","the","optimizer","will","be","used",".","If","you","want","to","use","custom","hyperparameters","you","need","to","create","an","instance","of","the","optimizer","and","pass","the","instance","to","the","compile","function",":",":","import","tensorflow","as","tf","adam_opt","=","tf.keras.optimizers.Adam","(","learning_rate=0.003",")","model.compile","(","loss='pairwise","'",",","optim=adam_opt",")","loss",":","str","(","name","of","objective","function",")",",","objective","function","or","`","ampligraph.latent_features.loss_functions.Loss","`","If","a","string","is","passed",",","you","can","use","one","of","the","following","losses","which","will","be","used","with","their","default","setting",":","-","`","``","pairwise","''","`",":","the","model","will","use","the","pairwise","margin-based","loss","function",".","-","`","``","nll","''","`",":","the","model","will","use","the","negative","loss","likelihood",".","-","`","``","absolute_margin","''","`",":","the","model","will","use","the","absolute","margin","likelihood",".","-","`","``","self_adversarial","''","`",":","the","model","will","use","the","adversarial","sampling","loss","function",".","-","`","``","multiclass_nll","''","`",":","the","model","will","use","the","multiclass","nll","loss",".",":",":","model.compile","(","loss='absolute_margin","'",",","optim='adam","'",")","If","you","want","to","modify","the","default","parameters","of","the","loss","function",",","you","need","to","explictly","create","an","instance","of","the","loss","with","required","hyperparameters","and","then","pass","this","instance",".",":",":","from","ampligraph.latent_features","import","AbsoluteMarginLoss","ab_loss","=","AbsoluteMarginLoss","(","loss_params=","{","'margin","'",":","3","}",")","model.compile","(","loss=ab_loss",",","optim='adam","'",")","An","objective","function","is","any","callable","with","the","signature","``","loss","=","fn","(","score_true",",","score_corr",",","eta",")","``",":",":","#","Create","a","user","defined","loss","function","with","the","above","signature","def","userLoss","(","scores_pos",",","scores_neg",")",":","#","user","defined","loss","-","takes","in","2","params","and","returns","loss","neg_exp","=","tf.exp","(","scores_neg",")","pos_exp","=","tf.exp","(","scores_pos",")","#","Apply","softmax","to","the","scores","score","=","pos_exp","\/","(","tf.reduce_sum","(","neg_exp",",","axis=0",")","+","pos_exp",")","loss","=","-tf.math.log","(","score",")","return","loss","#","Pass","this","loss","while","compiling","the","model","model.compile","(","loss=userLoss",",","optim='adam","'",")","entity_relation_initializer",":","str","(","name","of","initializer","function",")",",","initializer","function","or","`","tf.keras.initializers.Initializer","`","or","list",".","Initializer","of","the","entity","and","relation","embeddings",".","This","is","either","a","single","value","or","a","list","of","size","2",".","If","a","single","value","is","passed",",","then","both","the","entities","and","relations","will","be","initialized","based","on","the","same","initializer",";","if","a","list",",","the","first","initializer","will","be","used","for","entities","and","the","second","for","relations",".","If","a","string","is","passed",",","then","the","default","parameters","will","be","used",".","Choose","between","`","``","random_normal","''","`",",","`","``","random_uniform","''","`",",","`","``","glorot_normal","''","`",",","`","``","he_normal","''","`",",","etc",".","See","`","tf.keras.initializers","<","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/keras\/initializers",">","`","_","for","up-to-date","details",".",":",":","model.compile","(","loss='pairwise","'",",","optim='adam","'",",","entity_relation_initializer='random_normal","'",")","If","the","user","wants","to","use","custom","hyperparameters",",","then","an","instance","of","the","``","tf.keras.initializers.Initializer","``","needs","to","be","passed",".",":",":","import","tensorflow","as","tf","init","=","tf.keras.initializers.RandomNormal","(","stddev=0.00003",")","model.compile","(","loss='pairwise","'",",","optim='adam","'",",","entity_relation_initializer=init",")","If","the","user","wants","to","define","custom","initializer","it","can","be","any","callable","with","the","signature","`","init","=","fn","(","shape",")","`",":",":","def","my_init","(","shape",")",":","return","tf.random.normal","(","shape",")","model.compile","(","loss='pairwise","'",",","optim='adam","'",",","entity_relation_initializer=my_init",")","entity_relation_regularizer",":","str","(","name","of","regularizer","function",")","or","regularizer","function","or","`","tf.keras.regularizers.Regularizer","`","instance","or","list","Regularizer","of","entities","and","relations",".","If","a","single","value","is","passed",",","then","both","the","entities","and","relations","will","be","regularized","based","on","the","same","regularizer",";","if","a","list",",","the","first","regularizer","will","be","used","for","entities","and","second","for","relations",".","If","a","string","is","passed",",","then","the","default","parameters","of","the","regularizers","will","be","used",".","Choose","between","`","``","l1","''","`",",","`","``","l2","''","`",",","`","``","l1_l2","''","`",",","etc",".","See","`","tf.keras.regularizers","<","https",":","\/\/www.tensorflow.org\/api_docs\/python\/tf\/keras\/regularizers",">","`","_","for","up-to-date","details",".",":",":","model.compile","(","loss='pairwise","'",",","optim='adam","'",",","entity_relation_regularizer='l2","'",")","If","the","user","wants","to","use","custom","hyperparameters",",","then","an","instance","of","the","``","tf.keras.regularizers.Regularizer","``","needs","to","be","passed",".",":",":","import","tensorflow","as","tf","reg","=","tf.keras.regularizers.L1L2","(","l1=0.001",",","l2=0.1",")","model.compile","(","loss='pairwise","'",",","optim='adam","'",",","entity_relation_regularizer=reg",")","If","the","user","wants","to","define","custom","regularizer","it","can","be","any","callable","with","signature","``","reg","=","fn","(","weight_matrix",")","``",".",":",":","def","my_reg","(","weight_mx",")",":","return","0.01","*","tf.math.reduce_sum","(","tf.math.abs","(","weight_mx",")",")","model.compile","(","loss='pairwise","'",",","optim='adam","'",",","entity_relation_regularizer=my_reg",")","Example","--","--","--","-",">",">",">","from","ampligraph.datasets","import","load_fb15k_237",">",">",">","from","ampligraph.latent_features","import","ScoringBasedEmbeddingModel",">",">",">","X","=","load_fb15k_237","(",")",">",">",">","model","=","ScoringBasedEmbeddingModel","(","eta=5",",",">",">",">","k=300",",",">",">",">","scoring_type='ComplEx","'",",",">",">",">","seed=0",")",">",">",">","model.compile","(","optimizer='adam","'",",","loss='nll","'",")",">",">",">","model.fit","(","X","[","'train","'","]",",",">",">",">","batch_size=10000",",",">",">",">","epochs=5",")","Epoch","1\/5","29\/29","[","==============================","]","-","2s","61ms\/step","-","loss",":","67361.3047","Epoch","2\/5","29\/29","[","==============================","]","-","1s","35ms\/step","-","loss",":","67318.6094","Epoch","3\/5","29\/29","[","==============================","]","-","1s","34ms\/step","-","loss",":","67020.0703","Epoch","4\/5","29\/29","[","==============================","]","-","1s","34ms\/step","-","loss",":","65867.3750","Epoch","5\/5","29\/29","[","==============================","]","-","1s","34ms\/step","-","loss",":","63517.9062"]
code: def compile(
      self,
      optimizer="adam",
      loss=None,
      entity_relation_initializer="glorot_uniform",
      entity_relation_regularizer=None,
      **kwargs,
  ):
      """ Compile the model.
  
          Parameters
          ----------
          optimizer: str (name of optimizer) or optimizer instance
              The optimizer used to minimize the loss function. For pre-defined options, choose between
              `"sgd"`, `"adagrad"`, `"adam"`, `"rmsprop"`, etc.
              See `tf.keras.optimizers <https://www.tensorflow.org/api_docs/python/tf/keras/optimizers>`_
              for up-to-date details.
  
              If a string is passed, then the default parameters of the optimizer will be used.
  
              If you want to use custom hyperparameters you need to create an instance of the optimizer and
              pass the instance to the compile function ::
  
                  import tensorflow as tf
                  adam_opt = tf.keras.optimizers.Adam(learning_rate=0.003)
                  model.compile(loss='pairwise', optim=adam_opt)
  
          loss: str (name of objective function), objective function or `ampligraph.latent_features.loss_functions.Loss`
  
              If a string is passed, you can use one of the following losses which will be used with their
              default setting:
  
              - `"pairwise"`:  the model will use the pairwise margin-based loss function.
              - `"nll"`: the model will use the negative loss likelihood.
              - `"absolute_margin"`: the model will use the absolute margin likelihood.
              - `"self_adversarial"`: the model will use the adversarial sampling loss function.
              - `"multiclass_nll"`: the model will use the multiclass nll loss. ::
  
                  model.compile(loss='absolute_margin', optim='adam')
  
              If you want to modify the default parameters of the loss function, you need to explictly create an instance
              of the loss with required hyperparameters and then pass this instance. ::
  
                  from ampligraph.latent_features import AbsoluteMarginLoss
                  ab_loss = AbsoluteMarginLoss(loss_params={'margin': 3})
                  model.compile(loss=ab_loss, optim='adam')
  
              An objective function is any callable with the signature
              ``loss = fn(score_true, score_corr, eta)`` ::
  
                  # Create a user defined loss function with the above signature
                  def userLoss(scores_pos, scores_neg):
                      # user defined loss - takes in 2 params and returns loss
                      neg_exp = tf.exp(scores_neg)
                      pos_exp = tf.exp(scores_pos)
                      # Apply softmax to the scores
                      score = pos_exp / (tf.reduce_sum(neg_exp, axis=0) + pos_exp)
                      loss = -tf.math.log(score)
                      return loss
                  # Pass this loss while compiling the model
                  model.compile(loss=userLoss, optim='adam')
  
          entity_relation_initializer: str (name of initializer function), initializer function or \
          `tf.keras.initializers.Initializer` or list.
  
              Initializer of the entity and relation embeddings. This is either a single value or a list of size 2.
              If a single value is passed, then both the entities and relations will be initialized based on
              the same initializer; if a list, the first initializer will be used for entities and the second
              for relations.
  
              If a string is passed, then the default parameters will be used. Choose between
              `"random_normal"`, `"random_uniform"`, `"glorot_normal"`, `"he_normal"`, etc.
  
              See `tf.keras.initializers <https://www.tensorflow.org/api_docs/python/tf/keras/initializers>`_
              for up-to-date details. ::
  
                  model.compile(loss='pairwise', optim='adam',
                                entity_relation_initializer='random_normal')
  
              If the user wants to use custom hyperparameters, then an instance of the
              ``tf.keras.initializers.Initializer`` needs to be passed. ::
  
                  import tensorflow as tf
                  init = tf.keras.initializers.RandomNormal(stddev=0.00003)
                  model.compile(loss='pairwise', optim='adam',
                                entity_relation_initializer=init)
  
              If the user wants to define custom initializer it can be any callable with the signature `init = fn(shape)` ::
  
                  def my_init(shape):
                      return tf.random.normal(shape)
                  model.compile(loss='pairwise', optim='adam',
                                entity_relation_initializer=my_init)
  
          entity_relation_regularizer: str (name of regularizer function) or regularizer function or \
          `tf.keras.regularizers.Regularizer` instance or list
              Regularizer of entities and relations.
              If a single value is passed, then both the entities and relations will be regularized based on
              the same regularizer; if a list, the first regularizer will be used for entities and second
              for relations.
  
              If a string is passed, then the default parameters of the regularizers will be used. Choose between
              `"l1"`, `"l2"`, `"l1_l2"`, etc.
  
              See `tf.keras.regularizers <https://www.tensorflow.org/api_docs/python/tf/keras/regularizers>`_
              for up-to-date details. ::
  
                  model.compile(loss='pairwise', optim='adam',
                                entity_relation_regularizer='l2')
  
              If the user wants to use custom hyperparameters, then an instance of the
              ``tf.keras.regularizers.Regularizer`` needs to be passed. ::
  
                  import tensorflow as tf
                  reg = tf.keras.regularizers.L1L2(l1=0.001, l2=0.1)
                  model.compile(loss='pairwise', optim='adam',
                                entity_relation_regularizer=reg)
  
              If the user wants to define custom regularizer it can be any callable with signature
              ``reg = fn(weight_matrix)``. ::
  
                  def my_reg(weight_mx):
                        return 0.01 * tf.math.reduce_sum(tf.math.abs(weight_mx))
                  model.compile(loss='pairwise', optim='adam',
                                entity_relation_regularizer=my_reg)
  
          Example
          -------
          >>> from ampligraph.datasets import load_fb15k_237
          >>> from ampligraph.latent_features import ScoringBasedEmbeddingModel
          >>> X = load_fb15k_237()
          >>> model = ScoringBasedEmbeddingModel(eta=5,
          >>>                                    k=300,
          >>>                                    scoring_type='ComplEx',
          >>>                                    seed=0)
          >>> model.compile(optimizer='adam', loss='nll')
          >>> model.fit(X['train'],
          >>>           batch_size=10000,
          >>>           epochs=5)
          Epoch 1/5
          29/29 [==============================] - 2s 61ms/step - loss: 67361.3047
          Epoch 2/5
          29/29 [==============================] - 1s 35ms/step - loss: 67318.6094
          Epoch 3/5
          29/29 [==============================] - 1s 34ms/step - loss: 67020.0703
          Epoch 4/5
          29/29 [==============================] - 1s 34ms/step - loss: 65867.3750
          Epoch 5/5
          29/29 [==============================] - 1s 34ms/step - loss: 63517.9062
  
          """
      # get the optimizer
      self.optimizer = optimizers.get(optimizer)
      self._run_eagerly = kwargs.pop("run_eagerly", None)
      # reset the training/evaluate/predict function
      self._reset_compile_cache()
  
      # get the loss
      self.compiled_loss = loss_functions.get(loss)
      # Only metric supported during the training is mean Loss
      self.compiled_metrics = compile_utils.MetricsContainer(
          metrics_mod.Mean(name="loss"), None, None
      )  # Total loss.
  
      # set the initializer and regularizer of the embedding matrices in the
      # encoding layer
      self.encoding_layer.set_initializer(entity_relation_initializer)
      self.encoding_layer.set_regularizer(entity_relation_regularizer)
      self._is_compiled = True
  
imports: import tensorflow
  import copy
  import shelve
  import pickle
  import numpy
  import os
  import tempfile
  import logging
  from ampligraph.evaluation.metrics import mrr_score, hits_at_n_score, mr_score
  from ampligraph.datasets import data_adapter
  from ampligraph.datasets.partitioned_data_manager import PartitionDataManager
  from ampligraph.latent_features.layers.scoring.AbstractScoringLayer import SCORING_LAYER_REGISTRY
  from ampligraph.latent_features.layers.encoding import EmbeddingLookupLayer
  from ampligraph.latent_features.layers.calibration import CalibrationLayer
  from ampligraph.latent_features.layers.corruption_generation import CorruptionGenerationLayerTrain
  from ampligraph.datasets.data_indexer import DataIndexer
  from ampligraph.latent_features import optimizers
  from ampligraph.latent_features import loss_functions
  from ampligraph.evaluation import train_test_split_no_unseen
  from tensorflow.python.keras import callbacks
  from tensorflow.python.keras.engine import training_utils
  from tensorflow.python.eager import def_function
  from tensorflow.python.keras import metrics
  from tensorflow.python.keras.engine import compile_utils
label_desc: Use image node_id 25 for calling the ScoringBasedEmbeddingModel obj's underlying member method code with example usage: obj.compile(optimizer, loss, entity_relation_initializer, entity_relation_regularizer) without return types