In this chapter, you will dive into the details of neural networks, you will understand the basic layers like conv, maxpool,linear and look into more advanced architectures. By the end of this module you should be able to understand any network and design your own network.
A convolution operation on an image is application of 1 or more filters/masks/kernels to the input for feature extraction.
A pooling operation is reducing the size of my features by applying a max or average pooling.
A linear operation implemented via matrix multiplication is the end operation of classification network to obtain the class membership from the features extracted from my convolution filters
You can take a look at https://github.com/jhilikb/UCS668/blob/main/networks/Conv_details.pdf for few visual examples or run https://github.com/jhilikb/UCS668/blob/main/networks/convolution_visualizer.html for a visual demonstration.
Practice 4: You will find a streamlit based chapter at https://github.com/jhilikb/UCS668
Prerequisite: Make sure that you have the Train_Models folder in your course folder UCS668.
Start your python environment (say ucs668) that you set up (in Lab0) for the course using source ucs668/bin/activate (on your terminal if you use Linux/Mac) or using .\ucs668\Scripts\Activate.ps1 (on your powershell if using windows). In both cases you should be in the folder where you created the environment
cd networks
streamlit run networks.py
You will see the chapter start on your browser. In your browser, you can now explore the example tasks and understand how to solve them.
Exercises:-
a. Open the architecture of VGG16 (https://github.com/jhilikb/UCS668/blob/main/networks/diagrams/VGG-16-architecture-of-the-model.webp) and try to recreate that on your streamlit chapter, check the dimensions and parameters.
b. Now that you know the basic blocks check if you are able to understand AlexNet and VGG architectures.
c. Try to ask yourself what happens if in your own network you change the number of filters to different numbers
d. Ask yourself the role of kernel sizes, strides and dilation.
streamlit run networks4.py
e. Explore the different types of blocks i.e. depth convolution, attention, residual, inception.
6. streamlit run activations.py
f. Some common activation functions are provided in the chapter, explore more using https://docs.pytorch.org/docs/main/nn.html#non-linear-activations-other
Lab 4: In this lab you will create your own network using the different blocks you learned (conv, depthconv, attention, inception, residual)
You will submit the hardcopy in the lab itself for this lab.