Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mobile Artificial Intelligence Projects

You're reading from   Mobile Artificial Intelligence Projects Develop seven projects on your smartphone using artificial intelligence and deep learning techniques

Arrow left icon
Product type Paperback
Published in Mar 2019
Publisher Packt
ISBN-13 9781789344073
Length 312 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Arun Padmanabhan Arun Padmanabhan
Author Profile Icon Arun Padmanabhan
Arun Padmanabhan
Karthikeyan NG Karthikeyan NG
Author Profile Icon Karthikeyan NG
Karthikeyan NG
Matt Cole Matt Cole
Author Profile Icon Matt Cole
Matt Cole
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Artificial Intelligence Concepts and Fundamentals 2. Creating a Real-Estate Price Prediction Mobile App FREE CHAPTER 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 $19.99/month. Cancel anytime