Class - GZIPTransformer#

class openfl.pipelines.stc_pipeline.GZIPTransformer[source]#

Bases: Transformer

GZIP transformer class for losslessly compressing data.

lossy#

A flag indicating if the transformation is lossy.

Type:

bool

__init__()[source]#

Initialize.

Methods

__init__()

Initialize.

backward(data, metadata, **kwargs)

Decompress data into numpy of float32.

forward(data, **kwargs)

Compress data into numpy of float32.

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

Decompress data into numpy of float32.

Parameters:
  • data – an numpy array with non-zero values.

  • metadata – dictionary to contain information for recovering back to original data array.

Returns:

A numpy array with the original numerical type after

decompression.

Return type:

data

forward(data, **kwargs)[source]#

Compress data into numpy of float32.

Parameters:

data – an numpy array with non-zero values.

Returns:

The compressed data. metadata: dictionary to contain information for recovering back

to original data array

Return type:

compressed_bytes