code: def evaluate(model, val_loader, batch_transforms):
      # Validation loop
      val_loss, correct, samples, batch_cnt = 0, 0, 0, 0
      val_iter = iter(val_loader)
      for images, targets in tqdm(val_iter):
          images = batch_transforms(images)
          out = model(images, training=False)
          loss = tf.nn.sparse_softmax_cross_entropy_with_logits(
              targets, out
          )
          # Compute metric
          correct += int(
              (out.numpy().argmax(1) == targets.numpy()).sum()
          )
  
          val_loss += loss.numpy().mean()
          batch_cnt += 1
          samples += images.shape[0]
  
      val_loss /= batch_cnt
      acc = correct / samples
      return val_loss, acc
  
file_path: doctr/references/classification/train_tensorflow.py
imports: import os
  import datetime
  import multiprocessing
  import time
  import numpy
  import tensorflow
  from tensorflow.keras import mixed_precision
  from tqdm.auto import tqdm
  from doctr.models import login_to_hub, push_to_hf_hub
  from doctr import transforms
  from doctr.datasets import VOCABS, CharacterGenerator, DataLoader
  from doctr.models import classification
  from doctr.models.utils import export_model_to_onnx
  from utils import EarlyStopper, plot_recorder, plot_samples
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate(model, val_loader, batch_transforms) and returns: val_loss,  acc