Class - RandomShiftTransformer#

class openfl.pipelines.random_shift_pipeline.RandomShiftTransformer[source]#

Bases: Transformer

Random Shift Transformer class.

__init__()[source]#

Initialize RandomShiftTransformer.

Methods

__init__()

Initialize RandomShiftTransformer.

backward(data, metadata, **kwargs)

Backward pass - Decompress data.

forward(data, **kwargs)

Forward pass - compress data.

backward(data, metadata, **kwargs)[source]#

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)[source]#

Forward pass - compress data.

Implement the data transformation.

Parameters:

data – The data to be transformed.

Returns:

The data after the random shift. metadata: The metadata for the transformation.

Return type:

transformed_data