class_docstr: Linear-chain conditional random field loss layer.
  
  This link wraps the :func:`~chainer.functions.crf1d` function.
  It holds a transition cost matrix as a parameter.
  
  Args:
      n_label (int): Number of labels.
      initial_cost (:ref:`initializer <initializer>`): Initializer to
          initialize the transition cost matrix.
          If this attribute is not specified,
          the transition cost matrix is initialized with zeros.
  
  .. seealso:: :func:`~chainer.functions.crf1d` for more detail.
  
  Attributes:
      cost (~chainer.Variable): Transition cost parameter.
code: def __init__(self, n_label, initial_cost=None):
      super(CRF1d, self).__init__()
      if initial_cost is None:
          initial_cost = initializers.constant.Zero()
  
      with self.init_scope():
          self.cost = variable.Parameter(
              initializer=initial_cost, shape=(n_label, n_label)
          )
  
file_path: chainer/chainer/links/loss/crf1d.py
imports: from chainer.functions.array import transpose_sequence
  from chainer.functions.loss import crf1d
  from chainer import initializers
  from chainer import link
  from chainer.links.rnn.n_step_rnn import argsort_list_descent
  from chainer.links.rnn.n_step_rnn import permutate_list
  from chainer import variable
label_desc: Use image node_id 1 to create a new CRF1d object from inherited base classes: link with example: obj = CRF1d(n_label, initial_cost)