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
Mobile Artificial Intelligence Projects

You're reading from  Mobile Artificial Intelligence Projects

Product type Book
Published in Mar 2019
Publisher Packt
ISBN-13 9781789344073
Pages 312 pages
Edition 1st Edition
Languages
Authors (3):
Karthikeyan NG Karthikeyan NG
Profile icon Karthikeyan NG
Arun Padmanabhan Arun Padmanabhan
Profile icon Arun Padmanabhan
Matt Cole Matt Cole
Profile icon Matt Cole
View More author details

Table of Contents (12) Chapters

Preface 1. Artificial Intelligence Concepts and Fundamentals 2. Creating a Real-Estate Price Prediction Mobile App 3. Implementing Deep Net Architectures to Recognize Handwritten Digits 4. Building a Machine Vision Mobile App to Classify Flower Species 5. Building an ML Model to Predict Car Damage Using TensorFlow 6. PyTorch Experiments on NLP and RNN 7. TensorFlow on Mobile with Speech-to-Text with the WaveNet Model 8. Implementing GANs to Recognize Handwritten Digits 9. Sentiment Analysis over Text Using LinearSVC 10. What is Next? 11. Other Books You May Enjoy

Building a deeper neural network

In this section, we will use the concepts we learned about in this chapter to build a deeper neural network to classify handwritten digits:

  1. We will start with a new notebook and then load the required dependencies:
import numpy as np
np.random.seed(42) import keras from keras.datasets import mnist from keras.models import Sequential
from keras.layers import Dense from keras.layers import Dropout # new! from keras.layers.normalization
# new! import BatchNormalization # new! from keras import regularizers # new! from keras.optimizers import SGD
  1. We will now load and pre-process the data:
(X_train,y_train),(X_test,y_test)= mnist.load_data()
X_train= X_train.reshape(60000,784).
astype('float32')
X_test= X_test.reshape(10000,784).astype('float32')
X_train/=255 X_test/=255 n_classes=10 y_train=keras.utils.to_categorical(y_train,n_classes...
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}