class_docstr: Calculate log-space crf loss, given unary potentials, a transition matrix
  and gold tag sequences.
class_docstr_tok: ["Calculate","log-space","crf","loss",",","given","unary","potentials",",","a","transition","matrix","and","gold","tag","sequences","."]
code: def __init__(self, num_tag, batch_average=True):
      super().__init__()
      self._transitions = nn.Parameter(torch.zeros(num_tag, num_tag))
      self._batch_average = batch_average
  
file_path: stanza/stanza/models/common/crf.py
imports: import math
  from numbers import Number
  import numpy
  import torch
  from torch import nn
  import torch.nn.init
label_desc: Use image node_id 1 to create a new CRFLoss object from inherited base classes: nn with example: obj = CRFLoss(num_tag, batch_average)