class_docstr: Abstract implementation of score function.
      
class_docstr_tok: ["Abstract","implementation","of","score","function","."]
docstr: Compute regularization of heads, relations and tails.
          
docstr_tok: ["Compute","regularization","of","heads",",","relations","and","tails","."]
code: def get_hrt_regularization(self, head, rel, tail, args):
      """Compute regularization of heads, relations and tails."""
      heads = paddle.chunk(head, 4, axis=-1)
      tails = paddle.chunk(tail, 4, axis=-1)
      rels = paddle.chunk(rel, 4, axis=-1)
  
      reg_ents = (
          paddle.mean(paddle.abs(heads[0]) ** 2)
          + paddle.mean(paddle.abs(heads[1]) ** 2)
          + paddle.mean(paddle.abs(heads[2]) ** 2)
          + paddle.mean(paddle.abs(heads[3]) ** 2)
          + paddle.mean(paddle.abs(tails[0]) ** 2)
          + paddle.mean(paddle.abs(tails[1]) ** 2)
          + paddle.mean(paddle.abs(tails[2]) ** 2)
          + paddle.mean(paddle.abs(tails[3]) ** 2)
      )
  
      reg_rels = (
          paddle.mean(paddle.abs(rels[0]) ** 2)
          + paddle.mean(paddle.abs(rels[1]) ** 2)
          + paddle.mean(paddle.abs(rels[2]) ** 2)
          + paddle.mean(paddle.abs(rels[3]) ** 2)
      )
  
      value = (
          args.quate_lmbda1 * reg_ents + args.quate_lmbda2 * reg_rels
      )
  
      return value
  
imports: import math
  import numpy
  from numpy.random import RandomState
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.functional import log_sigmoid
label_desc: Use image node_id 5 for calling the ScoreFunc obj's underlying member method code with example usage: obj.get_hrt_regularization(head, rel, tail, args) and returns: value