code: def test_MPNN_regression_reload():
      """Test MPNN can reload datasets."""
      np.random.seed(123)
      tf.random.set_seed(123)
      n_tasks = 1
  
      # Load mini log-solubility dataset.
      featurizer = dc.feat.WeaveFeaturizer()
      mols = ["C", "CO", "CC"]
      n_samples = len(mols)
      X = featurizer(mols)
      y = np.random.rand(n_samples, n_tasks)
      dataset = dc.data.NumpyDataset(X, y)
  
      regression_metric = dc.metrics.Metric(
          dc.metrics.pearson_r2_score, task_averager=np.mean
      )
  
      n_atom_feat = 75
      n_pair_feat = 14
      batch_size = 10
      model_dir = tempfile.mkdtemp()
      model = dc.models.MPNNModel(
          n_tasks,
          n_atom_feat=n_atom_feat,
          n_pair_feat=n_pair_feat,
          T=2,
          M=3,
          batch_size=batch_size,
          learning_rate=0.001,
          use_queue=False,
          mode="regression",
          model_dir=model_dir,
      )
  
      # Fit trained model
      model.fit(dataset, nb_epoch=50)
  
      # Eval model on train
      scores = model.evaluate(dataset, [regression_metric])
      assert scores[regression_metric.name] > 0.8
  
      # Reload trained model
      reloaded_model = dc.models.MPNNModel(
          n_tasks,
          n_atom_feat=n_atom_feat,
          n_pair_feat=n_pair_feat,
          T=2,
          M=3,
          batch_size=batch_size,
          learning_rate=0.001,
          use_queue=False,
          mode="regression",
          model_dir=model_dir,
      )
      reloaded_model.restore()
  
      # Eval model on train
      scores = reloaded_model.evaluate(dataset, [regression_metric])
      assert scores[regression_metric.name] > 0.8
  
      # Check predictions match on random sample
      predmols = ["CCCC", "CCCCCO", "CCCCC"]
      Xpred = featurizer(predmols)
      predset = dc.data.NumpyDataset(Xpred)
      origpred = model.predict(predset)
      reloadpred = reloaded_model.predict(predset)
      assert np.all(origpred == reloadpred)
  
imports: import os
  import pytest
  import tempfile
  import numpy
  import deepchem
  import scipy.io
  from flaky import flaky
  from sklearn.ensemble import RandomForestClassifier
  from deepchem.molnet.load_function.chembl25_datasets import CHEMBL25_TASKS
  from deepchem.feat import create_char_to_idx
label_desc: Use image node_id 14 for calling a global function with example usage: test_MPNN_regression_reload() without return types