课程: TensorFlow: Neural Networks and Working with Tables
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
tf.data API
- [Instructor] Starting with the tf.data API. Let's take a look at the documentation from_tensor_slices. Now, if we scroll to the bottom, you can see that it takes in as input tensor, and what's returned are datasets. Now the TensorFlow 2.0 Documentation has more information about the dataset, and the from tensor slices method, if you want to find out more. Let's first make a copy of the dataframe. Now we want to include the training data and the label data. Since the from_tensor_slices method only accepts one argument, we'll use a tuple. So the first element is the training data, and the second element is the label. From the documentation, you can see that we can't use a dataframe directly, but we can use dictionaries. So let's convert the dataframe into a dictionary by using the dict function. Now let's take everything we learned and put it into a function. We'll also want the option of being able to shuffle the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。