This book provides a comprehensive introduction to deep learning knowledge. With the help of mathematical formulas, diagrams, and codes, it aims to help readers understand neural networks from a mathematical, conceptual, and application perspective. Readers can follow this book to build and train neural network models to solve practical problems. In addition, this book focuses on convolutional neural networks and recurrent neural networks, and provides methods for using the PyTorch open source neural network library, which helps learn to build more advanced neural network architectures. Chapter 1 Basic Concepts 1 1.1 Functions 2 1.2 Derivatives 6 1.3 Nested Functions 8 1.4 The Chain Rule 9 1.5 Introduction to Examples 12 1.6 Functions with Multiple Inputs 15 1.7 Derivatives of Functions with Multiple Inputs 16 1.8 Functions with Multiple Vector Inputs 17 1.9 Creating New Features Based on Existing Features 18 1.10 Derivatives of Functions with Multiple Vector Inputs 20 1.11 Vector Functions and Their Derivatives: A Step Further 22 1.12 Computational Graphs with Two 2D Matrix Inputs 25 1.13 The Fun Part: The Backward Pass 28 1.14 Summary 34 Chapter 2 Basic Principles 35 2.1 Overview of Supervised Learning 36 2.2 Supervised Learning Models 38 2.3 Linear Regression 38 2.3.1 Linear Regression: Schematic 39 2.3.2 Linear Regression: More Useful Schematics and Math 41 2.3.3 Adding an Intercept 41 2.3.4 Linear Regression: Code 42 2.4 Training the Model 42 2.4.1 Computing the Gradient: Diagram 43 2.4.2 Computing the Gradient: Math and Some Code 43 2.4.3 Computing the Gradient: Full Code 44 2.4.4 Training the Model with the Gradient 45 2.5 Evaluating the Model: Training and Test Sets 46 2.6 Evaluating the Model: Code 46 2.7 Building a Neural Network from Scratch 49 2.7.1 Step 1: A Series of Linear Regressions 49 2.7.2 Step 2: A Nonlinear Function 50 2.7.3 Step 3: Another Linear Regression 50 2.7.4 Diagram 51 2.7.5 Code 52 2.7.6 Neural Networks: The Backward Pass 53 2.8 Training and Evaluating Your First Neural Network 55 2.9 Summary 57 Chapter 3 Deep Learning from Scratch 58 3.1 Defining Deep Learning 58 3.2 Neural Network Building Blocks: Operations 59 3.2.1 Diagram 60 3.2.2 Code 61 3.3 Neural Network Building Blocks: Layers 62 3.4 Building New Building Blocks on Top of Building Blocks 64 3.4.1 Blueprint of Layers 66 3.4.2 Dense Layers 68 3.5 NeuralNetwork and Other Classes 69 3.5.1 Diagram 70 3.5.2 Code 70 3.5.3 Loss Class 71 3.6 Building Deep Learning Models from Scratch 72 3.6.1 Implementing Batch Training 73 3.6.2 NeuralNetwork: Code 73 3.7 Optimizers and Trainers 75 3.7.1 Optimizers 76 3.7.2 Trainers 77 3.8 Integration 79 3.9 Summary and Outlook 80 Chapter 4 Extensions 81 4.1 Some Intuition about Neural Networks 82 4.2 Softmax Cross Entropy Loss 84 Component 1: Softmax Function 84 4.2.2 Component 2: Cross Entropy Loss 85 4.2.3 Notes on Activation Functions 87 4.3 Experiment 90 4.3.1 Data Preprocessing 90 4.3.2 Model 91 4.3.3 Experiment: Softmax Cross Entropy Loss Function 92 4.4 Momentum 92 4.4.1 Understanding Momentum 93 4.4.2 Implementing Momentum in the Optimizer Class 93 4.4.3 Experiment: Stochastic Gradient Descent with Momentum 94 4.5 Learning Rate Decay 95 4.5.1 Types of Learning Rate Decay 95 4.5.2 Experiment: Learning Rate Decay 97 4.6 Weight Initialization 97 4.6.1 Math and Code 99 4.6.2 Experiment: Weight Initialization 100 4.7 Dropout 100 4.7.1 Definition 100 4.7.2 Implementation 101 4.7.3 Experiment: Dropout 102 4.8 Summary 104 Chapter 5 CNN 105 5.1 Neural Networks and Representation Learning 105 5.1.1 Different Architectures for Image Data 106 5.1.2 Convolution Operation 107 5.1.3 Multi-channel Convolution Operation 108 5.2 Convolution Layer 109 5.2.1 Implementation Significance 110 5.2.2 The Difference between Convolution Layer and Fully Connected Layer 111 5.2.3 Prediction Using Convolution Layer: Flatten Layer 111 5.2.4 Pooling Layer 112 5.3 Implementing Multi-channel Convolution Operation 114 5.3.1 Forward Pass 114 5.3.2 Backward Pass 117 5.3.3 Batching 120 5.3.4 Two-dimensional Convolution 121 5.3.5 The Last Element: Channel 123 5.4 5.4.1 The Flatten Operation 126 5.4.2 The Complete Conv2D Layer 127 5.4.3 Experiments 128 5.5 Summary 129 Chapter 6 RNNs 130 6.1 A Key Limitation: Handling Branches 131 6.2 Automatic Differentiation 132 6.3 Motivation for RNNs 137 6.4 Introduction to RNNs 138 6.4.1 The First RNN Class: RNNLayer 139 6.4.2 The Second RNN Class: RNNNode 140 6.4.3 Integrating the RNNNode Class and the RNNLayer Class 140 6.4.4 Backward Pass 142 6.5 RNNs: Code 143 6.5.1 The RNNLayer Class 144 6.5.2 Basic Elements of the RNNNode Class 147 6.5.3 The vanilla RNNNode Class 148 6.5.4 Limitations of the vanilla RNNNode class 150 6.5.5 GRUNode class 151 6.5.6 LSTMNode class 154 6.5.7 Data representation based on character-level RNN language model 156 6.5.8 Other language modeling tasks 157 6.5.9 Combining RNNLayer variants 158 6.5.10 Tying it all together 158 6.6 Summary 159 Chapter 7 PyTorch 160 7.1 PyTorch Tensor 160 7.2 Deep Learning with PyTorch 161 7.2.1 PyTorch Elements: Model Class and Its Layer Class 162 7.2.2 Implementing Neural Network Basics with PyTorch: DenseLayer Class 163 7.2.3 Example: Boston Housing Price Model Based on PyTorch 164 7.2.4 7.2.5 PyTorch Elements: Trainer Class 165 7.2.6 PyTorch Optimization Learning Techniques 168 7.3 CNN in PyTorch 168 7.4 LSTM in PyTorch 173 7.5 Postscript: Unsupervised Learning with Autoencoders 175 7.5.1 Representation Learning 175 7.5.2 Approaches to Unlabeled Scenarios 176 7.5.3 Implementing Autoencoders in PyTorch 176 7.5.4 More Powerful Unsupervised Learning Tests and Solutions 181 7.6 Summary 182 Appendix Deep Dive 183 About the Author 192 About the Cover 192
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore