Skip to content

Transformer

Warning

Documentation for the module is under development.

Transformer – object that has a ____call__, receives a data batch and a thread number (for multiprocessing feasibility) and returns a data batch converted in the required way. Inside __call__ you can perform any data transformations, for example, permutating or applying noise to them.

Transformers are not used on their own, but inside Providers.

__call__

def __call__(self, batch, threadidx)

Transformers are not used on their own, but inside __call__ transformer method. When implementing transformers in your tasks, this method should perform all the augmentations or data transformations you need.

Parameters

Parameter Allowed types Description Default
batch np.ndarray, list и пр. Input data batch of an arbitrary type -
threadidx int Number of the thread that is set when the pool is running in multiprocessing -

Return value

Data batch of an arbitrary type.