docstr: Updates prediction matches.
  :param output: model output
  :param target: annotations
docstr_tok: ["Updates","prediction","matches",".",":","param","output",":","model","output",":","param","target",":","annotations"]
code: def update(self, output, target):
      """Updates prediction matches.
      :param output: model output
      :param target: annotations
      """
      if len(output) > 1:
          raise Exception(
              "The accuracy metric cannot be calculated "
              "for a model with multiple outputs"
          )
      if isinstance(target, dict):
          target = list(target.values())
      predictions = np.argsort(output[0], axis=1)[:, -self._top_k :]
      match = [float(t in predictions[i]) for i, t in enumerate(target)]
  
      self._matches.append(match)
  
imports: import os
  import json
  import random
  from PIL import Image
  import numpy
  from compression.api import DataLoader, Metric
  from torchvision.transforms import transforms
label_desc: Use image node_id 4 for calling the Accuracy obj's underlying member method code with example usage: obj.update(output, target) without return types