Path: blob/master/second_edition/chapter02_mathematical-building-blocks.ipynb
713 views
Kernel: Python 3
This is a companion notebook for the book Deep Learning with Python, Second Edition. For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, figures, and pseudocode.
If you want to be able to follow what's going on, I recommend reading the notebook side by side with your copy of the book.
This notebook was generated for TensorFlow 2.6.
The mathematical building blocks of neural networks
A first look at a neural network
Loading the MNIST dataset in Keras
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
The network architecture
In [0]:
The compilation step
In [0]:
Preparing the image data
In [0]:
"Fitting" the model
In [0]:
Using the model to make predictions
In [0]:
In [0]:
In [0]:
In [0]:
Evaluating the model on new data
In [0]:
Data representations for neural networks
Scalars (rank-0 tensors)
In [0]:
In [0]:
Vectors (rank-1 tensors)
In [0]:
In [0]:
Matrices (rank-2 tensors)
In [0]:
Rank-3 and higher-rank tensors
In [0]:
Key attributes
In [0]:
In [0]:
In [0]:
In [0]:
Displaying the fourth digit
In [0]:
In [0]:
Manipulating tensors in NumPy
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
The notion of data batches
In [0]:
In [0]:
In [0]:
Real-world examples of data tensors
Vector data
Timeseries data or sequence data
Image data
Video data
The gears of neural networks: tensor operations
Element-wise operations
In [0]:
In [0]:
In [0]:
In [0]:
Broadcasting
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
Tensor product
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
Tensor reshaping
In [0]:
In [0]:
In [0]:
In [0]:
Geometric interpretation of tensor operations
A geometric interpretation of deep learning
The engine of neural networks: gradient-based optimization
What's a derivative?
Derivative of a tensor operation: the gradient
Stochastic gradient descent
Chaining derivatives: The Backpropagation algorithm
The chain rule
Automatic differentiation with computation graphs
The gradient tape in TensorFlow
In [0]:
In [0]:
In [0]:
Looking back at our first example
In [0]:
In [0]:
In [0]:
In [0]:
Reimplementing our first example from scratch in TensorFlow
A simple Dense class
In [0]:
A simple Sequential class
In [0]:
In [0]:
A batch generator
In [0]:
Running one training step
In [0]:
In [0]:
In [0]:
The full training loop
In [0]:
In [0]:
Evaluating the model
In [0]: