Category Archives: PyTorch
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.
How to use GloVe Pre-Train Word Embedding in PyTorch using Embedding Layer?
we need to create a matrix of one embedding for each word in the training dataset. We can do that by enumerating all unique words in the Tokenizer.word_index and locating the embedding weight vector from the loaded GloVe embedding.
Pytorch Image Augmentation using torchvision 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.