I am one of those people who function better by writing things down. One day, I realized that most of my notes don’t have to be private, so here they are - my second brain. Be warned that, if you stumble upon something here that doesn’t make sense to you, it isn’t meant to!
Today I learned
On the AI/Fastai front: If x is a torch.Tensor and x.shape is torch.Size([4, 3, 5]), it means x contains 4 2D matrices with 3 rows and 5 columns. Also, x is 3D matrix, the technical term for which would be a rank-3 tensor. When images are represented using PyTorch tensors, the first dimension corresponds to the number of channels in it. (For e.g., an RGB image will contain 3 channels and, therefore, the first element in the tensor shape will be 3.) Matplotlib’s imshow function expects number of channels at the end and you can modify a tensor to that by applying the permute function.