Rethink implementation of transforms
Closed this issue · 1 comments
einbandi commented
I think it would be better to change the implementation of transforms in such a way that they only accept RelationData
input.
This would get rid of many checks. Originally, this way of implementing it should have helped users to define their own transforms more conveniently, but it feels too messy. To regain convenience, it would be nice to:
- provide
ToSquareArray
transforms and the like to convert between relation representations explicitly; - provide a
Functional
orLambda
transform that acts directly on the relation data (as opposed to theRelationData
object); - convert the representations internally, if necessary (potentially with user warnings, e.g. if this causes a loss of differentiability).
This issue relates to Issue #18 about the output types of some of the compute_relations
methods.
einbandi commented
It will no longer be necessary to define the SingleTransform
type in relations.py
, as the callable case will be covered by the Functional
/Lambda
transform.