Putting it all together

Here, you can find the entire code that has been used in the current chapter:

using Images, MLDatasets, MXNet, ImageViewtrain_x, train_y = CIFAR10.traindata();test_x, test_y = CIFAR10.testdata();# preview the images from train_x datasetpreview_img = zeros((0..., size(train_x, 1, 3)...));for i = 1:10    preview_img = vcat(preview_img, train_x[:, :, :, i])endimshow(colorview(RGB, permutedims(preview_img, (3, 2, 1))))### PREPARING THE DATASETtrain_x = train_x ./ 1;test_x = test_x ./ 1;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.