class_docstr: Categorical accuracy metric. Uses torch.max to determine predictions and compares to targets. Decorated with a
  mean, running_mean and std. Default for key: 'cat_acc'
  
  Args:
      pred_key (StateKey): The key in state which holds the predicted values
      target_key (StateKey): The key in state which holds the target values
      ignore_index (int): Specifies a target value that is ignored and does not contribute to the metric output.
          See `<https://pytorch.org/docs/stable/nn.html#crossentropyloss>`_
class_docstr_tok: ["Categorical","accuracy","metric",".","Uses","torch.max","to","determine","predictions","and","compares","to","targets",".","Decorated","with","a","mean",",","running_mean","and","std",".","Default","for","key",":","'cat_acc'","Args",":","pred_key","(","StateKey",")",":","The","key","in","state","which","holds","the","predicted","values","target_key","(","StateKey",")",":","The","key","in","state","which","holds","the","target","values","ignore_index","(","int",")",":","Specifies","a","target","value","that","is","ignored","and","does","not","contribute","to","the","metric","output",".","See","`","<","https",":","\/\/pytorch.org\/docs\/stable\/nn.html","#","crossentropyloss",">","`","_"]
code: def process(self, *args):
      state = args[0]
      y_pred = state[self.pred_key]
      y_true = state[self.target_key]
  
      if len(y_true.shape) == 2:
          _, y_true = torch.max(y_true, 1)
  
      mask = y_true.eq(self.ignore_index).eq(0)
      y_pred = y_pred[mask]
      y_true = y_true[mask]
      _, y_pred = torch.max(y_pred, 1)
      return (y_pred == y_true).float()
  
imports: import torchbearer
  from torchbearer import Metric
  from .decorators import default_for_key, running_mean, mean, std, to_dict
  import torch
label_desc: Use image node_id 2 for calling the CategoricalAccuracy obj's underlying member method code with example usage: obj.process() and returns: unknown