This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
I am reading this amazing series(https://uvadlc-notebooks.readthedocs.io/en/latest). I always struggle with revisiting | |
my old code that has a lot of tensor manipulation. Experimented with reimplementing their MultiHeadAttention layer using | |
einops syntax that feels more human readable. | |
''' | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import einops | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from am42_fsd.data.quickdraw import QuickDraw | |
from torch.utils.data import DataLoader | |
from tqdm.auto import tqdm | |
quickdraw = QuickDraw("path to numpy_bitmap folder") | |
dataloader = DataLoader(quickdraw, shuffle=True, batch_size=64, num_workers=4) | |
for images, cat_id in tqdm(dataloader): | |
pass |