Deep Learning Practical Session 6
Deep Learning Practical Session 6
Franc?ois Fleuret
December 19, 2022
Introduction
The objective of this session is to observe the impact of residual connections and batch-normalization on the gradient norm at different depth in a residual network. You can start this session with an embryo of code that includes an implementation of a residual network and an example of graph drawing with Matplotlib:
1 Modification of the ResNet implementation
Edit the implementation of the ResNet and ResNetBlock so that you can pass two Boolean flags skipconnections and batchnormalization to specify if these features are activated or not.
2 Monitoring the gradient norm
Write a function getstats(skipconnections, batchnormalization) that 1. creates a model with 30 residual blocks, 10 channels, 3 ? 3 kernels, 2. computes the norm of the gradient of the cross-entropy with respect to the weights of the first convolutional layer of each residual block, on 100 individual samples, 3. returns the 30 ? 100 resulting tensor.
Hint: You can create a list of the weight tensors of the first convolution layer of each block with: monitoredparameters = [ b.conv1.weight for b in model.resnetblocks ] and use it to get the gradient norm for each.
3 Graph
Plot for the four configurations of the two Boolean flags skipconnections and batchnormalization the average of the gradient norm vs. depth.
1 of 2
If you use a notebook, you can set the Maplotlib backend to the 'inline' one to have graphs appear in it with %matplotlib inline
2 of 2
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- lab4 multimedia part ii university of california
- deep learning practical session 6
- 1 5 https 21yypt
- matplotlib tutorialspoint
- python for data analysis and machine learning
- matplotlib 2d and 3d plotting in python
- an introduction to using python with
- example of converted jupyter notebook read the
- 1 2 https 222at1
Related searches
- deep learning conference 2018
- deep learning trend
- deep learning vs machine learning
- deep learning future
- deep learning pdf
- deep learning neural network
- deep learning versus machine learning
- types of deep learning networks
- deep learning neural network tutorial
- deep learning regression
- deep learning types
- deep learning layer types