class_docstr: This class implements the RecMetricComputation for NE, i.e. Normalized Entropy.
  
  The constructor arguments are defined in RecMetricComputation.
  See the docstring of RecMetricComputation for more detail.
  
  Args:
      include_logloss (bool): return vanilla logloss as one of metrics results, on top of NE.
code: def _compute(self) -> List[MetricComputationReport]:
      reports = [
          MetricComputationReport(
              name=MetricName.NE,
              metric_prefix=MetricPrefix.LIFETIME,
              value=compute_ne(
                  cast(torch.Tensor, self.cross_entropy_sum),
                  cast(torch.Tensor, self.weighted_num_samples),
                  cast(torch.Tensor, self.pos_labels),
                  cast(torch.Tensor, self.neg_labels),
                  self.eta,
                  self._allow_missing_label_with_zero_weight,
              ),
          ),
          MetricComputationReport(
              name=MetricName.NE,
              metric_prefix=MetricPrefix.WINDOW,
              value=compute_ne(
                  self.get_window_state("cross_entropy_sum"),
                  self.get_window_state("weighted_num_samples"),
                  self.get_window_state("pos_labels"),
                  self.get_window_state("neg_labels"),
                  self.eta,
                  self._allow_missing_label_with_zero_weight,
              ),
          ),
      ]
      if self._include_logloss:
          reports += [
              MetricComputationReport(
                  name=MetricName.LOG_LOSS,
                  metric_prefix=MetricPrefix.LIFETIME,
                  value=compute_logloss(
                      cast(torch.Tensor, self.cross_entropy_sum),
                      cast(torch.Tensor, self.pos_labels),
                      cast(torch.Tensor, self.neg_labels),
                      self.eta,
                  ),
              ),
              MetricComputationReport(
                  name=MetricName.LOG_LOSS,
                  metric_prefix=MetricPrefix.WINDOW,
                  value=compute_logloss(
                      self.get_window_state("cross_entropy_sum"),
                      self.get_window_state("pos_labels"),
                      self.get_window_state("neg_labels"),
                      self.eta,
                  ),
              ),
          ]
      return reports
  
file_path: torchrec/torchrec/metrics/ne.py
imports: from typing import Any, cast, Dict, List, Optional, Type
  import torch
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException
label_desc: Use image node_id 3 for calling the NEMetricComputation obj's underlying member method code with example usage: obj._compute() and returns: reports