code: def test_epistemic_scoring(self):
      input_size = (20, 20, 20)
      device = "cuda" if torch.cuda.is_available() else "cpu"
      keys = ["image", "label"]
      num_training_ims = 10
      train_data = self.get_data(num_training_ims, input_size)
      test_data = self.get_data(1, input_size)
  
      transforms = Compose(
          [
              EnsureChannelFirstd(keys, channel_dim="no_channel"),
              CropForegroundd(keys, source_key="image"),
              DivisiblePadd(keys, 4),
          ]
      )
  
      infer_transforms = Compose(
          [
              EnsureChannelFirst(channel_dim="no_channel"),
              CropForeground(),
              DivisiblePad(4),
          ]
      )
  
      train_ds = CacheDataset(train_data, transforms)
      # output might be different size, so pad so that they match
      train_loader = DataLoader(
          train_ds, batch_size=2, collate_fn=pad_list_data_collate
      )
  
      model = UNet(3, 1, 1, channels=(6, 6), strides=(2, 2)).to(device)
      loss_function = DiceLoss(sigmoid=True)
      optimizer = torch.optim.Adam(model.parameters(), 1e-3)
  
      num_epochs = 10
      for _ in trange(num_epochs):
          epoch_loss = 0
  
          for batch_data in train_loader:
              inputs, labels = batch_data["image"].to(
                  device
              ), batch_data["label"].to(device)
              optimizer.zero_grad()
              outputs = model(inputs)
              loss = loss_function(outputs, labels)
              loss.backward()
              optimizer.step()
              epoch_loss += loss.item()
  
          epoch_loss /= len(train_loader)
  
      entropy_score = EpistemicScoring(
          model=model,
          transforms=infer_transforms,
          roi_size=[20, 20, 20],
          num_samples=10,
      )
      # Call Individual Infer from Epistemic Scoring
      ip_stack = [
          test_data["image"],
          test_data["image"],
          test_data["image"],
      ]
      ip_stack = np.array(ip_stack)
      score_3d = entropy_score.entropy_3d_volume(ip_stack)
      score_3d_sum = np.sum(score_3d)
      # Call Entropy Metric from Epistemic Scoring
      self.assertEqual(score_3d.shape, input_size)
      self.assertIsInstance(score_3d_sum, np.float32)
      self.assertGreater(score_3d_sum, 3.0)
  
file_path: MONAILabel/tests/unit/activelearning/test_epistemic.py
imports: import unittest
  from functools import partial
  import numpy
  import torch
  import tqdm
  from monai.data import CacheDataset, DataLoader, create_test_image_3d
  from monai.data.utils import pad_list_data_collate
  from monai.losses import DiceLoss
  from monai.networks.nets import UNet
  from monai.transforms import Compose, CropForeground, CropForegroundd, DivisiblePad, DivisiblePadd, EnsureChannelFirst, EnsureChannelFirstd
  from monai.utils import set_determinism
  from monailabel.tasks.scoring.epistemic import EpistemicScoring
label_desc: Use image node_id 4 for calling the TestEpistemicScoring obj's underlying member method code with example usage: obj.test_epistemic_scoring() without return types