openfl.pipelines.random_shift_pipeline.RandomShiftTransformer

class openfl.pipelines.random_shift_pipeline.RandomShiftTransformer

Bases: Transformer

Random Shift Transformer class.

Methods

backward

Backward pass - Decompress data.

forward

Forward pass - compress data.

backward(data, metadata, **kwargs)

Backward pass - Decompress data.

Implement the data transformation needed when going the oppposite direction to the forward method.

Parameters:
  • data – The transformed data.

  • metadata – The metadata for the transformation.

Returns:

The original data before the random shift.

forward(data, **kwargs)

Forward pass - compress data.

Implement the data transformation.

Parameters:

data – The data to be transformed.

Returns:
  • transformed_data – The data after the random shift.

  • metadata – The metadata for the transformation.