Practical Deep Learning A Python Based Introduction 1st Edition Ronald T Kneusel pdf download
Practical Deep Learning A Python Based Introduction 1st Edition Ronald T Kneusel pdf download
https://ebookmeta.com/product/practical-deep-learning-a-python-
based-introduction-1st-edition-ronald-t-kneusel/
https://ebookmeta.com/product/math-for-deep-learning-what-you-
need-to-know-to-understand-neural-networks-1st-edition-ronald-t-
kneusel/
https://ebookmeta.com/product/how-ai-works-from-sorcery-to-
science-1st-edition-ronald-t-kneusel-2/
https://ebookmeta.com/product/how-ai-works-from-sorcery-to-
science-1st-edition-ronald-t-kneusel/
https://ebookmeta.com/product/castle-town-4-1st-edition-anya-
merchant/
Engineering Fluid Mechanics, Enhanced eText 12th
Edition Donald F. Elger
https://ebookmeta.com/product/engineering-fluid-mechanics-
enhanced-etext-12th-edition-donald-f-elger/
https://ebookmeta.com/product/internet-of-things-in-modern-
computing-theory-and-applications-smart-technologies-for-
engineers-and-scientists-1st-edition-vinay-chowdary-editor/
https://ebookmeta.com/product/requiem-a-montague-strong-
detective-novel-1st-edition-orlando-a-sanchez-sanchez-orlando-a/
https://ebookmeta.com/product/security-as-code-second-early-
release-bk-sarthak-das/
https://ebookmeta.com/product/topikmsater-final-ii-scan-korean-
education-research-group-the-kyunghee-university-global-campus/
His Heartbeat A Monster Curvy Girl Romance Monster
Between the Sheets Season 1 1st Edition Kat Baxter
https://ebookmeta.com/product/his-heartbeat-a-monster-curvy-girl-
romance-monster-between-the-sheets-season-1-1st-edition-kat-
baxter/
PRACTICAL DEEP LEARNING
A Python-Based Introduction
by Ronald T. Kneusel
San Francisco
PRACTICAL DEEP LEARNING. Copyright © 2021 by Ronald T. Kneusel.
All rights reserved. No part of this work may be reproduced or transmitted in any
form or by any means, electronic or mechanical, including photocopying, recording, or
by any information storage or retrieval system, without the prior written permission of
the copyright owner and the publisher.
The following images are reproduced with permission. Figure 4-2: the middle image is
licensed under the Creative Commons Attribution 2.0 Generic license
(https://commons.wikimedia.org/wiki/File:Border_Collie_liver_portrait.jpg) and the
right image is licensed under the Creative Commons Attribution-Share Alike 3.0
Unported license (https://commons.wikimedia.org/wiki/File:Lynn-
red_merle_Aussie_12_Months.jpg)
No Starch Press and the No Starch Press logo are registered trademarks of No Starch
Press, Inc. Other product and company names mentioned herein may be the
trademarks of their respective owners. Rather than use a trademark symbol with every
occurrence of a trademarked name, we are using the names only in an editorial fashion
and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The information in this book is distributed on an “As Is” basis, without warranty.
While every precaution has been taken in the preparation of this work, neither the
author nor No Starch Press, Inc. shall have any liability to any person or entity with
respect to any loss or damage caused or alleged to be caused directly or indirectly by
the information contained in it.
For my children: David, Peter, Paul, Monica, Joseph, and Francis.
About the Author
Ron Kneusel has been working with machine learning in industry since
2003 and completed a PhD in machine learning from the University of
Colorado, Boulder, in 2016. He currently works for L3Harris
Technologies, Inc. Ron has two other books, both available from
Springer: Numbers and Computers, and Random Numbers and Computers.
About the Technical Reviewer
Paul Nord works for the Valparaiso University Department of Physics
and Astronomy as a technical specialist and research assistant. He is a
1991 graduate from Valparaiso University with a degree in physics. He
also earned a master’s degree in analytics and modeling from VU in
2017. Paul has worked on numerous machine learning projects,
including the Disk Detective Collaboration, a Faculty Learning
Community discussion group, and an art show using Google Deep
Dream. Paul’s other activities include science outreach programs for
kids of all ages.
BRIEF CONTENTS
Foreword
Acknowledgments
Introduction
Chapter 1: Getting Started
Chapter 2: Using Python
Chapter 3: Using NumPy
Chapter 4: Working with Data
Chapter 5: Building Datasets
Chapter 6: Classical Machine Learning
Chapter 7: Experiments with Classical Models
Chapter 8: Introduction to Neural Networks
Chapter 9: Training a Neural Network
Chapter 10: Experiments with Neural Networks
Chapter 11: Evaluating Models
Chapter 12: Introduction to Convolutional Neural Networks
Chapter 13: Experiments with Keras and MNIST
Chapter 14: Experiments with CIFAR-10
Chapter 15: A Case Study: Classifying Audio Samples
Chapter 16: Going Further
Index
CONTENTS IN DETAIL
FOREWORD
ACKNOWLEDGMENTS
INTRODUCTION
Who Is This Book For?
What Can You Expect to Learn?
About This Book
1
GETTING STARTED
The Operating Environment
NumPy
scikit-learn
Keras with TensorFlow
Installing the Toolkits
Basic Linear Algebra
Vectors
Matrices
Multiplying Vectors and Matrices
Statistics and Probability
Descriptive Statistics
Probability Distributions
Statistical Tests
Graphics Processing Units
Summary
2
USING PYTHON
The Python Interpreter
Statements and Whitespace
Variables and Basic Data Structures
Representing Numbers
Variables
Strings
Lists
Dictionaries
Control Structures
if-elif-else Statements
for Loops
while Loops
break and continue Statements
with Statement
Handling Errors with try-except Blocks
Functions
Modules
Summary
3
USING NUMPY
Why NumPy?
Arrays vs. Lists
Testing Array and List Speed
Basic Arrays
Defining an Array with np.array
Defining Arrays with 0s and 1s
Accessing Elements in an Array
Indexing into an Array
Slicing an Array
The Ellipsis
Operators and Broadcasting
Array Input and Output
Random Numbers
NumPy and Images
Summary
4
WORKING WITH DATA
Classes and Labels
Features and Feature Vectors
Types of Features
Feature Selection and the Curse of Dimensionality
Features of a Good Dataset
Interpolation and Extrapolation
The Parent Distribution
Prior Class Probabilities
Confusers
Dataset Size
Data Preparation
Scaling Features
Missing Features
Training, Validation, and Test Data
The Three Subsets
Partitioning the Dataset
k-Fold Cross Validation
Look at Your Data
Searching for Problems in the Data
Cautionary Tales
Summary
5
BUILDING DATASETS
Irises
Breast Cancer
MNIST Digits
CIFAR-10
Data Augmentation
Why Should You Augment Training Data?
Ways to Augment Training Data
Augmenting the Iris Dataset
Augmenting the CIFAR-10 Dataset
Summary
6
CLASSICAL MACHINE LEARNING
Nearest Centroid
k-Nearest Neighbors
Naïve Bayes
Decision Trees and Random Forests
Recursion Primer
Building Decision Trees
Random Forests
Support Vector Machines
Margins
Support Vectors
Optimization
Kernels
Summary
7
EXPERIMENTS WITH CLASSICAL MODELS
Experiments with the Iris Dataset
Testing the Classical Models
Implementing a Nearest Centroid Classifier
Experiments with the Breast Cancer Dataset
Two Initial Test Runs
The Effect of Random Splits
Adding k-fold Validation
Searching for Hyperparameters
Experiments with the MNIST Dataset
Testing the Classical Models
Analyzing Runtimes
Experimenting with PCA Components
Scrambling Our Dataset
Classical Model Summary
Nearest Centroid
k-Nearest Neighbors
Naïve Bayes
Decision Trees
Random Forests
Support Vector Machines
When to Use Classical Models
Handling Small Datasets
Dealing with Reduced Computational Requirements
Having Explainable Models
Working with Vector Inputs
Summary
8
INTRODUCTION TO NEURAL NETWORKS
Anatomy of a Neural Network
The Neuron
Activation Functions
Architecture of a Network
Output Layers
Representing Weights and Biases
Implementing a Simple Neural Network
Building the Dataset
Implementing the Neural Network
Training and Testing the Neural Network
Summary
9
TRAINING A NEURAL NETWORK
A High-Level Overview
Gradient Descent
Finding Minimums
Updating the Weights
Stochastic Gradient Descent
Batches and Minibatches
Convex vs. Nonconvex Functions
Ending Training
Updating the Learning Rate
Momentum
Backpropagation
Backprop, Take 1
Backprop, Take 2
Loss Functions
Absolute and Mean Squared Error Loss
Cross-Entropy Loss
Weight Initialization
Overfitting and Regularization
Understanding Overfitting
Understanding Regularization
L2 Regularization
Dropout
Summary
10
EXPERIMENTS WITH NEURAL NETWORKS
Our Dataset
The MLPClassifier Class
Architecture and Activation Functions
The Code
The Results
Batch Size
Base Learning Rate
Training Set Size
L2 Regularization
Momentum
Weight Initialization
Feature Ordering
Summary
11
EVALUATING MODELS
Definitions and Assumptions
Why Accuracy Is Not Enough
The 2 × 2 Confusion Matrix
Metrics Derived from the 2 × 2 Confusion Matrix
Deriving Metrics from the 2 × 2 Table
Using Our Metrics to Interpret Models
More Advanced Metrics
Informedness and Markedness
Discovering Diverse Content Through
Random Scribd Documents
there stalks that dreadful mother of hers, and her soul-blighting Uncle
Cyril, and her dreadful little twin brothers, and then—walking with a
man whom you happen to hate—the bride’s sister Gertie, the bright
little girl whom you really meant to marry.
THE NEWLY
RICH ELEMENT
Heroic little bands like
this annually advance
upon the fashionable
resorts, to make an
overt attack upon
society. These
invaders come from
the heart of the wilds,
where the head of the
family (merely a courtesy title) is known locally as the Gravel Roof
King. Little family groups of this sort are not considered complete
without four daughters, at least, each more painfully unmarried than
the rest.
THE TENNIS
HOUNDS
Any day you may see
the tennis hounds
assembling at the
court for a set of
mixed—hopelessly
mixed—doubles. The
curious thing about
most of these strange
creatures is that no living-eye has ever beheld them actually playing;
they appear on the court with much ceremony, carrying all the
properties, and wearing the most technically correct costumes, but
that is as far as most of these sartorial creatures ever seem to go.
MIXED FOURSOMES
There is always a liberal assortment of these foursomes scattered over
the seaside golf course. They are the slowest-moving bodies known to
science; there is a wait of twenty minutes on every tee, while an
argument rages as to whether it took Ethel fifteen or seventeen to get
out of the rough, every argument, for and against, being carefully
considered. Any other players who happen to be golfing on the course
at the time, have just about as much chance of passing as the
Germans had at Verdun.
THE RECENTLY RICH THE LURE OF THE
The little gatherings of those to STAGE
whom wealth has all the It is simply wonderful how the
refreshing charm of novelty are a drama has helped our resorts
familiar and well-loved sight in the along. It’s surprising how much a
seaside resorts. They have done pair of friendly young actresses
nicely for themselves in munitions can add to the charm of a place.
stocks, and expect to devote the The male half of the visitors are
years of peace to well-earned unanimous in declaring that the
spending. drama is the greatest institution of
the age.
SEASIDE
PANORAMA
Ask any experienced
traveler what
impressed him most
about the seaside,
and he will
immediately answer
that the welcome
committee, which met
him at the portals of the hotel, and which bade him a tender farewell,
is the memory which he will cherish longest,—even to his dying day.
GLIMPSES WITHIN
How little we know of the “vie intime” of the fashionable stage idols,
twinkling stars in the dramatic firmament, far-removed from the
orchestra astronomers. It has been our recent privilege to interview,
at close range, lovely Angeline Etoille, the famous dancer of two
continents, whose throbbing reactions to the simple things of life are
indeed a revelation. Her enthusiasm for her art is inspiring. Her whole
life, for that matter,
may be said to be a
lesson in adorable
enthusiasms.
An Interview with A Great Dancer
Privileged Peeps into the Soul of Mlle. Angeline,
of Paris
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.