The canonical way to present data to a TensorFlow ANN, as recommended by Google, is via a data pipeline composed of a tf.data.Dataset object and a tf.data.Iterator method. A tf.data.Dataset object consists of a sequence of elements in which each element contains one or more tensor objects. The tf.data.Iterator is a method used to loop over a dataset so that successive individual elements in it may be accessed.
We will look at two important ways of constructing a data pipeline, firstly, from in-memory NumPy arrays, and, secondly, from Comma-Separated Value (CSV) files. We will also look at a binary TFRecord format.