Preparing the data

What could be the requirements for our first neural network? It should accept our images as an input, do some magic, and return probabilities for the image corresponding to one of 10 classes—that is, if the number is from 0 to 9.

Unfortunately, MXNet does not accept the images and responses in a format returned by the traindata and testdata functions, and they should both be converted into arrays controlled by MXNet.

From the MNIST dataset, we know that train_x and train_y consist of 60,000 unique images. We will first split the train datasets into two trains and validation into 50,000 and 10,000, accordingly. The validation dataset is required to control the learning process of the neural network and monitor its performance ...

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.