qkeras.qtools.run_qtools

Interface for running qtools and qenergy.

Classes

QTools(model, process[, source_quantizers, ...])

integration of different qtools functions.

class qkeras.qtools.run_qtools.QTools(model, process, source_quantizers=None, is_inference=False, weights_path=None, keras_quantizer=None, keras_accumulator=None, for_reference=False, model_weights_already_quantized=True, hw_weight_dict=None)[source]

Bases: object

integration of different qtools functions.

calculate_ace(default_float_bits)[source]

Computes ACE numbers from conv/dense layers.

calculate_output_bytes(include_model_input_size, default_float_bits)[source]

Computes activation layers’ output size in bytes.

calculate_weight_bytes(default_float_bits)[source]

Computes weight size in bytes from conv/dense layers.

extract_energy_profile(cfg_setting, energy_dict)[source]

extract energy consumption in each layer.

extract_energy_sum(cfg_setting, energy_dict)[source]

extracted energy needed in caculating sum.

get_roofline_numbers(include_model_input_size=True, default_float_bits=32)[source]

Extracts model numbers for roofline model analysis.

pe(weights_on_memory='dram', activations_on_memory='dram', min_sram_size=0, rd_wr_on_io=True, verbose=False)[source]

energy consumption calculation.

qtools_stats_print()[source]

print out the layer stats.

qtools_stats_to_json(json_name)[source]

dump the layer stats to a json file.