ecal.calculators.preprocessing

Classes

DataPreprocessing([preprocessing_type, ...])

Data preprocessing class that calculates the FLOPs for various data preprocessing tasks

class ecal.calculators.preprocessing.DataPreprocessing(preprocessing_type='normalization', processor_flops_per_second=1000000000000.0, processor_max_power=100, time_steps=1)[source]

Bases: object

Data preprocessing class that calculates the FLOPs for various data preprocessing tasks

Parameters:
  • preprocessing_type (str)

  • processor_flops_per_second (float)

  • processor_max_power (int)

  • time_steps (int)

__init__(preprocessing_type='normalization', processor_flops_per_second=1000000000000.0, processor_max_power=100, time_steps=1)[source]

Initialize DataPreprocessing class

Parameters:
  • preprocessing_type (str) – Type of preprocessing to perform (“normalization”, “min_max_scaling”, or “GADF”).

  • processor_flops_per_second (float) – Processor throughput in FLOPS, used to convert FLOP counts into elapsed time for energy estimation.

  • processor_max_power (int) – Processor power draw in watts, used to convert elapsed time into energy.

  • time_steps (int) – Number of time steps per sample (only relevant for the “GADF” preprocessing type).

calculate_energy(data_bits, time_steps)[source]

Calculate the energy usage of the current preprocessing step

Parameters:
  • data_bits (int) – Number of scalar data points per sample

  • time_steps (int) – Number of time steps per sample (only used when preprocessing_type is “GADF”)

Returns:

Dictionary with “total_energy” (Joules) and “total_bits” (data_bits * time_steps, the total number of scalar values processed)

Return type:

Dict[str, float]

calculate_flops(data_bits, time_steps=1)[source]

Calculate FLOPs for the current preprocessing type

Parameters:
  • data_bits (int) – Number of bits in the input data

  • time_steps – Number of time steps in the input time series data

Returns:

Total FLOPs for the current preprocessing type

Return type:

float

set_preprocessing_type(preprocessing_type)[source]

Set the preprocessing type

Parameters:

preprocessing_type (str)

Return type:

None