docstr: Initialize the model class.
  
  Parameters
  ----------
  k : int
      Embedding space dimensionality.
  eta : int
      The number of negatives that must be generated at runtime during
      training for each positive.
  epochs : int
      The iterations of the training loop.
  batches_count : int
      The number of batches in which the training set must be split
      during the training loop.
  seed : int
      The seed used by the internal random numbers generator.
  embedding_model_params : dict
      Model-specific hyperparams, passed to the model as a dictionary.
      Refer to model-specific documentation for details.
  optimizer : str
      The optimizer used to minimize the loss function. Choose between
      'sgd', 'adagrad', 'adam', 'momentum'.
  optimizer_params : dict
      Arguments specific to the optimizer, passed as a dictionary.
      Supported keys:
  
      - **'lr'** (float): learning rate (used by all the optimizers).
      Default: 0.1.
      - **'momentum'** (float): learning momentum
      (only used when ``optimizer=momentum``). Default: 0.9.
  
  loss : str
      The type of loss function to use during training.
  
      - `"pairwise"`  the model will use pairwise margin-based
      loss function.
      - `"nll"` the model will use negative loss likelihood.
      - `"absolute_margin"` the model will use absolute
      margin likelihood.
      - `"self_adversarial"` the model will use adversarial sampling
      loss function.
      - `"multiclass_nll"` the model will use multiclass nll loss.
      Switch to multiclass loss defined in             :cite:`chen2015` by passing ``"corrupt_side"`` as `["s","o"]` to
      ``embedding_model_params``. To use loss defined in                    :cite:`kadlecBK17` pass ``"corrupt_side"``                    as `"o"` to embedding_model_params.
  
  loss_params : dict
      Dictionary of loss-specific hyperparameters.
  regularizer : str
      The regularization strategy to use with the loss function.
  
      - `None`: the model will not use any regularizer (default)
      - `LP`: the model will use :math:`L^1, L^2` or :math:`L^3`
      regularization based on the value of
      ``regularizer_params['p']`` in the ``regularizer_params``.
  
  regularizer_params : dict
      Dictionary of regularizer-specific hyperparameters.
  initializer : str
      The type of initializer to use.
  
      - `"normal"`: The embeddings will be initialized from a normal
      distribution
      - `"uniform"`: The embeddings will be initialized from a uniform
      distribution
      - `"xavier"`: The embeddings will be initialized using xavier
      strategy (default)
  
  initializer_params : dict
      Dictionary of initializer-specific hyperparameters.
  verbose : bool
      Verbose mode.
docstr_tok: ["Initialize","the","model","class",".","Parameters","--","--","--","--","--","k",":","int","Embedding","space","dimensionality",".","eta",":","int","The","number","of","negatives","that","must","be","generated","at","runtime","during","training","for","each","positive",".","epochs",":","int","The","iterations","of","the","training","loop",".","batches_count",":","int","The","number","of","batches","in","which","the","training","set","must","be","split","during","the","training","loop",".","seed",":","int","The","seed","used","by","the","internal","random","numbers","generator",".","embedding_model_params",":","dict","Model-specific","hyperparams",",","passed","to","the","model","as","a","dictionary",".","Refer","to","model-specific","documentation","for","details",".","optimizer",":","str","The","optimizer","used","to","minimize","the","loss","function",".","Choose","between","'sgd","'",",","'adagrad","'",",","'adam","'",",","'momentum","'",".","optimizer_params",":","dict","Arguments","specific","to","the","optimizer",",","passed","as","a","dictionary",".","Supported","keys",":","-","*","*","'lr","'","*","*","(","float",")",":","learning","rate","(","used","by","all","the","optimizers",")",".","Default",":","0.1",".","-","*","*","'momentum","'","*","*","(","float",")",":","learning","momentum","(","only","used","when","``","optimizer=momentum","``",")",".","Default",":","0.9.","loss",":","str","The","type","of","loss","function","to","use","during","training",".","-","`","``","pairwise","''","`","the","model","will","use","pairwise","margin-based","loss","function",".","-","`","``","nll","''","`","the","model","will","use","negative","loss","likelihood",".","-","`","``","absolute_margin","''","`","the","model","will","use","absolute","margin","likelihood",".","-","`","``","self_adversarial","''","`","the","model","will","use","adversarial","sampling","loss","function",".","-","`","``","multiclass_nll","''","`","the","model","will","use","multiclass","nll","loss",".","Switch","to","multiclass","loss","defined","in",":","cite",":","`","chen2015","`","by","passing","``","``","corrupt_side","''","``","as","`","[","``","s","''",",","''","o","''","]","`","to","``","embedding_model_params","``",".","To","use","loss","defined","in",":","cite",":","`","kadlecBK17","`","pass","``","``","corrupt_side","''","``","as","`","``","o","''","`","to","embedding_model_params",".","loss_params",":","dict","Dictionary","of","loss-specific","hyperparameters",".","regularizer",":","str","The","regularization","strategy","to","use","with","the","loss","function",".","-","`","None","`",":","the","model","will","not","use","any","regularizer","(","default",")","-","`","LP","`",":","the","model","will","use",":","math",":","`","L^1",",","L^2","`","or",":","math",":","`","L^3","`","regularization","based","on","the","value","of","``","regularizer_params","[","'","p","'","]","``","in","the","``","regularizer_params","``",".","regularizer_params",":","dict","Dictionary","of","regularizer-specific","hyperparameters",".","initializer",":","str","The","type","of","initializer","to","use",".","-","`","``","normal","''","`",":","The","embeddings","will","be","initialized","from","a","normal","distribution","-","`","``","uniform","''","`",":","The","embeddings","will","be","initialized","from","a","uniform","distribution","-","`","``","xavier","''","`",":","The","embeddings","will","be","initialized","using","xavier","strategy","(","default",")","initializer_params",":","dict","Dictionary","of","initializer-specific","hyperparameters",".","verbose",":","bool","Verbose","mode","."]
code: def __init__(
      self,
      k=100,
      eta=2,
      epochs=100,
      batches_count=100,
      seed=0,
      embedding_model_params={
          "corrupt_sides": ["s,o"],
          "negative_corruption_entities": "all",
          "norm": 1,
          "normalize_ent_emb": False,
      },
      optimizer="adam",
      optimizer_params={"lr": 0.0005},
      loss="nll",
      loss_params={},
      regularizer=None,
      regularizer_params={},
      initializer="xavier",
      initializer_params={"uniform": False},
      verbose=False,
      model=None,
  ):
      """Initialize the model class.
  
          Parameters
          ----------
          k : int
              Embedding space dimensionality.
          eta : int
              The number of negatives that must be generated at runtime during
              training for each positive.
          epochs : int
              The iterations of the training loop.
          batches_count : int
              The number of batches in which the training set must be split
              during the training loop.
          seed : int
              The seed used by the internal random numbers generator.
          embedding_model_params : dict
              Model-specific hyperparams, passed to the model as a dictionary.
              Refer to model-specific documentation for details.
          optimizer : str
              The optimizer used to minimize the loss function. Choose between
              'sgd', 'adagrad', 'adam', 'momentum'.
          optimizer_params : dict
              Arguments specific to the optimizer, passed as a dictionary.
              Supported keys:
  
              - **'lr'** (float): learning rate (used by all the optimizers).
              Default: 0.1.
              - **'momentum'** (float): learning momentum
              (only used when ``optimizer=momentum``). Default: 0.9.
  
          loss : str
              The type of loss function to use during training.
  
              - `"pairwise"`  the model will use pairwise margin-based
              loss function.
              - `"nll"` the model will use negative loss likelihood.
              - `"absolute_margin"` the model will use absolute
              margin likelihood.
              - `"self_adversarial"` the model will use adversarial sampling
              loss function.
              - `"multiclass_nll"` the model will use multiclass nll loss.
              Switch to multiclass loss defined in \
              :cite:`chen2015` by passing ``"corrupt_side"`` as `["s","o"]` to
              ``embedding_model_params``. To use loss defined in\
                      :cite:`kadlecBK17` pass ``"corrupt_side"``\
                      as `"o"` to embedding_model_params.
  
          loss_params : dict
              Dictionary of loss-specific hyperparameters.
          regularizer : str
              The regularization strategy to use with the loss function.
  
              - `None`: the model will not use any regularizer (default)
              - `LP`: the model will use :math:`L^1, L^2` or :math:`L^3`
              regularization based on the value of
              ``regularizer_params['p']`` in the ``regularizer_params``.
  
          regularizer_params : dict
              Dictionary of regularizer-specific hyperparameters.
          initializer : str
              The type of initializer to use.
  
              - `"normal"`: The embeddings will be initialized from a normal
              distribution
              - `"uniform"`: The embeddings will be initialized from a uniform
              distribution
              - `"xavier"`: The embeddings will be initialized using xavier
              strategy (default)
  
          initializer_params : dict
              Dictionary of initializer-specific hyperparameters.
          verbose : bool
              Verbose mode.
          """
      if model is not None:
          self.model_name = model.scoring_type
      else:
          self.k = k
          self.eta = eta
          self.seed = seed
  
          self.batches_count = batches_count
  
          self.epochs = epochs
          self.embedding_model_params = embedding_model_params
          self.optimizer = optimizer
          self.optimizer_params = optimizer_params
          self.loss = loss
          self.loss_params = loss_params
          self.initializer = initializer
          self.initializer_params = initializer_params
          self.regularizer = regularizer
          self.regularizer_params = regularizer_params
          self.verbose = verbose
  
      self.model = model
      self.is_backward = True
  
imports: import numpy
  import tensorflow
  from ampligraph.latent_features.loss_functions import get
  from ampligraph.latent_features.models import ScoringBasedEmbeddingModel
  from ampligraph.latent_features.optimizers import get
  from ampligraph.latent_features.regularizers import get
label_desc: Use image node_id 1 to create a new ScoringModelBase object  with example: obj = ScoringModelBase(k, eta, epochs, batches_count, seed, embedding_model_params, optimizer, optimizer_params, loss, loss_params, regularizer, regularizer_params, initializer, initializer_params, verbose, model)