Compose

class hybrid_learning.datasets.transforms.common.Compose(transforms)[source]

Bases: Transform

Compose several transforms by sequentially executing them.

Public Data Attributes:

settings

Settings to reproduce the instance.

Inherited from : py: class:Transform

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings to reproduce the instance.

Public Methods:

append(trafo)

Append transformation to the processing chain.

insert(i, trafo)

Insert trafo at index i into the processing chain.

apply_to(*inps)

Apply all transformations in order.

Inherited from : py: class:Transform

apply_to(*inps)

Apply all transformations in order.

Special Methods:

__init__(transforms)

__getitem__(i)

Get item from transforms member.

__len__()

Get length of transforms member.

Inherited from : py: class:Transform

__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.


Parameters

transforms (Sequence[Callable]) –

__getitem__(i)[source]

Get item from transforms member.

Parameters

i (int) –

__init__(transforms)[source]
Parameters

transforms (Sequence[Callable]) –

__len__()[source]

Get length of transforms member.

append(trafo)[source]

Append transformation to the processing chain.

Parameters

trafo (Callable) –

apply_to(*inps)[source]

Apply all transformations in order. Transformations are taken from transforms.

Return type

Tuple

insert(i, trafo)[source]

Insert trafo at index i into the processing chain.

Parameters
property settings

Settings to reproduce the instance.

transforms: List[Callable]

List of tuple transformations to apply in order.