code: def _calculate_metrics(
      self, data: Dict[str, Dict[str, torch.Tensor]]
  ) -> Dict[str, Dict[str, torch.Tensor]]:
      metrics = defaultdict(dict)
      for module_name, td in data.items():
          for target_name, target_data in td.items():
              if (
                  self._target_spaces[module_name][
                      target_name
                  ].sparse_threshold
                  is not None
              ):
                  metrics[module_name][
                      target_name
                  ] = target_data.sigmoid()
              else:
                  metrics[module_name][target_name] = target_data
      return metrics
  
imports: from __future__ import annotations
  from collections import defaultdict
  import logging
  from typing import Dict, List, overload
  import torch
  from torch.optim import Adam
  from .scheduled_pruner import ScheduledPruner
  from .tools import is_active_target, generate_sparsity
  from ..base.compressor import Compressor
  from ..base.target_space import TargetType
  from ..base.wrapper import ModuleWrapper
  from ..utils import Evaluator, _EVALUATOR_DOCSTRING
label_desc: Use image node_id 12 for calling the MovementPruner obj's underlying member method code with example usage: obj._calculate_metrics(data) and returns: metrics