Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Deep Learning with PyTorch Quick Start Guide

You're reading from  Deep Learning with PyTorch Quick Start Guide

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781789534092
Pages 158 pages
Edition 1st Edition
Languages
Author (1):
David Julian David Julian
Profile icon David Julian

Benchmarking models

Benchmarking and evaluation are core to the success of any deep learning exploration. We will develop some simple code to evaluate two key performance measures: the accuracy and the training time. We will use the following model template:

This model is the most common and basic linear template for solving MNIST. You can see we initialize each layer, in theinit method, by creating a class variable that is assigned to a PyTorch nn object. Here, we initialize two linear functions and a ReLU function. The nn.Linear function takes an input size of 28*28 or 784. This is the size of each of the training images. The output channels or the width of the network are set to 100. This can be set to anything, and in general a higher number will give better performance within the constraints of computing resources and the tendency for wider networks to overfit training data...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}