Transform

class hybrid_learning.datasets.transforms.common.Transform[source]

Bases: ABC

Base class for transformations.

Public Data Attributes:

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings to reproduce the instance.

Public Methods:

apply_to(*inps)

Application of transformation.

Special Methods:

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

__copy__()

Return a shallow copy of self using settings.

__add__(other)

Return a flat composition of self with other.

__radd__(other)

Return a flat composition of other and self.

__call__(*inps)

General call to the transformation.


__add__(other)[source]

Return a flat composition of self with other. In case other is a no-op transforms, return a copy of self.

Returns

one of the summands in case the other is a no-op, else a hybrid_learning.datasets.transforms.common.Compose transforms

Parameters

other (Optional[Union[Callable, Transform]]) –

Return type

Transform

__call__(*inps)[source]

General call to the transformation.

__copy__()[source]

Return a shallow copy of self using settings.

__eq__(other)[source]

Return self==value.

__radd__(other)[source]

Return a flat composition of other and self. See __add__().

Parameters

other (Optional[Union[Callable, Transform]]) –

Return type

Transform

__repr__()[source]

Return repr(self).

abstract apply_to(*inps)[source]

Application of transformation.

IDENTITY_CLASS: Optional[Union[type, List[type]]] = None

The identity class or classes for composition / addition. See general_add().

__hash__ = None
property settings: Dict[str, Any]

Settings to reproduce the instance.