April 2017
Beginner to intermediate
358 pages
9h 30m
English
To start with, we will take our CIFAR images and create a dataset with them. Unlike previously, we are going to preserve the pixel structure—that is, in rows and columns. First, load all the batches into a list:
import osimport numpy as np data_folder = os.path.join(os.path.expanduser("~"), "Data", "cifar-10-batches-py")batches = [] for i in range(1, 6): batch_filename = os.path.join(data_folder, "data_batch_{}".format(i)) batches.append(unpickle(batch_filename)) break
The last line, the break, is to test the code—this will drastically reduce the number of training examples, allowing you to quickly see if your code is working. I'll prompt you later to remove this line after you have tested that the code works.
Next, create ...
Read now
Unlock full access