Skip to content

Simplify use of arbitrary custom transforms in the AdapterΒ #362

@vpratz

Description

@vpratz

The removal of the LambdaTransform leaves a hole that needs to be filled, as arbitrary custom transforms are something that we require in our projects. Implementing custom transforms via subclassing is possible, but requires a lot more boilerplate, and is harder to get right. If one wants to combine it with the FilterTransform as was possible with .apply, the complexity increases even more.

I personally think what LambdaTransform and .apply offered was a very convenient wrapper, that let's users focus on the main part: Writing the forward and inverse transform. in the constructor of LambdaTransform, we could check if the provided functions are already registered and therefore serializable. If they are not, we can warn/error with instructions of how to achieve that (which is: put a decorator before the function). This could be accompanied by a more detailed tutorial-style notebook, that can also be linked in the warning. In my opinion, this should be sufficient to get the power users that want to use such transforms on the right track, and be able to alleviate the concerns regarding serialization.

Please let me know what you think.
@LarsKue @stefanradev93 @paul-buerkner @elseml

Metadata

Metadata

Assignees

Labels

discussionDiscuss a topic or question not necessarily with a clear output in mind.featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions