code: def evaluate(loader):
      step = 0
      results = []
      for batch in loader:
          step += 1
          inputs, target = batch
          predictions = model(inputs, training=False)
          loss = loss_fn(target, predictions)
          acc = tf.reduce_mean(
              sparse_categorical_accuracy(target, predictions)
          )
          results.append(
              (loss, acc, len(target))
          )  # Keep track of batch size
          if step == loader.steps_per_epoch:
              results = np.array(results)
              return np.average(
                  results[:, :-1], 0, weights=results[:, -1]
              )
  
file_path: spektral/examples/other/graph_signal_classification_mnist.py
imports: import numpy
  import tensorflow
  from tensorflow.keras import Model
  from tensorflow.keras.layers import Dense
  from tensorflow.keras.losses import SparseCategoricalCrossentropy
  from tensorflow.keras.metrics import sparse_categorical_accuracy
  from tensorflow.keras.optimizers import Adam
  from tensorflow.keras.regularizers import l2
  from spektral.data import MixedLoader
  from spektral.datasets.mnist import MNIST
  from spektral.layers import GCNConv, GlobalSumPool
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate(loader) and returns: np