class_docstr: Tests for the vectorized computation of KL divergences.
class_docstr_tok: ["Tests","for","the","vectorized","computation","of","KL","divergences","."]
docstr: Check the value range.
docstr_tok: ["Check","the","value","range","."]
code: def test_value_range(self):
      """Check the value range."""
      # https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence#Properties
      # divergence >= 0 => similarity = -divergence <= 0
      h, r, t = [self._get(name=name) for name in "hrt"]
      sim = kullback_leibler_similarity(h=h, r=r, t=t, exact=True)
      self.assertTrue((sim <= 0).all())
  
file_path: pykeen/tests/test_nn/test_sim.py
imports: import itertools
  import unittest
  import torch
  from pykeen.nn.sim import _torch_kl_similarity, kullback_leibler_similarity
  from pykeen.typing import GaussianDistribution
  from pykeen.utils import convert_to_canonical_shape
label_desc: Use image node_id 6 for calling the KullbackLeiblerTests obj's underlying member method code with example usage: obj.test_value_range() without return types