How can I control (or at least record) parameters passed to torchvision transform on an image by image basis?
I am studying the effects of blur and noise on an image classifier, and I would like to use torchvision transforms to apply varied amounts of Gaussian blur and Poisson noise my images. It's pretty trivial to specify a probability distribution for the noise and blur parameters, but I can't figure out how to either control those parameters on an image by image basis or get PyTorch to record the parameters actually used for each image. Could I do this by defining my transform inside the dataset class rather than passing it to the dataloader, so that each time I load an image a custom transform is created and it's parameters are returned with the image and its label?

The transform mechanism provided by PyTorch uses simple callable objects that are called automatically upon loading samples from Dataset. There is nothing fundamentally stopping you from doing all your transforms from Dataset itself. Since you haven't provided any code, I can only offer some pseudocodes
from torchvision.transforms.functional import gaussian_blur

class CoolDataset(Dataset):
    def __init__(self, root_dir):
        self.image_list = os.listdir(root_dir)
        self.sample_wise_blur_std = [0.1, 0.2, ..]

    def __getitem__(self, i):
        img = read_image(self.image_list[i]) # .shape is (C,H,W)
        blurred = gaussian_blur(img, (3,3), std=self.sample_wise_blur_std[i])
        return img, self.sample_wise_blur_std[i]

with transform parameters fused in your Dataset definition, your Dataloader will collate them for you
cooldl = DataLoader(CoolDataset('/path/to/images'), ...)
for X, blurs in cooldl:
    # X.shape is (B,C,H,W)
    # blurs.shape is (B,)
    pass

I hope this is what you are looking for.
