This repository contains a number of Python implementations in deep learning to help you with your interview, including conv2d, conv3d, interpolation, pooling, activation, batch normalization, LSTM, optimization, and backpropagation.
If you have any suggestions, please feel free to contact me or directly pull the request.
Contributed by Yu-Cheng Chou.
--- Last updated: 08/12/2021 ---
2D Convolution plays a key role in the development of artificial intelligence and is widely used in current research works. The inductive bias of convolution is locality and spatial invariance, i.e., the grid elements with similar space are related to each other, and the spatial invariance (shared kernel weight). The above characteristics are reflected in the code which is in conv2d.py
.
Compared to 2D Convolution, 3D Convolution extends the kernel dimension to calculate temporal information which is demonstrated in conv3d.py
.
Interpolation aims to resize the images or feature maps. Researchers usually adopt Bilinear interpolation with align_corners=False
. However, in semantic segmentation task, researchers set align_corners=True
in most cases. The difference of two settings as shown below. When align_corners is set to False, pixels are regarded as a grid of points (points at the corners are aligned). When align_corners is set to Ture, pixels are regarded as 1x1 areas (area boundaries, rather than their centers, are aligned). The python implementation in interpolation.py
provides the Bilinear interpolation with align_corners=True
.
Pooling operation increases the receptive field, translation invariance with fewer parameters. There are max pooling and average pooling operation and this repository provides the max pooling operation in pooling.py
.