docstr: Initialize the test class.
docstr_tok: ["Initialize","the","test","class","."]
code: def __init__(self, methodname):
      """Initialize the test class."""
      super().__init__(methodname)
  
      self.ntrain = 100
      self.nclass = 5
      self.ndim = 5
  
      # Generate random data.
      np.random.seed(1234)
      self.data = np.random.rand(self.ntrain, self.ndim) * 10
      self.labels = np.random.randint(self.nclass, size=self.ntrain)
      self.labels = (
          np.arange(self.nclass) == self.labels[:, None]
      ).astype(
          "f"
      )  # make one-hot
  
      # Set model, optimizer and loss.
      self.model = DNNet(
          layer_sizes=[self.ndim, self.nclass],
          activation=objax.functional.softmax,
      )
      self.model_vars = self.model.vars()
  
      def loss_function(x, y):
          logit = self.model(x)
          loss = ((y - logit) ** 2).mean(1).mean(0)
          return loss, {"loss": loss}
  
      self.loss = loss_function
  
imports: import inspect
  import unittest
  from typing import Tuple, Dict, List
  import jax
  import jax.numpy
  import numpy
  from scipy.stats.distributions import chi2
  import objax
  from objax.typing import JaxArray
  from objax.zoo.dnnet import DNNet
label_desc: Use image node_id 1 to create a new TestPrivateGradValues object from inherited base classes: unittest with example: obj = TestPrivateGradValues(methodname)