Computer Vision News - June 2021

10 Computer Vision Tool ᇶ Calculates the model accuracy. ᇶ If the model accuracy is >= 0.999, then early-exiting is executed. ᇶ If the actual accuracy is the best so far, then the model is saved to mnist_conv. bson. Also, the new best accuracy and the current epoch is saved. ᇶ If there has not been any improvement for the last 5 epochs, then the learning rate is dropped and the process waits a little longer for the accuracy to improve. ᇶ If the last improvement was more than 10 epochs ago, then the process is terminated. function test(; kws...) args = Args(; kws...) # Loading the test data _,test_set = get_processed_data(args) # Re-constructing the model with random initial weights model = build_model(args) # Loading the saved parameters BSON.@load joinpath(args.savepath, "mnist_conv.bson") params # Loading parameters onto the model Flux.loadparams!(model, params) test_set = gpu.(test_set) model = gpu(model) @show accuracy(test_set...,model) end test loads the MNIST test data set, reconstructs the model, and loads the saved parameters ( in mnist_conv.bson ) onto it. Finally, it computes our model’s predictions for the test set and shows the test accuracy (around 99%). Wrap up I hope you had fun with this article! Feel free to always ask any questions or send through your recommendations. The resources and contributors for the Flux community: Convolutional Neural Networks (CNNs / ConvNets). Convolutional Neural Networks Tutorial in PyTorch. – Elliot Saba, Adarsh Kumar, Mike J Innes, Dhairya Gandhi, Sudhanshu Agrawal, Sambit Kumar Dash, fps.io , Carlo Lucibello, Andrew Dinhobl, Liliana Badillo Enjoy your month and keep having fun Finally, to test our model we define the test function:

RkJQdWJsaXNoZXIy NTc3NzU=