I want to implement decrappify in v2. For that I need to implement a transform that only happens on y.
I created my datablock by doing: DataBlock(blocks=(ImageBlock, ImageBlock)....
In v1 I had to say tfm_y=True whenever I wanted to use the same transforms applied to X on Y. By following this notebook I don’t see that being set anymore, I’m guessing v2 automatically understand what to do from the blocks?
Anyways, in v1 there was a problem that once you defined tfm_y=Trueall of the transforms would be applied to y without any exception, but again, I need to apply a specific transform only on y, so in v1 I implemented the following hack:
I don’t understand it fully yet but here is my guess:
In the walkthough about transformers (4) Jeremy explains that you use the class Transfromer or the decorator Transformer. This in combination with a Type annotation in your function (or encoder/decoders function of your class). If you do this it will check if your input is the right type and if so it will apply the function on that part of the tuple.
Not sure if this all still makes sense. Please do look at walkthrough 4. It is really good and made me understood it (I think). The linked post is also quit a thorough explanation.