An epoch can be loosely defined as any number of iterations, not necessarily a pass through the entire training dataset. I think this is the case for the above paper.
What makes it difficult for comparison of you donât know these given details in this paper.
Not sure I understood correctly what you said, but that detail was given in the paper: 1 epoch = 1000 iterations.
I meant when these details are not given which is common in most recent papers. models comparison on epochs evaluation is not possible.
So if we use random crop to transform the training images, does it mean that the original images are never used in training? Is it only the transformed images that are fed into the optimization process?
Random crop assumes that the original image is larger than the target input size. So you cannot feed the originals as is.
Best regards
Thomas
Thank you for your reply!
Then what about other transformations such as random horizontal flip? Are the originals never used as well?
Random horizontal flip flips the image with the given probability, so with probability p
youâll get the flipped image, with 1-p
youâll get the original image.
I know this is an old post by now, but doesnât your code snippet leak the output class to the trainer? i.e. you might make all of the cat pictures light and all of the dog pictures dark, and then the network could learn to identify things based on your augmentation, rather than whatâs actually in the picture.
Iâm new to pytorch, and came here while googling around to find whether my augmentation should subclass Dataset or Dataloader, so maybe I missed something subtle.
Yes, this could be the case and Iâm not familiar with @Josiane_Rodriguesâs use case, so she might give you more information on it.
Maybe she is dealing with a custom dataset, which âneedsâ the different preprocessing steps?
Hi @Andrew_Wagner, at the time I hadnât thought of treating data that way, but itâs a good idea and it can work.
This thread has been very helpful in understanding pytorch augmentation. However, i am still lingering with some questions:
~ If I am applying on-the-fly augmentation transforms, then I have to actually wait more number of epochs to cover all the possible transformed images. Is there any custom way of covering all these possible transformed images in one epoch ?
~ Is there a way to set a max_limit on the number of transformed images I want to use in one epoch ? (i.e, if I want to increase the number of back-prop iterations more than len(dataset)//batch_size )
A code-snippet shall be much desired.
Thank you
-
While you could calculate the number of all transformed images for e.g. a random flipping in one dimension (it would just double), this wonât be feasible for other transformations, such as random rotation which work using floating point numbers. The number of âall possible transformed imagesâ could be theoretically calculated, but wouldnât make much sense as it would be huge.
-
You could manipulate the length of the
Dataset
by changing the return value inDataset.__len__(self)
.
So, if I have 100 images and then transform, 1 epoch is 100, and 2nd epoch is 100 too, but thatâs 100 different images because theyâve been transformed?. so I can have 200 different data
No, I wouldnât call them âdifferent imagesâ since you are only augmenting each sample.
Since random operations would most likely never repeat exactly the same transformation for each sample you would otherwise claim to have an infinite dataset.
So, if I have 100 images and then transform, 1 epoch is 100, and 2nd epoch is 100 too, but thatâs 100 different images because theyâve been transformed?. so I can have 200 different data
No, I think your logic is flawed, since I could use a single image, transform it in each iteration and claim I have unlimited samples expecting my model to never overfit.
Transformations augment the data but do not create new data samples.