Class - TernaryTransformer#
- class openfl.pipelines.stc_pipeline.TernaryTransformer[source]#
Bases:
TransformerA transformer class to ternarize input data.
- lossy#
A flag indicating if the transformation is lossy.
- Type:
bool
Methods
__init__()Initialize.
backward(data, metadata, **kwargs)Recover data array back to the original numerical type.
forward(data, **kwargs)Ternerize data into positive mean value, negative mean value and zero value.
- backward(data, metadata, **kwargs)[source]#
Recover data array back to the original numerical type.
- Parameters:
data – an numpy array with non-zero values.
metadata – dictionary to contain information for recovering back to original data array.
- Returns:
- dictionary to contain information for recovering back
to original data array.
data: an numpy array with original numerical type.
- Return type:
metadata