Category Archives: PyTorch
How to initialize weight and bias in PyTorch?
We’re gonna check instant m if it’s convolution layer then we can initialize with a variety of different initialization techniques we’re just gonna do the kaiming_uniform_ on the weight of that specific module and we’re only gonna do if it’s a conv2d.
How to apply Gradient Clipping in PyTorch
The value for the gradient vector norm or preferred range can be configured by trial and error, by using common values used in the literature, or by first observing common vector norms or ranges via experimentation and then choosing a sensible value.
Pytorch Image Augmentation using Transforms.
The quality of the images will not be the same from each source. Some images might be of very high quality while others might be just plain bad. In such scenarios, we can blur the image. This helps make our deep learning model more robust. Transforms provide a class for randomly change the brightness, contrast, and saturation of an image.
Convolutional Neural Network using Sequential model in PyTorch.
How easy this looks compared to when we had to construct a model through the class way of doing it. Sequential class lives in the neural network package and this is a class that we are building by or we’re building an instance of this class by passing in other modules in a sequential.