class_docstr: The base trainer class. Given an object of `hparams`, a trainer
  creates and initializes a model. After initialization, the method
  `model_train` can be used to train the model.
class_docstr_tok: ["The","base","trainer","class",".","Given","an","object","of","`","hparams","`",",","a","trainer","creates","and","initializes","a","model",".","After","initialization",",","the","method","`","model_train","`","can","be","used","to","train","the","model","."]
code: def _init_data(self):
      hparams = self.hparams
      batch_size = hparams.batch_size
      if hparams.dataset == "mnist":
          # Get MNIST test data
          X_train, Y_train, X_test, Y_test = data_mnist(
              train_start=hparams.train_start,
              train_end=hparams.train_end,
              test_start=hparams.test_start,
              test_end=hparams.test_end,
          )
          input_shape = (batch_size, 28, 28, 1)
          preproc_func = None
      elif hparams.dataset == "cifar10":
          X_train, Y_train, X_test, Y_test = cifar_input.read_CIFAR10(
              os.path.join(hparams.data_path, hparams.dataset)
          )
          input_shape = (batch_size, 32, 32, 3)
          preproc_func = cifar_input.cifar_tf_preprocess
      elif hparams.dataset == "svhn":
          X_train, Y_train, X_test, Y_test = svhn_input.read_SVHN(
              os.path.join(hparams.data_path, hparams.dataset)
          )
          input_shape = (batch_size, 32, 32, 3)
          preproc_func = svhn_input.svhn_tf_preprocess
  
      # Use label smoothing
      assert Y_train.shape[1] == 10.0
      label_smooth = 0.1
      Y_train = Y_train.clip(label_smooth / 9.0, 1.0 - label_smooth)
  
      self.X_train = X_train
      self.Y_train = Y_train
      self.X_test = X_test
      self.Y_test = Y_test
      self.data = (X_train, Y_train, X_test, Y_test)
      self.input_shape = input_shape
      self.preproc_func = preproc_func
  
imports: from collections import OrderedDict
  import logging
  import math
  import time
  import os
  import numpy
  import six
  import tensorflow
  from cleverhans.utils_tf import batch_indices
  from cleverhans.utils_mnist import data_mnist
  import utils_cifar
  import utils_svhn
  from utils import preprocess_batch
  from make_model import make_model
  from evaluator import Evaluator
  from evaluator import create_adv_by_name
  from model import clone_variable
label_desc: Use image node_id 3 for calling the TrainManager obj's underlying member method code with example usage: obj._init_data() without return types