code: def compute_with_aggregates(
      self, y_pred: Tensor, y_true: Tensor
  ) -> Union[Number, Dict[str, Number]]:
      y_pred = F.softmax(y_pred, dim=-1).numpy()
      y_true = y_true.numpy()
  
      max_confs = y_pred.max(axis=-1)
      max_hist = np.histogram(
          max_confs, bins=self.num_bins, range=[0, 1]
      )[0]
      max_hist = max_hist / max_hist.sum()
  
      target_confs = np.take_along_axis(
          y_pred, y_true.reshape(-1, 1), 1
      )
      target_hist = np.histogram(
          target_confs, bins=self.num_bins, range=[0, 1]
      )[0]
      target_hist = target_hist / target_hist.sum()
  
      return {
          "max": max_hist.tolist(),
          "target": target_hist.tolist(),
      }
  
file_path: ml-cvnets/metrics/probability_histograms.py
imports: import argparse
  from numbers import Number
  from typing import Dict, Union
  import numpy
  from torch import Tensor
  from torch.nn import functional
  from metrics import METRICS_REGISTRY
  from metrics.metric_base import EpochMetric
  from utils import logger
label_desc: Use image node_id 3 for calling the ProbabilityHistogramMetric obj's underlying member method code with example usage: obj.compute_with_aggregates(y_pred, y_true) and returns: dict