February 2018
Intermediate to advanced
450 pages
11h 27m
English
We need to analyze the dataset and do some basic preprocessing. So, let's start off by defining some helper functions that will enable us to load a specific batch from the five batches that we have and print some analysis about this batch and its samples:
# Defining a helper function for loading a batch of imagesdef load_batch(cifar10_dataset_dir_path, batch_num): with open(cifar10_dataset_dir_path + '/data_batch_' + str(batch_num), mode='rb') as file: batch = pickle.load(file, encoding='latin1') input_features = batch['data'].reshape((len(batch['data']), 3, 32, 32)).transpose(0, 2, 3, 1) target_labels = batch['labels'] return input_features, target_labels
Then, we define a function that can help us display ...
Read now
Unlock full access