class_docstr: Compute `Minkowski Distance`_.
  
  .. math::
      d_{\text{Minkowski}} = \sum_{i}^N (| y_i - \hat{y_i} |^p)^\frac{1}{p}
  
  where
      :math: `y` is a tensor of target values,
      :math: `\hat{y}` is a tensor of predictions,
      :math: `\p` is a non-negative integer or floating-point number
  
  This metric can be seen as generalized version of the standard euclidean distance which corresponds to minkowski
  distance with p=2.
  
  Args:
      p: int or float larger than 1, exponent to which the difference between preds and target is to be raised
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Example:
      >>> from torchmetrics.regression import MinkowskiDistance
      >>> target = tensor([1.0, 2.8, 3.5, 4.5])
      >>> preds = tensor([6.1, 2.11, 3.1, 5.6])
      >>> minkowski_distance = MinkowskiDistance(3)
      >>> minkowski_distance(preds, target)
      tensor(5.1220)
class_docstr_tok: ["Compute","`","Minkowski","Distance","`","_",".","..","math",":",":","d_","{","\\text","{","Minkowski","}","}","=","\\sum_","{","i","}","^N","(","|","y_i","-","\\hat","{","y_i","}","|^p",")","^\\frac","{","1","}","{","p","}","where",":","math",":","`","y","`","is","a","tensor","of","target","values",",",":","math",":","`","\\hat","{","y","}","`","is","a","tensor","of","predictions",",",":","math",":","`","\\p","`","is","a","non-negative","integer","or","floating-point","number","This","metric","can","be","seen","as","generalized","version","of","the","standard","euclidean","distance","which","corresponds","to","minkowski","distance","with","p=2",".","Args",":","p",":","int","or","float","larger","than","1",",","exponent","to","which","the","difference","between","preds","and","target","is","to","be","raised","kwargs",":","Additional","keyword","arguments",",","see",":","ref",":","`","Metric","kwargs","`","for","more","info",".","Example",":",">",">",">","from","torchmetrics.regression","import","MinkowskiDistance",">",">",">","target","=","tensor","(","[","1.0",",","2.8",",","3.5",",","4.5","]",")",">",">",">","preds","=","tensor","(","[","6.1",",","2.11",",","3.1",",","5.6","]",")",">",">",">","minkowski_distance","=","MinkowskiDistance","(","3",")",">",">",">","minkowski_distance","(","preds",",","target",")","tensor","(","5.1220",")"]
docstr: Update state with predictions and targets.
docstr_tok: ["Update","state","with","predictions","and","targets","."]
code: def update(self, preds: Tensor, targets: Tensor) -> None:
      """Update state with predictions and targets."""
      minkowski_dist_sum = _minkowski_distance_update(
          preds, targets, self.p
      )
      self.minkowski_dist_sum += minkowski_dist_sum
  
file_path: torchmetrics/src/torchmetrics/regression/minkowski.py
imports: from typing import Any, Optional, Sequence, Union
  from torch import Tensor, tensor
  from torchmetrics.functional.regression.minkowski import _minkowski_distance_compute, _minkowski_distance_update
  from torchmetrics.metric import Metric
  from torchmetrics.utilities.exceptions import TorchMetricsUserError
  from torchmetrics.utilities.imports import _MATPLOTLIB_AVAILABLE
  from torchmetrics.utilities.plot import _AX_TYPE, _PLOT_OUT_TYPE
label_desc: Use image node_id 2 for calling the MinkowskiDistance obj's underlying member method code with example usage: obj.update(preds, targets) without return types