code: def LP_regularizer(trainable_param, regularizer_parameters={}):
      """Norm :math:`L^{p}` regularizer.
  
      It is passed to the model as the ``entity_relation_regularizer`` argument of the
      :meth:`~ampligraph.latent_features.models.ScoringBasedEmbeddingModel.compile` method.
  
      Parameters
      ----------
      trainable_param: tf.Variable
          Trainable parameters of the model that need to be regularized.
      regularizer_parameters: dict
          Parameters of the regularizer:
  
          - **p**: (int) - p for the LP regularizer. For example, when :math:`p=2` (default), it uses the L2 regularizer.
          - **lambda** : (float) - Regularizer weight (default: 0.00001).
      Returns
      -------
      regularizer: tf.keras.regularizer
          Regularizer instance from the `tf.keras.regularizer` class.
  
      """
      return regularizer_parameters.get(
          "lambda", 0.00001
      ) * tf.reduce_sum(
          tf.pow(
              tf.abs(trainable_param),
              regularizer_parameters.get("p", 2),
          )
      )
  
imports: from functools import partial
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: LP_regularizer(trainable_param, regularizer_parameters) and returns: unknown