I’m really getting a hard time wrapping my head around the difference between Transform and ItemTransform and why we might want to want to use one or the other when creating our one custom transforms using the MidLevel API.
It says: To prevent a Transform from dispatching over a tuple, we just have to make it an ItemTransform.
Then checking the documentation, ItemTransform says: A transform that always take tuples as items
Don’t the two above statements contradict each other? Or what is dispatching in this case?
Also: My intuition is that ItemTransform is equivalent to item_tfms when using the DataBlock API. Is this true?
I’d appreciate if anyone can give me a simple explanation
EDIT: I Have been doing some research and I found this
It explains that ItemTransform is the class to use to opt out of the default behavior of the Transform
It sheds some light, I still don’t get the difference completely, but I will leave this here in case someone else with the same question finds it useful or if my future self needs this
To make it short, just use regular Transforms. ItemTransforms it is a overcomplicated thing that is useful when you want to transform the x and y at the same time, it is rarely used in fastai anyway.
The notebooks is not very clear, as they don’t re create the ItemTransform after updating the class.