class_docstr: Use Mnist Dataset for LR training,
  small digits (0-4) and large digits (5-9) are calssified as two class
class_docstr_tok: ["Use","Mnist","Dataset","for","LR","training",",","small","digits","(","0-4",")","and","large","digits","(","5-9",")","are","calssified","as","two","class"]
code: def _data_generator(self):
      def normalize(image, label):
          image = tf.cast(image, tf.float64) / 255.0
          label = tf.cast(tf.math.greater(label, 4), dtype=tf.float64)
          return image, label
  
      def shaping(image, label):
          image = tf.reshape(
              image,
              shape=[
                  self.batch_size,
                  self.row,
                  self.column,
                  self.channel,
              ],
          )
          label = tf.reshape(label, [self.batch_size, 1])
          return image, label
  
      dataset = tf.data.TFRecordDataset([self.file_name])
      dataset = (
          dataset.map(decode_data)
          .map(normalize)
          .cache()
          .shuffle(self.num_samples, seed=11111)
          .batch(self.batch_size, drop_remainder=True)
          .map(shaping)
      )  # drop remainder because we need to fix batch size in private model
      if self.train:
          dataset = dataset.repeat()
      dataset = dataset.prefetch(tf.data.experimental.AUTOTUNE)
      data_iter = iter(dataset)
  
      return data_iter
  
file_path: tf-encrypted/examples/benchmark/training/lr_mnist_dataset.py
imports: import tensorflow
  from tf_encrypted.keras.datasets import MnistDataset
  from tf_encrypted.keras.datasets.convert import decode_data
  from tf_encrypted.keras.datasets.convert import decode_image
  from tf_encrypted.keras.datasets.convert import decode_label
label_desc: Use image node_id 4 for calling the LRMnistDataset obj's underlying member method code with example usage: obj._data_generator() and returns: data_iter, image,  label, image,  label