class_docstr: First version of Epistemic computation used as active learning strategy
class_docstr_tok: ["First","version","of","Epistemic","computation","used","as","active","learning","strategy"]
code: def entropy_volume(self, vol_input):
      # The input is assumed with repetitions, channels and then volumetric data
      vol_input = (
          vol_input.cpu().detach().numpy()
          if isinstance(vol_input, torch.Tensor)
          else vol_input
      )
      vol_input = vol_input.astype(dtype="float32")
      dims = vol_input.shape
      reps = dims[0]
      entropy = np.zeros(dims[2:], dtype="float32")
  
      # Threshold values less than or equal to zero
      threshold = 0.00005
      vol_input[vol_input <= 0] = threshold
  
      # Looping across channels as each channel is a class
      if len(dims) == 5 if self.dimension == 3 else 4:
          for channel in range(dims[1]):
              t_vol = np.squeeze(
                  vol_input[:, channel, :, :, :]
                  if self.dimension == 3
                  else vol_input[:, channel, :, :]
              )
              t_sum = np.sum(t_vol, axis=0)
              t_avg = np.divide(t_sum, reps)
              t_log = np.log(t_avg)
              t_entropy = -np.multiply(t_avg, t_log)
              entropy = entropy + t_entropy
      else:
          t_vol = np.squeeze(vol_input)
          t_sum = np.sum(t_vol, axis=0)
          t_avg = np.divide(t_sum, reps)
          t_log = np.log(t_avg)
          t_entropy = -np.multiply(t_avg, t_log)
          entropy = entropy + t_entropy
  
      # Returns a 3D volume of entropy
      return entropy
  
file_path: MONAILabel/monailabel/tasks/scoring/epistemic_v2.py
imports: import logging
  import multiprocessing
  import os
  import time
  from concurrent.futures import ThreadPoolExecutor
  import numpy
  import torch
  from monai.metrics.active_learning_metrics import VarianceMetric
  from monailabel.interfaces.datastore import Datastore
  from monailabel.interfaces.tasks.scoring import ScoringMethod
  from monailabel.tasks.infer.basic_infer import BasicInferTask
  from monailabel.utils.others.generic import name_to_device
label_desc: Use image node_id 2 for calling the EpistemicScoring obj's underlying member method code with example usage: obj.entropy_volume(vol_input) and returns: entropy