class_docstr: Implements the ohem cross entropy loss function.
  
  Args:
      border (int, optional): The value of border to relax. Default: 1.
      calculate_weights (bool, optional): Whether to calculate weights for every classes. Default: False.
      upper_bound (float, optional): The upper bound of weights if calculating weights for every classes. Default: 1.0.
      ignore_index (int64): Specifies a target value that is ignored
          and does not contribute to the input gradient. Default: 255.
class_docstr_tok: ["Implements","the","ohem","cross","entropy","loss","function",".","Args",":","border","(","int",",","optional",")",":","The","value","of","border","to","relax",".","Default",":","1.","calculate_weights","(","bool",",","optional",")",":","Whether","to","calculate","weights","for","every","classes",".","Default",":","False",".","upper_bound","(","float",",","optional",")",":","The","upper","bound","of","weights","if","calculating","weights","for","every","classes",".","Default",":","1.0.","ignore_index","(","int64",")",":","Specifies","a","target","value","that","is","ignored","and","does","not","contribute","to","the","input","gradient",".","Default",":","255","."]
code: def __init__(
      self,
      border=1,
      calculate_weights=False,
      upper_bound=1.0,
      ignore_index=255,
  ):
      super(RelaxBoundaryLoss, self).__init__()
      self.border = border
      self.calculate_weights = calculate_weights
      self.upper_bound = upper_bound
      self.ignore_index = ignore_index
      self.EPS = 1e-5
  
file_path: PaddleSeg/paddleseg/models/losses/decoupledsegnet_relax_boundary_loss.py
imports: import numpy
  import paddle
  from paddle import nn
  import paddle.nn.functional
  from scipy.ndimage import shift
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 1 to create a new RelaxBoundaryLoss object from inherited base classes: nn with example: obj = RelaxBoundaryLoss(border, calculate_weights, upper_bound, ignore_index)