Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Deep Learning with Microsoft Cognitive Toolkit Quick Start Guide

You're reading from  Deep Learning with Microsoft Cognitive Toolkit Quick Start Guide

Product type Book
Published in Mar 2019
Publisher Packt
ISBN-13 9781789802993
Pages 208 pages
Edition 1st Edition
Languages
Author (1):
Willem Meints Willem Meints
Profile icon Willem Meints

Table of Contents (9) Chapters

Preface 1. Getting Started with CNTK 2. Building Neural Networks with CNTK 3. Getting Data into Your Neural Network 4. Validating Model Performance 5. Working with Images 6. Working with Time Series Data 7. Deploying Models to Production 8. Other Books You May Enjoy

Making predictions with a neural network

One of the most satisfying things after training a deep learning model is to actually use it in an application. For now, we'll limit ourselves to using the model with a sample that we randomly pick from our test set. But, later on, in Chapter 7, Deploying Models to Production, we'll look at how to save the model to disk and use it in C# or .NET to build applications with it.

Let's write the code to make a prediction with the neural network that we trained:

sample_index = np.random.choice(X_test.shape[0])
sample = X_test[sample_index]

inverted_mapping = {
1: 'Iris-setosa',
2: 'Iris-versicolor',
3: 'Iris-virginica'
}

prediction = z(sample)
predicted_label = inverted_mapping[np.argmax(prediction)]

print(predicted_label)

Follow the given steps:

  1. First, pick a random item from the test set using...
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 €14.99/month. Cancel anytime}