docstr: Get all Metric values according to a filter.
  
  Args:
      filter (str): Only keep the metric if `filter` in the name.
  
  Returns:
      Dictionary with all values
code: def get_metrics(self, filter="") -> Dict[str, Any]:
      """
      Get all Metric values according to a filter.
  
      Args:
          filter (str): Only keep the metric if `filter` in the name.
  
      Returns:
          Dictionary with all values
      """
  
      def get_value(met: Union[Metrics, TorchMetric]):
          if isinstance(met, Metrics):
              return met.value
          val = met.compute().detach().cpu().numpy()
          if val.shape == ():
              val = val.item()
          return val
  
      metrics = {
          met_name: get_value(met)
          for met_name, met in self.metrics.items()
          if filter in met_name
      }
      if self._active_dataset_size != -1:
          # Add dataset size if it was ever set.
          metrics.update({"dataset_size": self._active_dataset_size})
      return metrics
  
file_path: baal/baal/metrics/mixin.py
imports: from typing import Callable, Dict, Any, Optional, DefaultDict, Union
  import numpy
  from torchmetrics import Metric
  from baal.utils.metrics import Metrics
label_desc: Use image node_id 4 for calling the MetricMixin obj's underlying member method code with example usage: obj.get_metrics(filter) and returns: metrics, val, met