PyTorch RNN From Scratch

API, Code, ML, Python, PyTorch
PyTorch RNN From Scratch New to pyTorch, as usual, wanted to learn by doing things from scratch. Below are a few blogs that got me going.Number 1, really from scratch but it is using nn.RNN, I wanted even lower.. :) - Tutorial that set me thinking..but this is text classification not using Dataloader and batch processing, as I consider batching is tricky one to get going, so, I wanted to indulge on it ;)[code] import torchimport torch.nn as nn import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt import numpy as np [/code]Load the MNIST data[code] BATCH_SIZE = 64 # list all transformations transform = transforms.Compose( [transforms.ToTensor()]) # download and load training dataset trainset = torchvision.datasets.MNIST(root='./data', train=True, download=True, transform=transform) trainloader =, batch_size=BATCH_SIZE,shuffle=True, num_workers=2,drop_last=True) # download and load testing…
Read More