class_docstr: Base class for binary Hausdorff loss based on morphological erosion.
  
  This is an Hausdorff Distance (HD) Loss that based on morphological erosion,which provided
  a differentiable approximation of Hausdorff distance as stated in :cite:`karimi2019reducing`.
  The code is refactored on top of `here <https://github.com/PatRyg99/HausdorffLoss/
      blob/master/hausdorff_loss.py>`__.
  
  Args:
      alpha: controls the erosion rate in each iteration.
      k: the number of iterations of erosion.
      reduction: Specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'.
          'none': no reduction will be applied, 'mean': the weighted mean of the output is taken,
          'sum': the output will be summed.
  
  Returns:
      Estimated Hausdorff Loss.
class_docstr_tok: ["Base","class","for","binary","Hausdorff","loss","based","on","morphological","erosion",".","This","is","an","Hausdorff","Distance","(","HD",")","Loss","that","based","on","morphological","erosion",",","which","provided","a","differentiable","approximation","of","Hausdorff","distance","as","stated","in",":","cite",":","`","karimi2019reducing","`",".","The","code","is","refactored","on","top","of","`","here","<","https",":","\/\/github.com\/PatRyg99\/HausdorffLoss\/","blob\/master\/hausdorff_loss.py",">","`","__",".","Args",":","alpha",":","controls","the","erosion","rate","in","each","iteration",".","k",":","the","number","of","iterations","of","erosion",".","reduction",":","Specifies","the","reduction","to","apply","to","the","output",":","'none","'","|","'mean","'","|","'sum","'",".","'none","'",":","no","reduction","will","be","applied",",","'mean","'",":","the","weighted","mean","of","the","output","is","taken",",","'sum","'",":","the","output","will","be","summed",".","Returns",":","Estimated","Hausdorff","Loss","."]
code: def __init__(
      self, alpha: float = 2.0, k: int = 10, reduction: str = "mean"
  ) -> None:
      super().__init__()
      self.alpha = alpha
      self.k = k
      self.reduction = reduction
      self.register_buffer("kernel", self.get_kernel())
  
file_path: kornia/kornia/losses/hausdorff.py
imports: from __future__ import annotations
  from typing import Callable
  import torch
  from torch import nn
  from kornia.core import Module, Tensor, as_tensor, stack, tensor, where, zeros_like
label_desc: Use image node_id 1 to create a new _HausdorffERLossBase object from inherited base classes: Module with example: obj = _HausdorffERLossBase(alpha, k, reduction)