Problem or bug with custom transformation used in batch_tfms

My understanding was that transformations specified in batch_tfms apply to the train dataset only, leaving the valid dataset alone. However, after I wrote and a custom transformation and used it in batch_tfms, I find that it affects both the train and the valid datasets. This behavior is similar to that in v2. However, in v2 there existed a way to reset the valid dataset after the fact, but I can’t find any way of doing this in V3.

The class that call the custom transformation is this:

The DataBlock and train dataset show_batch is this:

The valid dataset show_batch is this:

As you can see. The valid dataset contains all the transformations, including rotations, and this destroys the training/validation process.

Can someone tell me how to reset the valid dataset to it’s pristine form?

Set split_idx = 0 at the very beginning of your class (just before the init) and your transform will only be applied to the training set.

Thanks very much

I did as you suggested, but the results are the same: the valid dataset still is distorted by the custom transforms. I will appreciate your help in this matter.