class_docstr: Triplet loss function.
class_docstr_tok: ["Triplet","loss","function","."]
code: def __init__(self, margin, reduce="mean"):
      if margin <= 0:
          raise ValueError("margin should be positive value.")
      self.margin = margin
  
      if reduce not in ("mean", "no"):
          raise ValueError(
              "only 'mean' and 'no' are valid for 'reduce', but "
              "'%s' is given" % reduce
          )
      self.reduce = reduce
  
file_path: chainer/chainer/functions/loss/triplet.py
imports: import chainer
  from chainer import backend
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 1 to create a new Triplet object from inherited base classes: function_node with example: obj = Triplet(margin, reduce)