code: def compute_scores(optimize):
      maml.restore()
      y_true = []
      y_pred = []
      losses = []
      for task in range(learner.n_training_tasks, n_tasks):
          learner.set_task_index(task)
          if optimize:
              maml.train_on_current_task(restore=True)
          inputs = learner.get_batch()
          loss, prediction = maml.predict_on_batch(inputs)
          y_true.append(inputs[1])
          y_pred.append(prediction[0][:, 0])
          losses.append(loss)
      y_true = np.concatenate(y_true)
      y_pred = np.concatenate(y_pred)
      print()
      print("Cross entropy loss:", np.mean(losses))
      print(
          "Prediction accuracy:", accuracy_score(y_true, y_pred > 0.5)
      )
      print("ROC AUC:", dc.metrics.roc_auc_score(y_true, y_pred))
      print()
  
file_path: deepchem/examples/low_data/toxcast_maml.py
imports: from __future__ import print_function
  import deepchem
  import numpy
  import tensorflow
  from sklearn.metrics import accuracy_score
label_desc: Use image node_id 1 for calling a global function with example usage: compute_scores(optimize) without return types