Dataset

Learn how datasets are represented in TensorFlow's input pipeline.

Chapter Goals:

  • Learn how to create a dataset in TensorFlow
  • Implement a function that creates a dataset from NumPy data

A. Input pipeline

In TensorFlow, the input pipeline for executing a machine learning model is represented by the Dataset class (which we’ll refer to as simply a dataset). A dataset can be created for a variety of input values, from NumPy arrays to protocol buffers. The most basic way to create a dataset is with the ...

Press + to interact
import numpy as np
import tensorflow as tf
data = np.array([[ 1. , 2.1],
[ 2. , 3. ],
[ 8.1, -10. ]])
d1 = tf.data.Dataset.from_tensor_slices(data)
print(d1)

In the ...

Access this course and 1400+ top-rated courses and projects.