-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Description
Certain transformations change the shape of a variable, which causes us to lose dimension information for the transformed variable. An example is SimplexTransform
, which removes the last value of the core dimension. This means that when we return inference data for transformed values, we have to fall back to assigning new, unknown dims/labels, even though we actually know what these should be.
My proposal is to add a method to each transformation that knows what to do with labels. Then if we want to return the unconstrained samples for whatever reason, we can consult the relevant transformations and give the user back label dimensions as expected. Many of the most common transformations will just end up being the identity function.
This would add an abstractmethod
to the Transform
base class, something like:
class Transform(abc.ABC):
...
@abc.abstractmethod
def transform_labels(self, labels: Sequence[str]) -> Sequence[str]:
"""Mutate user-provided coordinates associated with the variable to label transformed values returned by this class"""