Preparing the data

The moment you get your first look at the data, we will move on to preparing MXNet arrays and creating data providers. The process is very similar to the one we had when working with MNIST except that now we need to handle a dataset of a higher dimensionality. This time, we will also include the creation of a data provider for test images.

Let's start by reserving the memory for our train, validation, and test datasets. We will be creating 4 dimensional MXNet arrays to store the future values:

train_length = 40000validation_length = 10000train_data_array = mx.zeros((size(train_x, 1, 2, 3)..., train_length...));train_label_array = mx.zeros(train_length);validation_data_array = mx.zeros((size(train_x, 1, 2, 3)..., validation_length...)); ...

Get Hands-On Computer Vision with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.