class_docstr: Calculates Inception Score.
  
  .. math::
     \text{IS(G)} = \exp(\frac{1}{N}\sum_{i=1}^{N} D_{KL} (p(y|x^{(i)} \parallel \hat{p}(y))))
  
  where :math:`p(y|x)` is the conditional probability of image being the given object and
  :math:`p(y)` is the marginal probability that the given image is real, `G` refers to the
  generated image and :math:`D_{KL}` refers to KL Divergence of the above mentioned probabilities.
  
  More details can be found in `Barratt et al. 2018`__.
  
  __ https://arxiv.org/pdf/1801.01973.pdf
  
  Args:
      num_features: number of features predicted by the model or number of classes of the model. Default
          value is 1000.
      feature_extractor: a torch Module for predicting the probabilities from the input data.
          It returns a tensor of shape (batch_size, num_features).
          If neither ``num_features`` nor ``feature_extractor`` are defined, by default we use an ImageNet
          pretrained Inception Model. If only ``num_features`` is defined but ``feature_extractor`` is not
          defined, ``feature_extractor`` is assigned Identity Function.
          Please note that the class object will be implicitly converted to device mentioned in the
          ``device`` argument.
      output_transform: a callable that is used to transform the
          :class:`~ignite.engine.engine.Engine`'s ``process_function``'s output into the
          form expected by the metric. This can be useful if, for example, you have a multi-output model and
          you want to compute the metric with respect to one of the outputs.
          By default, metrics require the output as ``y_pred``.
      device: specifies which device updates are accumulated on. Setting the
          metric's device to be the same as your ``update`` arguments ensures the ``update`` method is
          non-blocking. By default, CPU.
  
  .. note::
      The default Inception model requires the `torchvision` module to be installed.
  
  Examples:
  
      For more information on how metric works with :class:`~ignite.engine.engine.Engine`, visit :ref:`attach-engine`.
  
      .. include:: defaults.rst
          :start-after: :orphan:
  
      .. code-block:: python
  
          metric = InceptionScore()
          metric.attach(default_evaluator, "is")
          y = torch.rand(10, 3, 299, 299)
          state = default_evaluator.run([y])
          print(state.metrics["is"])
  
      .. testcode::
  
          metric = InceptionScore(num_features=1, feature_extractor=default_model)
          metric.attach(default_evaluator, "is")
          y = torch.zeros(10, 4)
          state = default_evaluator.run([y])
          print(state.metrics["is"])
  
      .. testoutput::
  
          1.0
  
  .. versionadded:: 0.4.6
code: def reset(self) -> None:
      self._num_examples = 0
  
      self._prob_total = torch.zeros(
          self._num_features, dtype=torch.float64, device=self._device
      )
      self._total_kl_d = torch.zeros(
          self._num_features, dtype=torch.float64, device=self._device
      )
  
      super(InceptionScore, self).reset()
  
file_path: ignite/ignite/metrics/gan/inception_score.py
imports: from typing import Callable, Optional, Union
  import torch
  from ignite.exceptions import NotComputableError
  from ignite.metrics.gan.utils import _BaseInceptionMetric, InceptionModel
  from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce
label_desc: Use image node_id 2 for calling the InceptionScore obj's underlying member method code with example usage: obj.reset() without return types