docstr: Compute the inception score using a batch of activations.
  :param activations: an [N x D] batch of activations.
  :param split_size: the number of samples per split. This is used to
                     make results consistent with other work, even when
                     using a different number of samples.
  :return: an inception score estimate.
docstr_tok: ["Compute","the","inception","score","using","a","batch","of","activations",".",":","param","activations",":","an","[","N","x","D","]","batch","of","activations",".",":","param","split_size",":","the","number","of","samples","per","split",".","This","is","used","to","make","results","consistent","with","other","work",",","even","when","using","a","different","number","of","samples",".",":","return",":","an","inception","score","estimate","."]
code: def get_inception_score(
      self, activations: np.ndarray, split_size: int = 5000
  ) -> float:
      """
      Compute the inception score using a batch of activations.
      :param activations: an [N x D] batch of activations.
      :param split_size: the number of samples per split. This is used to
                         make results consistent with other work, even when
                         using a different number of samples.
      :return: an inception score estimate.
      """
      softmax_out = []
      for i in range(0, len(activations), self.softmax_batch_size):
          acts = activations[i : i + self.softmax_batch_size]
          with torch.no_grad():
              softmax_out.append(
                  self.inception_softmax(
                      torch.from_numpy(acts).to(dist_util.dev())
                  )
                  .cpu()
                  .numpy()
              )
      preds = np.concatenate(softmax_out, axis=0)
      # https://github.com/openai/improved-gan/blob/4f5d1ec5c16a7eceb206f42bfc652693601e1d5c/inception_score/model.py#L46
      scores = []
      for i in range(0, len(preds), split_size):
          part = preds[i : i + split_size]
          kl = part * (
              np.log(part) - np.log(np.expand_dims(np.mean(part, 0), 0))
          )
          kl = np.mean(np.sum(kl, 1))
          scores.append(np.exp(kl))
      return float(np.mean(scores))
  
imports: from .inception_v3 import InceptionV3
  import blobfile
  import torch
  import torch.distributed
  import torch.nn
  from cm import dist_util
  import numpy
  import warnings
  from scipy import linalg
  from PIL import Image
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling the FIDAndIS obj's underlying member method code with example usage: obj.get_inception_score(activations, split_size) and returns: float