class_docstr: FID model with a retrieval module over a knowledge memory.
class_docstr_tok: ["FID","model","with","a","retrieval","module","over","a","knowledge","memory","."]
docstr: Returns the VQA Accuracy for the validation / test set.
  
  Args:
    logits: Output of model in shape [B, L, C].
    batch: Batch of data that has 'decoder_target' as ground-truth.
    split: The split for which we calculate the metrics. It should be one of
      the ['train',  'validation', 'test'].
  Returns: VQA accuracy```
docstr_tok: ["Returns","the","VQA","Accuracy","for","the","validation","\/","test","set",".","Args",":","logits",":","Output","of","model","in","shape","[","B",",","L",",","C","]",".","batch",":","Batch","of","data","that","has","'decoder_target","'","as","ground-truth",".","split",":","The","split","for","which","we","calculate","the","metrics",".","It","should","be","one","of","the","[","'train","'",",","'validation","'",",","'test","'","]",".","Returns",":","VQA","accuracy","``","`"]
code: def get_vqa_metrics(
      self,
      logits: jnp.ndarray,
      batch: constants.JTensorDict,
      split: Optional[str] = None,
  ) -> dict[str, float]:
      """Returns the VQA Accuracy for the validation / test set.
  
      Args:
        logits: Output of model in shape [B, L, C].
        batch: Batch of data that has 'decoder_target' as ground-truth.
        split: The split for which we calculate the metrics. It should be one of
          the ['train',  'validation', 'test'].
      Returns: VQA accuracy```
      """
  
      return metrics.vqa_accuracy(logits, batch)
  
imports: import functools
  from typing import Any, Dict, Mapping, Optional, Tuple, List
  from absl import logging
  import flax.linen
  import jax
  from jax.experimental import host_callback
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.model_lib.base_models import base_model
  from scenic.projects.knowledge_visual_language.data import data_utils
  from scenic.projects.knowledge_visual_language.models import constants
  from scenic.projects.knowledge_visual_language.models import fusion_in_decoder_soft
  from scenic.projects.knowledge_visual_language.models import layers
  from scenic.projects.knowledge_visual_language.models import local_memory
  from scenic.projects.knowledge_visual_language.models import losses
  from scenic.projects.knowledge_visual_language.models import metrics
  from t5x import decoding
label_desc: Use image node_id 5 for calling the KnowledgeFIDModel obj's underlying member method code with example usage: obj.get_vqa_metrics(logits, batch, split) and returns: metrics