SYMBOL INDEX (1181 symbols across 104 files) FILE: examples/example_act.py function main (line 43) | def main(): FILE: examples/example_mnist_bn.py class LearningRateAdjuster (line 52) | class LearningRateAdjuster(callbacks.Callback): method __init__ (line 53) | def __init__(self): method on_epoch_end (line 57) | def on_epoch_end(self, epochs, logs): FILE: examples/example_mnist_prune.py function build_model (line 51) | def build_model(input_shape): function build_layerwise_model (line 81) | def build_layerwise_model(input_shape, **pruning_params): function train_and_save (line 119) | def train_and_save(model, x_train, y_train, x_test, y_test): function main (line 163) | def main(): FILE: examples/example_qdense.py function QDenseModel (line 49) | def QDenseModel(weights_f, load_weights=False): function UseNetwork (line 77) | def UseNetwork(weights_f, load_weights=False): function ParserArgs (line 121) | def ParserArgs(): FILE: examples/example_qoctave.py function create_model (line 30) | def create_model(): function customLoss (line 157) | def customLoss(y_true,y_pred): FILE: examples/example_ternary.py function _stochastic_rounding (line 32) | def _stochastic_rounding(x, precision, resolution, delta): function _ternary (line 67) | def _ternary(x, sto=False): function main (line 87) | def main(argv): FILE: experimental/lo/compress.py class Compressor (line 23) | class Compressor: method __init__ (line 26) | def __init__(self, hash_only_input=False): method add_entry (line 30) | def add_entry(self, table_in, table_out=""): method has_entry (line 44) | def has_entry(self, table_in, table_out=""): method __call__ (line 65) | def __call__(self): FILE: experimental/lo/conv2d.py function parallel_index_table (line 37) | def parallel_index_table( function parallel_compress_output_table (line 134) | def parallel_compress_output_table( function optimize_conv2d_logic (line 181) | def optimize_conv2d_logic( FILE: experimental/lo/dense.py function parallel_index_table (line 37) | def parallel_index_table( function parallel_compress_output_table (line 112) | def parallel_compress_output_table( function optimize_dense_logic (line 156) | def optimize_dense_logic( FILE: experimental/lo/generate_rf_code.py function gen_random_tree_regressor (line 30) | def gen_random_tree_regressor( function entry_to_hex (line 194) | def entry_to_hex(entry, max_value, size, is_cc): function gen_random_tree_classifier (line 207) | def gen_random_tree_classifier( function gen_random_forest (line 434) | def gen_random_forest( function gen_testbench_sv (line 721) | def gen_testbench_sv(rf, name, bits, is_neg, o_bits, o_is_neg, x, y, p, ... function gen_testbench_cc (line 770) | def gen_testbench_cc(rf, name, bits, is_neg, o_bits, o_is_neg, x, y, p, ... FILE: experimental/lo/optimizer.py function file_compress (line 43) | def file_compress(fin, fout): function mp_rf_optimizer_func (line 62) | def mp_rf_optimizer_func(fn_tuple): function mp_abc_optimizer_func (line 194) | def mp_abc_optimizer_func(fn): function run_abc_optimizer (line 256) | def run_abc_optimizer(files): function run_rf_optimizer (line 270) | def run_rf_optimizer(files, flags, file_suffix="cc"): FILE: experimental/lo/random_forest/gen_random_tree.py function gen_random_tree_cc (line 26) | def gen_random_tree_cc(tree): FILE: experimental/lo/random_forest/parser.py class PLA (line 28) | class PLA: method __init__ (line 29) | def __init__(self): function t_NUMBER (line 62) | def t_NUMBER(t): function t_NEWLINE (line 66) | def t_NEWLINE(t): function t_error (line 71) | def t_error(t): function p_pla (line 77) | def p_pla(p): function p_pla_declarations (line 80) | def p_pla_declarations(p): function p_pla_declaration (line 84) | def p_pla_declaration(p): function p_pla_table (line 111) | def p_pla_table(p): function p_pla_end (line 129) | def p_pla_end(p): function p_opt_new_line (line 134) | def p_opt_new_line(p): function p_number_list (line 141) | def p_number_list(p): function p_symbol_list (line 151) | def p_symbol_list(p): function p_number_symbol_list (line 161) | def p_number_symbol_list(p): function p_number_or_symbol (line 171) | def p_number_or_symbol(p): function p_error (line 178) | def p_error(p): function get_tokens (line 183) | def get_tokens(fn): function parse (line 187) | def parse(fn): FILE: experimental/lo/random_forest/random_forest.py function fit_parallel (line 24) | def fit_parallel(max_depth, min_size, sample, mask_stuck_at_values): class RandomForest (line 32) | class RandomForest: method __init__ (line 33) | def __init__( method save (line 48) | def save(model, filename): method load (line 57) | def load(filename): method subsample (line 67) | def subsample(self, dataset): method fit (line 75) | def fit(self, dataset, verbose=False): method predict_row (line 105) | def predict_row(self, row): method predict (line 114) | def predict(self, data): method gen_code (line 122) | def gen_code(self, filename, func_name): FILE: experimental/lo/random_forest/random_tree.py class RandomTree (line 29) | class RandomTree: method __init__ (line 30) | def __init__(self, max_depth, min_size): method split_into_groups (line 35) | def split_into_groups(self, index, value, dataset): method gini_index (line 42) | def gini_index(self, groups, classes): method select_best_split (line 63) | def select_best_split(self, dataset): method select_terminal (line 86) | def select_terminal(self, group): method split_node (line 90) | def split_node(self, node, depth): method create_mask (line 124) | def create_mask(self, dataset): method fit (line 127) | def fit(self, dataset, mask_stuck_at_values=False): method predict_internal (line 141) | def predict_internal(self, node, data): method predict_row (line 154) | def predict_row(self, row): method predict (line 158) | def predict(self, data): method gen_code_internal (line 161) | def gen_code_internal(self, node, var_dict, n_offset): method gen_code (line 181) | def gen_code(self, n_offset=0): FILE: experimental/lo/random_forest/utils.py function str_column_to_float (line 30) | def str_column_to_float(dataset, column): function str_column_to_int (line 35) | def str_column_to_int(dataset, column): function str_column_to_number (line 40) | def str_column_to_number(dataset, column): function load_csv (line 72) | def load_csv(filename): function load_pla (line 93) | def load_pla(filename): function load (line 106) | def load(filename): FILE: experimental/lo/receptive.py function print_rf (line 25) | def print_rf(layer_name, x): function rf_computation_for_layer (line 33) | def rf_computation_for_layer(layer, layer_in): function model_to_receptive_field (line 55) | def model_to_receptive_field(model, i_name, o_name): FILE: experimental/lo/table/parser.py class PLA (line 28) | class PLA: method __init__ (line 29) | def __init__(self): function t_NUMBER (line 62) | def t_NUMBER(t): function t_NEWLINE (line 66) | def t_NEWLINE(t): function t_error (line 71) | def t_error(t): function p_pla (line 77) | def p_pla(p): function p_pla_declarations (line 80) | def p_pla_declarations(p): function p_pla_declaration (line 84) | def p_pla_declaration(p): function p_pla_table (line 111) | def p_pla_table(p): function p_pla_end (line 129) | def p_pla_end(p): function p_opt_new_line (line 134) | def p_opt_new_line(p): function p_number_list (line 141) | def p_number_list(p): function p_symbol_list (line 151) | def p_symbol_list(p): function p_number_symbol_list (line 161) | def p_number_symbol_list(p): function p_number_or_symbol (line 171) | def p_number_or_symbol(p): function p_error (line 178) | def p_error(p): function get_tokens (line 183) | def get_tokens(fn): function parse (line 187) | def parse(fn): FILE: experimental/lo/table/utils.py function str_column_to_float (line 31) | def str_column_to_float(dataset, column): function str_column_to_int (line 36) | def str_column_to_int(dataset, column, d_values): function str_column_to_number (line 42) | def str_column_to_number(dataset, column): function int2bin (line 74) | def int2bin(v, bits): function load_csv (line 79) | def load_csv(filename): function load_pla (line 94) | def load_pla(filename): function load (line 107) | def load(filename): FILE: experimental/lo/utils.py function get_padding_value (line 21) | def get_padding_value(padding, kernel): function get_quantized_bits_dict (line 35) | def get_quantized_bits_dict(bits, ibits, sign=False, mode="bin"): function get_quantized_po2_dict (line 70) | def get_quantized_po2_dict( function get_ternary_dict (line 183) | def get_ternary_dict(mode="bin"): function get_binary_dict (line 192) | def get_binary_dict(symmetric=False, mode="bin"): FILE: qkeras/autoqkeras/autoqkeras_internal.py class AutoQKHyperModel (line 80) | class AutoQKHyperModel(HyperModel): method __init__ (line 112) | def __init__( method _adjust_limit (line 177) | def _adjust_limit(self, default): method _n (line 195) | def _n(self, name, s_list): method _get_quantizer (line 199) | def _get_quantizer(self, hp, head, layer_name, layer_class_name, method quantize_model (line 327) | def quantize_model(self, hp): method build (line 563) | def build(self, hp): method adjusted_score (line 694) | def adjusted_score(hyper_model, delta, metric_function=None): method trial_size_metric (line 726) | def trial_size_metric(trial_size): class AutoQKeras (line 732) | class AutoQKeras: method __init__ (line 765) | def __init__( method _has_earlystopping (line 891) | def _has_earlystopping(self, callbacks): method history (line 901) | def history(self, number_of_trials=-1): method fit (line 947) | def fit(self, *fit_args, **fit_kwargs): method get_best_lr (line 970) | def get_best_lr(qmodel): method get_best_model (line 974) | def get_best_model(self): method get_learning_rate (line 983) | def get_learning_rate(self): class AutoQKerasScheduler (line 987) | class AutoQKerasScheduler: method __init__ (line 1019) | def __init__( method get_next_block (line 1115) | def get_next_block(self, overwrite): method get_limit (line 1129) | def get_limit(self, model, pattern): method fit (line 1160) | def fit(self, *fit_args, **fit_kwargs): method compute_block_costs (line 1263) | def compute_block_costs(self, patterns, model): method retrieve_max_block (line 1301) | def retrieve_max_block(self): method get_history (line 1305) | def get_history(self): method get_best_model (line 1309) | def get_best_model(self): method get_learning_rate (line 1321) | def get_learning_rate(self): FILE: qkeras/autoqkeras/examples/run/get_data.py function get_data (line 24) | def get_data(dataset_name, fast=False): FILE: qkeras/autoqkeras/examples/run/get_model.py function get_model (line 20) | def get_model(dataset): FILE: qkeras/autoqkeras/examples/run/networks/conv_block.py class ConvBlockNetwork (line 34) | class ConvBlockNetwork(object): method __init__ (line 37) | def __init__( method build (line 82) | def build(self): FILE: qkeras/autoqkeras/forgiving_metrics/forgiving_bits.py class ForgivingFactorBits (line 25) | class ForgivingFactorBits(ForgivingFactor): method __init__ (line 28) | def __init__( method _param_size (line 40) | def _param_size(self, layer): method _act_size (line 80) | def _act_size(self, layer): method compute_model_size (line 149) | def compute_model_size(self, model): method get_reference (line 177) | def get_reference(self, model): method get_reference_stats (line 187) | def get_reference_stats(self): method get_trial (line 190) | def get_trial(self, model): method get_total_factor (line 201) | def get_total_factor(self): method print_stats (line 207) | def print_stats(self): FILE: qkeras/autoqkeras/forgiving_metrics/forgiving_energy.py class ForgivingFactorPower (line 26) | class ForgivingFactorPower(ForgivingFactor): method __init__ (line 29) | def __init__(self, delta_p, delta_n, rate, stress=1.0, **kwargs): method get_reference (line 107) | def get_reference(self, model): method get_trial (line 136) | def get_trial(self, model): method get_total_factor (line 164) | def get_total_factor(self): method get_reference_stats (line 168) | def get_reference_stats(self): method get_trial_stats (line 171) | def get_trial_stats(self): method print_stats (line 174) | def print_stats(self, verbosity=0): FILE: qkeras/autoqkeras/forgiving_metrics/forgiving_factor.py class ForgivingFactor (line 22) | class ForgivingFactor: method __init__ (line 25) | def __init__(self, delta_p, delta_n, rate): method get_reference (line 30) | def get_reference(self, model): method get_trial (line 35) | def get_trial(self, model, schema): method delta (line 40) | def delta(self): FILE: qkeras/autoqkeras/tests/test_forgiving_factor.py function get_model (line 26) | def get_model(): function test_forgiving_factor_bits (line 48) | def test_forgiving_factor_bits(): function test_new_forgiving_factor (line 90) | def test_new_forgiving_factor(): FILE: qkeras/autoqkeras/utils.py function print_qmodel_summary (line 25) | def print_qmodel_summary(q_model): function get_quantization_dictionary (line 69) | def get_quantization_dictionary(q_model): function save_quantization_dict (line 80) | def save_quantization_dict(fn, q_model): FILE: qkeras/b2t.py function BinaryToThermometer (line 22) | def BinaryToThermometer( FILE: qkeras/base_quantizer.py function _create_variable_name (line 20) | def _create_variable_name(attr_name, var_name=None): class BaseQuantizer (line 40) | class BaseQuantizer(tf.Module): method __init__ (line 46) | def __init__(self): method build (line 49) | def build(self, var_name=None, use_variables=False): method _set_trainable_parameter (line 60) | def _set_trainable_parameter(self): method update_qnoise_factor (line 63) | def update_qnoise_factor(self, qnoise_factor): method variables (line 82) | def variables(self): method trainable_variables (line 87) | def trainable_variables(self): method non_trainable_variables (line 92) | def non_trainable_variables(self): FILE: qkeras/bn_folding_utils.py function convert_folded_layer_to_unfolded (line 35) | def convert_folded_layer_to_unfolded(layer): function unfold_model (line 80) | def unfold_model(model): function populate_bias_quantizer_from_accumulator (line 143) | def populate_bias_quantizer_from_accumulator(model, source_quantizers): FILE: qkeras/callbacks.py class QNoiseScheduler (line 26) | class QNoiseScheduler(tf.keras.callbacks.Callback): method __init__ (line 35) | def __init__(self, method calculate_qnoise_factor (line 84) | def calculate_qnoise_factor(self, freq): method set_qnoise_factor (line 104) | def set_qnoise_factor(self, quantizer, qnoise_factor): method set_quantizers (line 112) | def set_quantizers(self): method get_quantizers (line 132) | def get_quantizers(self, model): method update_qnoise_factor (line 154) | def update_qnoise_factor(self, freq): method on_train_begin (line 171) | def on_train_begin(self, logs=None): method on_epoch_begin (line 177) | def on_epoch_begin(self, epoch, logs=None): method on_epoch_end (line 181) | def on_epoch_end(self, epoch, logs=None): method on_train_batch_begin (line 186) | def on_train_batch_begin(self, batch, logs=None): FILE: qkeras/codebook.py function create_in_out_table (line 28) | def create_in_out_table(km, quantizer): function activation_compression (line 47) | def activation_compression(model, compile_config, activation_indexes, bits, function weight_compression (line 120) | def weight_compression(weights, bits, axis=0, quantizer=None): function two_tier_embedding_compression (line 159) | def two_tier_embedding_compression(embeddings, bits, quantizer=None): FILE: qkeras/estimate.py function analyze_accumulator (line 57) | def analyze_accumulator(in_model, x, verbose=False): function analyze_accumulator_from_sample (line 155) | def analyze_accumulator_from_sample( function get_quant_mode (line 226) | def get_quant_mode(quant): function get_operation_type (line 274) | def get_operation_type(layer, output_cache): function create_activation_cache (line 330) | def create_activation_cache(model): function extract_model_operations (line 373) | def extract_model_operations(in_model): function print_qstats (line 625) | def print_qstats(model): FILE: qkeras/experimental/quantizers/quantizers_po2.py function _update_ema_variable (line 48) | def _update_ema_variable(variable, new_val, ema_decay, is_initialized, function _get_scaling_axis (line 75) | def _get_scaling_axis(scale_axis, len_axis): function _get_msqe_scale (line 100) | def _get_msqe_scale(x, class BaseQuantizerPO2 (line 157) | class BaseQuantizerPO2(Layer): # pylint: disable=invalid-name method __init__ (line 190) | def __init__(self, method build (line 245) | def build(self, input_shape): method call (line 330) | def call(self, inputs, msqe_weight=None): method _quantize (line 355) | def _quantize(self, inputs, msqe_weight=None): method _update_second_moments_msqe_weight (line 392) | def _update_second_moments_msqe_weight(self, input_quantized, inputs): method _get_scale (line 427) | def _get_scale(self, inputs=None, reduce_axes=None, msqe_weight=None): method _get_init_scale_exponent (line 444) | def _get_init_scale_exponent(self, inputs): method _get_outlier_mask (line 457) | def _get_outlier_mask(self, inputs): method _get_msqe_weight (line 469) | def _get_msqe_weight(self, inputs=None): method _get_stable_scale (line 506) | def _get_stable_scale(self, scale): method _update_stable_scale_exponent (line 537) | def _update_stable_scale_exponent(self, scale, should_update, is_initi... method _initialize_scale_exponent (line 562) | def _initialize_scale_exponent(self, inputs): method _get_clipped_inputs_mask (line 579) | def _get_clipped_inputs_mask(self, inputs, scale): method _get_scale_axis (line 597) | def _get_scale_axis(self, input_shape): method _get_scaled_axes (line 612) | def _get_scaled_axes(self, scale_axis, input_shape): method _clip_quant (line 628) | def _clip_quant(self, inputs): method _round_quant (line 639) | def _round_quant(self, inputs): method _simple_quantize (line 650) | def _simple_quantize(self, inputs, scale, should_return_q=False): method _get_po2_scale (line 669) | def _get_po2_scale(self, scale): method _get_po2_scale_exponent (line 680) | def _get_po2_scale_exponent(self, scale): method _calculate_msqe (line 692) | def _calculate_msqe(self, x, xq, reduce_axes=None, msqe_weight=None): method _calculate_msqe_inputs (line 713) | def _calculate_msqe_inputs(self, method _least_squares_msqe_scale (line 735) | def _least_squares_msqe_scale(self, method _line_search_msqe_scale (line 785) | def _line_search_msqe_scale(self, method _optimize_msqe_scale (line 832) | def _optimize_msqe_scale(self, method max (line 889) | def max(self): method min (line 896) | def min(self): class quantized_bits_learnable_po2 (line 907) | class quantized_bits_learnable_po2(BaseQuantizerPO2): # pylint: disable... method __init__ (line 948) | def __init__(self, method __str__ (line 990) | def __str__(self): method build (line 1021) | def build(self, input_shape): method _get_init_scale_exponent (line 1029) | def _get_init_scale_exponent(self, inputs): method _get_outlier_mask (line 1049) | def _get_outlier_mask(self, inputs): method _get_scale (line 1070) | def _get_scale(self, inputs=None, reduce_axes=None, msqe_weight=None): method msqe_round (line 1108) | def msqe_round(self, method get_config (line 1153) | def get_config(self): class quantized_bits_msqe_po2 (line 1177) | class quantized_bits_msqe_po2(BaseQuantizerPO2): # pylint: disable=inva... method __init__ (line 1211) | def __init__(self, method __str__ (line 1249) | def __str__(self): method _get_init_scale_exponent (line 1280) | def _get_init_scale_exponent(self, inputs): method _get_outlier_mask (line 1294) | def _get_outlier_mask(self, inputs): method _get_scale (line 1312) | def _get_scale(self, inputs=None, reduce_axes=None, msqe_weight=None): method get_config (line 1347) | def get_config(self): FILE: qkeras/qconv2d_batchnorm.py class QConv2DBatchnorm (line 37) | class QConv2DBatchnorm(QConv2D): method __init__ (line 40) | def __init__( method build (line 150) | def build(self, input_shape): method call (line 160) | def call(self, inputs, training=None): method get_config (line 303) | def get_config(self): method get_quantization_config (line 318) | def get_quantization_config(self): method get_quantizers (line 326) | def get_quantizers(self): method get_folded_weights (line 329) | def get_folded_weights(self): FILE: qkeras/qconvolutional.py function deconv_output_length (line 47) | def deconv_output_length( class QConv1D (line 100) | class QConv1D(Conv1D, PrunableLayer): method __init__ (line 118) | def __init__(self, method call (line 193) | def call(self, inputs): method get_config (line 220) | def get_config(self): method get_quantization_config (line 234) | def get_quantization_config(self): method get_quantizers (line 245) | def get_quantizers(self): method get_prunable_weights (line 248) | def get_prunable_weights(self): class QConv2D (line 252) | class QConv2D(Conv2D, PrunableLayer): method __init__ (line 271) | def __init__( method convolution_op (line 366) | def convolution_op(self, inputs, kernel): method _jit_compiled_convolution_op (line 377) | def _jit_compiled_convolution_op(self, inputs, kernel): method call (line 380) | def call(self, inputs): method get_config (line 419) | def get_config(self): method from_config (line 435) | def from_config(cls, config): method get_quantization_config (line 442) | def get_quantization_config(self): method get_quantizers (line 453) | def get_quantizers(self): method get_prunable_weights (line 456) | def get_prunable_weights(self): class QConv2DTranspose (line 460) | class QConv2DTranspose(Conv2DTranspose, PrunableLayer): method __init__ (line 474) | def __init__(self, method call (line 543) | def call(self, inputs): method get_config (line 613) | def get_config(self): method get_quantizers (line 625) | def get_quantizers(self): method get_prunable_weights (line 628) | def get_prunable_weights(self): class QSeparableConv1D (line 632) | class QSeparableConv1D(SeparableConv1D, PrunableLayer): method __init__ (line 647) | def __init__(self, method call (line 734) | def call(self, inputs): method get_config (line 789) | def get_config(self): method get_quantizers (line 804) | def get_quantizers(self): method get_prunable_weights (line 807) | def get_prunable_weights(self): class QSeparableConv2D (line 811) | class QSeparableConv2D(SeparableConv2D, PrunableLayer): method __init__ (line 826) | def __init__(self, method call (line 913) | def call(self, inputs): method get_config (line 951) | def get_config(self): method get_quantizers (line 966) | def get_quantizers(self): method get_prunable_weights (line 969) | def get_prunable_weights(self): class QDepthwiseConv2D (line 973) | class QDepthwiseConv2D(DepthwiseConv2D, PrunableLayer): method __init__ (line 991) | def __init__(self, method build (line 1068) | def build(self, input_shape): method call (line 1105) | def call(self, inputs, training=None): method get_config (line 1132) | def get_config(self): method get_quantization_config (line 1158) | def get_quantization_config(self): method get_quantizers (line 1169) | def get_quantizers(self): method get_prunable_weights (line 1172) | def get_prunable_weights(self): function QMobileNetSeparableConv2D (line 1176) | def QMobileNetSeparableConv2D( FILE: qkeras/qdepthwise_conv2d_transpose.py class QDepthwiseConv2DTranspose (line 31) | class QDepthwiseConv2DTranspose(Conv2DTranspose): method __init__ (line 44) | def __init__( method _get_input_axis (line 97) | def _get_input_axis(self): method _get_input_dims (line 105) | def _get_input_dims(self, input_shape): method _get_output_size (line 115) | def _get_output_size( method build (line 157) | def build(self, input_shape): method compute_final_output_shape (line 198) | def compute_final_output_shape(self, input_shape, kernel_size, strides): method conv_transpose_op (line 234) | def conv_transpose_op( method call (line 330) | def call(self, inputs): method get_config (line 351) | def get_config(self): method get_quantizers (line 374) | def get_quantizers(self): method get_prunable_weights (line 381) | def get_prunable_weights(self): FILE: qkeras/qdepthwiseconv2d_batchnorm.py class QDepthwiseConv2DBatchnorm (line 31) | class QDepthwiseConv2DBatchnorm(QDepthwiseConv2D): method __init__ (line 34) | def __init__( method build (line 151) | def build(self, input_shape): method call (line 161) | def call(self, inputs, training=None): method get_config (line 308) | def get_config(self): method get_quantization_config (line 323) | def get_quantization_config(self): method get_quantizers (line 331) | def get_quantizers(self): method get_folded_weights (line 334) | def get_folded_weights(self): FILE: qkeras/qlayers.py function get_auto_range_constraint_initializer (line 61) | def get_auto_range_constraint_initializer(quantizer, constraint, initial... class QInitializer (line 89) | class QInitializer(Initializer): method __init__ (line 92) | def __init__(self, initializer, use_scale, quantizer): method __call__ (line 102) | def __call__(self, shape, dtype=None): method get_config (line 129) | def get_config(self): method from_config (line 137) | def from_config(cls, config): class QActivation (line 150) | class QActivation(Layer, PrunableLayer): method __init__ (line 156) | def __init__(self, activation, **kwargs): method call (line 179) | def call(self, inputs): method get_config (line 182) | def get_config(self): method from_config (line 188) | def from_config(cls, config): method get_quantization_config (line 203) | def get_quantization_config(self): method compute_output_shape (line 206) | def compute_output_shape(self, input_shape): method get_prunable_weights (line 209) | def get_prunable_weights(self): class QAdaptiveActivation (line 213) | class QAdaptiveActivation(Layer, PrunableLayer): method __init__ (line 221) | def __init__(self, method build (line 345) | def build(self, input_shape): method call (line 391) | def call(self, inputs, training=False): method get_weights (line 473) | def get_weights(self): method set_weights (line 477) | def set_weights(self, weights): method get_config (line 480) | def get_config(self): method get_quantization_config (line 496) | def get_quantization_config(self): method compute_output_shape (line 500) | def compute_output_shape(self, input_shape): method get_prunable_weights (line 503) | def get_prunable_weights(self): class Clip (line 512) | class Clip(Constraint): method __init__ (line 523) | def __init__(self, min_value=0.0, max_value=1.0, method __call__ (line 535) | def __call__(self, w): method get_config (line 544) | def get_config(self): method from_config (line 549) | def from_config(cls, config): class QDense (line 563) | class QDense(Dense, PrunableLayer): method __init__ (line 580) | def __init__(self, method call (line 647) | def call(self, inputs): method compute_output_shape (line 664) | def compute_output_shape(self, input_shape): method get_config (line 671) | def get_config(self): method get_quantization_config (line 711) | def get_quantization_config(self): method get_quantizers (line 722) | def get_quantizers(self): method get_prunable_weights (line 725) | def get_prunable_weights(self): function get_constraint (line 729) | def get_constraint(identifier, quantizer): function get_initializer (line 748) | def get_initializer(identifier): FILE: qkeras/qmac.py class QScaleShift (line 31) | class QScaleShift(tf.keras.layers.Layer, PrunableLayer): method __init__ (line 49) | def __init__(self, method build (line 93) | def build(self, input_shape): method call (line 108) | def call(self, inputs): method get_config (line 125) | def get_config(self): method get_quantization_config (line 154) | def get_quantization_config(self): method get_quantizers (line 164) | def get_quantizers(self): method get_prunable_weights (line 167) | def get_prunable_weights(self): FILE: qkeras/qnormalization.py class QBatchNormalization (line 45) | class QBatchNormalization(BatchNormalization, PrunableLayer): method __init__ (line 54) | def __init__( method call (line 178) | def call(self, inputs, training=None): method get_config (line 304) | def get_config(self): method compute_output_shape (line 356) | def compute_output_shape(self, input_shape): method get_quantizers (line 359) | def get_quantizers(self): method get_prunable_weights (line 362) | def get_prunable_weights(self): FILE: qkeras/qoctave.py function GetActivationSuffix (line 36) | def GetActivationSuffix(activation): function QOctaveConv2D (line 57) | def QOctaveConv2D( function OctaveConv2D (line 369) | def OctaveConv2D( FILE: qkeras/qpooling.py class QAveragePooling2D (line 28) | class QAveragePooling2D(AveragePooling2D): method __init__ (line 31) | def __init__(self, pool_size=(2, 2), method call (line 56) | def call(self, inputs): method get_config (line 108) | def get_config(self): method get_quantization_config (line 120) | def get_quantization_config(self): method get_quantizers (line 128) | def get_quantizers(self): class QGlobalAveragePooling2D (line 132) | class QGlobalAveragePooling2D(GlobalAveragePooling2D): method __init__ (line 135) | def __init__(self, data_format=None, method compute_pooling_area (line 151) | def compute_pooling_area(self, input_shape): method call (line 159) | def call(self, inputs): method get_config (line 205) | def get_config(self): method get_quantization_config (line 217) | def get_quantization_config(self): method get_quantizers (line 225) | def get_quantizers(self): FILE: qkeras/qrecurrent.py class QSimpleRNNCell (line 46) | class QSimpleRNNCell(SimpleRNNCell): method __init__ (line 63) | def __init__(self, method call (line 142) | def call(self, inputs, states, training=None): method get_config (line 186) | def get_config(self): class QSimpleRNN (line 205) | class QSimpleRNN(RNN, PrunableLayer): method __init__ (line 225) | def __init__(self, method call (line 293) | def call(self, inputs, mask=None, training=None, initial_state=None): method get_quantizers (line 298) | def get_quantizers(self): method get_prunable_weights (line 301) | def get_prunable_weights(self): method units (line 305) | def units(self): method activation (line 309) | def activation(self): method use_bias (line 313) | def use_bias(self): method kernel_initializer (line 317) | def kernel_initializer(self): method recurrent_initializer (line 321) | def recurrent_initializer(self): method bias_initializer (line 325) | def bias_initializer(self): method kernel_regularizer (line 329) | def kernel_regularizer(self): method recurrent_regularizer (line 333) | def recurrent_regularizer(self): method bias_regularizer (line 337) | def bias_regularizer(self): method kernel_constraint (line 341) | def kernel_constraint(self): method recurrent_constraint (line 345) | def recurrent_constraint(self): method bias_constraint (line 349) | def bias_constraint(self): method kernel_quantizer_internal (line 353) | def kernel_quantizer_internal(self): method recurrent_quantizer_internal (line 357) | def recurrent_quantizer_internal(self): method bias_quantizer_internal (line 361) | def bias_quantizer_internal(self): method state_quantizer_internal (line 365) | def state_quantizer_internal(self): method kernel_quantizer (line 369) | def kernel_quantizer(self): method recurrent_quantizer (line 373) | def recurrent_quantizer(self): method bias_quantizer (line 377) | def bias_quantizer(self): method state_quantizer (line 381) | def state_quantizer(self): method dropout (line 385) | def dropout(self): method recurrent_dropout (line 389) | def recurrent_dropout(self): method get_config (line 392) | def get_config(self): method get_quantization_config (line 448) | def get_quantization_config(self): method from_config (line 463) | def from_config(cls, config): class QLSTMCell (line 469) | class QLSTMCell(LSTMCell): method __init__ (line 488) | def __init__(self, method _compute_carry_and_output (line 577) | def _compute_carry_and_output(self, x, h_tm1, c_tm1, quantized_recurre... method _compute_carry_and_output_fused (line 591) | def _compute_carry_and_output_fused(self, z, c_tm1): method call (line 600) | def call(self, inputs, states, training=None): method get_config (line 680) | def get_config(self): class QLSTM (line 699) | class QLSTM(RNN, PrunableLayer): method __init__ (line 718) | def __init__(self, method call (line 796) | def call(self, inputs, mask=None, training=None, initial_state=None): method get_quantizers (line 801) | def get_quantizers(self): method get_prunable_weights (line 804) | def get_prunable_weights(self): method units (line 808) | def units(self): method activation (line 812) | def activation(self): method recurrent_activation (line 816) | def recurrent_activation(self): method use_bias (line 820) | def use_bias(self): method kernel_initializer (line 824) | def kernel_initializer(self): method recurrent_initializer (line 828) | def recurrent_initializer(self): method bias_initializer (line 832) | def bias_initializer(self): method unit_forget_bias (line 836) | def unit_forget_bias(self): method kernel_regularizer (line 840) | def kernel_regularizer(self): method recurrent_regularizer (line 844) | def recurrent_regularizer(self): method bias_regularizer (line 848) | def bias_regularizer(self): method kernel_constraint (line 852) | def kernel_constraint(self): method recurrent_constraint (line 856) | def recurrent_constraint(self): method bias_constraint (line 860) | def bias_constraint(self): method kernel_quantizer_internal (line 864) | def kernel_quantizer_internal(self): method recurrent_quantizer_internal (line 868) | def recurrent_quantizer_internal(self): method bias_quantizer_internal (line 872) | def bias_quantizer_internal(self): method state_quantizer_internal (line 876) | def state_quantizer_internal(self): method kernel_quantizer (line 880) | def kernel_quantizer(self): method recurrent_quantizer (line 884) | def recurrent_quantizer(self): method bias_quantizer (line 888) | def bias_quantizer(self): method state_quantizer (line 892) | def state_quantizer(self): method dropout (line 896) | def dropout(self): method recurrent_dropout (line 900) | def recurrent_dropout(self): method implementation (line 904) | def implementation(self): method get_config (line 907) | def get_config(self): method get_quantization_config (line 968) | def get_quantization_config(self): method from_config (line 985) | def from_config(cls, config): class QGRUCell (line 991) | class QGRUCell(GRUCell): method __init__ (line 1010) | def __init__(self, method call (line 1100) | def call(self, inputs, states, training=None): method get_config (line 1221) | def get_config(self): class QGRU (line 1240) | class QGRU(RNN, PrunableLayer): method __init__ (line 1260) | def __init__(self, method call (line 1338) | def call(self, inputs, mask=None, training=None, initial_state=None): method get_quantizers (line 1343) | def get_quantizers(self): method get_prunable_weights (line 1346) | def get_prunable_weights(self): method units (line 1350) | def units(self): method activation (line 1354) | def activation(self): method recurrent_activation (line 1358) | def recurrent_activation(self): method use_bias (line 1362) | def use_bias(self): method kernel_initializer (line 1366) | def kernel_initializer(self): method recurrent_initializer (line 1370) | def recurrent_initializer(self): method bias_initializer (line 1374) | def bias_initializer(self): method kernel_regularizer (line 1378) | def kernel_regularizer(self): method recurrent_regularizer (line 1382) | def recurrent_regularizer(self): method bias_regularizer (line 1386) | def bias_regularizer(self): method kernel_constraint (line 1390) | def kernel_constraint(self): method recurrent_constraint (line 1394) | def recurrent_constraint(self): method bias_constraint (line 1398) | def bias_constraint(self): method kernel_quantizer_internal (line 1402) | def kernel_quantizer_internal(self): method recurrent_quantizer_internal (line 1406) | def recurrent_quantizer_internal(self): method bias_quantizer_internal (line 1410) | def bias_quantizer_internal(self): method state_quantizer_internal (line 1414) | def state_quantizer_internal(self): method kernel_quantizer (line 1418) | def kernel_quantizer(self): method recurrent_quantizer (line 1422) | def recurrent_quantizer(self): method bias_quantizer (line 1426) | def bias_quantizer(self): method state_quantizer (line 1430) | def state_quantizer(self): method dropout (line 1434) | def dropout(self): method recurrent_dropout (line 1438) | def recurrent_dropout(self): method implementation (line 1442) | def implementation(self): method reset_after (line 1446) | def reset_after(self): method get_config (line 1449) | def get_config(self): method get_quantization_config (line 1510) | def get_quantization_config(self): method from_config (line 1527) | def from_config(cls, config): class QBidirectional (line 1533) | class QBidirectional(Bidirectional): method get_quantizers (line 1544) | def get_quantizers(self): method activation (line 1551) | def activation(self): method get_quantization_config (line 1554) | def get_quantization_config(self): FILE: qkeras/qseparable_conv2d_transpose.py class QSeparableConv2DTranspose (line 30) | class QSeparableConv2DTranspose(Conv2DTranspose): method __init__ (line 45) | def __init__(self, method _get_input_axis (line 100) | def _get_input_axis(self): method _get_input_dims (line 108) | def _get_input_dims(self, input_shape): method _get_output_size (line 115) | def _get_output_size(self, inputs, output_padding, padding, strides, method build (line 150) | def build(self, input_shape): method compute_final_output_shape (line 204) | def compute_final_output_shape( method conv_transpose_op (line 245) | def conv_transpose_op(self, inputs, filters, strides, padding, method call (line 324) | def call(self, inputs): method get_config (line 367) | def get_config(self): method get_quantizers (line 390) | def get_quantizers(self): method get_prunable_weights (line 399) | def get_prunable_weights(self): FILE: qkeras/qtools/DnC/divide_and_conquer.py class CostMode (line 43) | class CostMode(enum.Enum): class DivideConquerGraph (line 50) | class DivideConquerGraph: method __init__ (line 53) | def __init__( method idx_to_layer (line 77) | def idx_to_layer(self, idx: int): method layer_to_idx (line 81) | def layer_to_idx(self, layer: tf.keras.layers.Layer): method get_first_node (line 85) | def get_first_node(self): method is_first_node (line 89) | def is_first_node(self, node: Union[int, tf.keras.layers.Layer]): method get_last_node (line 95) | def get_last_node(self): method is_last_node (line 99) | def is_last_node(self, node: Union[int, tf.keras.layers.Layer]): method get_prev_nodes (line 105) | def get_prev_nodes(self, node: Union[int, tf.keras.layers.Layer]): method get_next_nodes (line 111) | def get_next_nodes(self, node: Union[int, tf.keras.layers.Layer]): method get_layer_quantizer_bitwidth (line 117) | def get_layer_quantizer_bitwidth( method get_layer_mac_count (line 158) | def get_layer_mac_count(self, node: Union[int, tf.keras.layers.Layer]): method get_layer_shapes (line 166) | def get_layer_shapes(self, node: Union[int, tf.keras.layers.Layer]): class Choice (line 184) | class Choice: method __init__ (line 187) | def __init__(self, l: float = 0, k: float = 0, cin_unroll: int = 0, method __str__ (line 207) | def __str__(self): function get_valid_unrolls (line 213) | def get_valid_unrolls(layer: tf.keras.layers.Layer, cout_unroll: int, function get_per_layer_cost (line 255) | def get_per_layer_cost(layer_quantizer_bitwidth, layer_mac_count, layer_... function get_valid_candidates (line 288) | def get_valid_candidates(input_value, output_to_input_ratio_max): function get_InBufferThru (line 299) | def get_InBufferThru(InElementPerClk, input_channel): function get_OutBufferThru (line 303) | def get_OutBufferThru(OutElementPerClk, output_channel, kernel_height, function is_bufferThru_greater_than_targetThru (line 312) | def is_bufferThru_greater_than_targetThru( function set_best_global_cost_in_paths (line 336) | def set_best_global_cost_in_paths( function backtrack (line 384) | def backtrack(graph, paths): function update_cur_best_choices (line 429) | def update_cur_best_choices( function get_ComputeInElementPerClk (line 459) | def get_ComputeInElementPerClk(layer_type, cin_unroll, function get_InElementPerClk_base (line 472) | def get_InElementPerClk_base(ComputInElementPerClk, kh_unroll, kw_unroll): function get_pe_throughput (line 476) | def get_pe_throughput(layer_type, cin_unroll, cout_unroll, kh_unroll, kw... function get_target_throughputs (line 494) | def get_target_throughputs(layer, target_out_throughput): function calc_hw_params (line 519) | def calc_hw_params(graph, target_OutElementPerClk, target_out_throughput, function estimate_model_cost (line 731) | def estimate_model_cost( FILE: qkeras/qtools/DnC/dnc_layer_cost_ace.py function mac_gates_polynomial_3d (line 80) | def mac_gates_polynomial_3d(xyz, a, b, c): function gen_mac_gate_model (line 100) | def gen_mac_gate_model(do_plot=False): function get_ace_mac_gates (line 213) | def get_ace_mac_gates(xbit, wbit, abit, regen_params=False): FILE: qkeras/qtools/examples/example_generate_json.py function hybrid_model (line 30) | def hybrid_model(): function generate_json (line 49) | def generate_json(in_model): FILE: qkeras/qtools/examples/example_get_energy.py function hybrid_model (line 31) | def hybrid_model(): FILE: qkeras/qtools/generate_layer_data_type_map.py class TagMissingError (line 31) | class TagMissingError(ValueError): function get_bn_quantizers (line 73) | def get_bn_quantizers(layer, quantizer_factory, cfg, keras_quantizer, function update_output_quantizer_in_graph (line 168) | def update_output_quantizer_in_graph(graph, node_id, quantizer_factory, function generate_layer_data_type_map (line 190) | def generate_layer_data_type_map( FILE: qkeras/qtools/interface.py function print_qstats (line 27) | def print_qstats(graph): function populate_quantizer (line 62) | def populate_quantizer(quantizer, shape=None, implemented_as=None): function map_to_json (line 117) | def map_to_json(mydict): FILE: qkeras/qtools/qenergy/qenergy.py function get_op_type (line 65) | def get_op_type(quantizer): function memory_read_energy (line 74) | def memory_read_energy(is_input_layer, tensor_shape, mode, min_sram_size, function parameter_read_energy (line 118) | def parameter_read_energy( function memory_write_energy (line 162) | def memory_write_energy(is_output_layer, tensor_shape, mode, min_sram_size, function energy_estimate (line 205) | def energy_estimate(model, layer_map, weights_on_memory, FILE: qkeras/qtools/qgraph.py class WrongInputQuantizerError (line 35) | class WrongInputQuantizerError(ValueError): function GraphRemoveNode (line 39) | def GraphRemoveNode(graph, v): function GraphRemoveNodeWithNodeType (line 58) | def GraphRemoveNodeWithNodeType(graph, node_type): function GraphAddHiddenInputLayer (line 69) | def GraphAddHiddenInputLayer(model, graph, input_quantizer_map): function GraphAddSingleSourceSingleSink (line 116) | def GraphAddSingleSourceSingleSink(graph): function GenerateInputQuantizerList (line 147) | def GenerateInputQuantizerList(input_quantizers, function AddToNodeDict (line 181) | def AddToNodeDict(layer_items, function GenerateGraphFromModel (line 199) | def GenerateGraphFromModel(model, function GraphGetInputs (line 289) | def GraphGetInputs(graph): function GraphGetOutputs (line 307) | def GraphGetOutputs(graph): function GraphPropagateActivationsToEdges (line 325) | def GraphPropagateActivationsToEdges(graph, debug=False): function PrintGraph (line 395) | def PrintGraph(graph, msg=""): function CreateGraph (line 411) | def CreateGraph(model, input_quantizers=None, function GraphUpdateEdge (line 437) | def GraphUpdateEdge(graph, node_id, quantizer_on_edge): FILE: qkeras/qtools/qtools_util.py function get_val (line 30) | def get_val(feature, key, default_val=None): function is_shape_alternation_layers (line 39) | def is_shape_alternation_layers(layer): function is_merge_layers (line 46) | def is_merge_layers(layer): function get_input_quantizers (line 56) | def get_input_quantizers(graph, node_id, quantizer_factory, debug=False): function get_input_quantizers_advanced (line 78) | def get_input_quantizers_advanced(graph, node_id, function get_operation_count (line 115) | def get_operation_count(layer, input_shape): function get_weights (line 227) | def get_weights(layer, model_weights_already_quantized=True): function get_scale_from_quantized_bits_with_auto_po2 (line 251) | def get_scale_from_quantized_bits_with_auto_po2(quantizer): function adjust_multiplier_for_auto_po2 (line 261) | def adjust_multiplier_for_auto_po2(multiplier, qkeras_weight_quantizer): function adjust_accumulator_for_auto_po2 (line 318) | def adjust_accumulator_for_auto_po2( function find_divisors (line 354) | def find_divisors(num): function get_layer_info (line 358) | def get_layer_info(layer: tf.keras.layers.Layer, attr_name: str): function is_upsampled (line 388) | def is_upsampled(layer: tf.keras.layers.Layer): FILE: qkeras/qtools/quantized_operators/accumulator_factory.py class AccumulatorFactory (line 28) | class AccumulatorFactory: method make_accumulator (line 31) | def make_accumulator( FILE: qkeras/qtools/quantized_operators/accumulator_impl.py function po2_to_qbits (line 30) | def po2_to_qbits(quantizer: quantizer_impl.IQuantizer): class IAccumulator (line 44) | class IAccumulator(abc.ABC): method implemented_as (line 49) | def implemented_as(): class FloatingPointAccumulator (line 53) | class FloatingPointAccumulator(IAccumulator): method __init__ (line 56) | def __init__( method implemented_as (line 72) | def implemented_as(): class FixedPointAccumulator (line 76) | class FixedPointAccumulator(IAccumulator): method __init__ (line 79) | def __init__( method implemented_as (line 116) | def implemented_as(): class Po2Accumulator (line 120) | class Po2Accumulator(FixedPointAccumulator): method __init__ (line 126) | def __init__( method implemented_as (line 144) | def implemented_as(): FILE: qkeras/qtools/quantized_operators/adder_factory.py class IAdder (line 30) | class IAdder(abc.ABC): method __init__ (line 33) | def __init__(self): method make_quantizer (line 85) | def make_quantizer(self, quantizer_1: quantizer_impl.IQuantizer, FILE: qkeras/qtools/quantized_operators/adder_impl.py function po2_qbits_converter (line 28) | def po2_qbits_converter(po2_quantizer: quantizer_impl.IQuantizer): class IAdderImpl (line 41) | class IAdderImpl(abc.ABC): method implemented_as (line 46) | def implemented_as(): class FixedPointAdder (line 50) | class FixedPointAdder(IAdderImpl): method __init__ (line 53) | def __init__(self, quantizer_1, quantizer_2): method implemented_as (line 70) | def implemented_as(): class FloatingPointAdder (line 74) | class FloatingPointAdder(IAdderImpl): method __init__ (line 77) | def __init__(self, quantizer_1, quantizer_2): method implemented_as (line 83) | def implemented_as(): class Po2FixedPointAdder (line 87) | class Po2FixedPointAdder(IAdderImpl): method __init__ (line 90) | def __init__(self, quantizer_1, quantizer_2): method implemented_as (line 107) | def implemented_as(): class Po2Adder (line 111) | class Po2Adder(IAdderImpl): method __init__ (line 114) | def __init__(self, quantizer_1, quantizer_2): method implemented_as (line 121) | def implemented_as(): FILE: qkeras/qtools/quantized_operators/divider_factory.py class UnacceptedQuantizerError (line 30) | class UnacceptedQuantizerError(ValueError): class IDivider (line 34) | class IDivider(abc.ABC): method __init__ (line 37) | def __init__(self): method make_quantizer (line 106) | def make_quantizer(self, numerator_quantizer: quantizer_impl.IQuantizer, FILE: qkeras/qtools/quantized_operators/divider_impl.py class IDividerImpl (line 26) | class IDividerImpl(abc.ABC): method __init__ (line 29) | def __init__(self, numerator_quantizer, denominator_quantizer, method implemented_as (line 37) | def implemented_as(): class FloatingPointDivider (line 41) | class FloatingPointDivider(IDividerImpl): method __init__ (line 44) | def __init__(self, numerator_quantizer, denominator_quantizer, method implemented_as (line 63) | def implemented_as(): class Shifter (line 68) | class Shifter(IDividerImpl): method __init__ (line 72) | def __init__(self, numerator_quantizer, denominator_quantizer, method implemented_as (line 117) | def implemented_as(): class Subtractor (line 121) | class Subtractor(IDividerImpl): method __init__ (line 127) | def __init__(self, numerator_quantizer, denominator_quantizer, method implemented_as (line 159) | def implemented_as(): FILE: qkeras/qtools/quantized_operators/fused_bn_factory.py class FusedBNFactory (line 34) | class FusedBNFactory: method make_quantizer (line 50) | def make_quantizer( FILE: qkeras/qtools/quantized_operators/merge_factory.py class MergeFactory (line 29) | class MergeFactory: method make_quantizer (line 32) | def make_quantizer(self, input_qe_list, layer_type): class IMerger (line 51) | class IMerger(abc.ABC): method __init__ (line 54) | def __init__(self, input_qe_list): class Add (line 63) | class Add(IMerger): method __init__ (line 69) | def __init__(self, input_qe_list): method implemented_as (line 112) | def implemented_as(self): class Multiply (line 116) | class Multiply(IMerger): method __init__ (line 122) | def __init__(self, input_qe_list): method implemented_as (line 138) | def implemented_as(self): class Maximum (line 142) | class Maximum(IMerger): method __init__ (line 148) | def __init__(self, input_qe_list): method implemented_as (line 204) | def implemented_as(): class Minimum (line 208) | class Minimum(Maximum): class Average (line 216) | class Average(Maximum): method __init__ (line 221) | def __init__(self, input_qe_list): class Concatenate (line 228) | class Concatenate(Maximum): method __init__ (line 234) | def __init__(self, input_qe_list): class Dot (line 242) | class Dot(IMerger): FILE: qkeras/qtools/quantized_operators/multiplier_factory.py class MultiplierFactory (line 28) | class MultiplierFactory: method __init__ (line 31) | def __init__(self): method make_multiplier (line 118) | def make_multiplier( FILE: qkeras/qtools/quantized_operators/multiplier_impl.py class IMultiplier (line 27) | class IMultiplier(abc.ABC): method __init__ (line 34) | def __init__(self, weight_quantizer: quantizer_impl.IQuantizer, method implemented_as (line 44) | def implemented_as(): method name (line 47) | def name(self) -> str: method output_quantizer (line 50) | def output_quantizer(self): function assert_neither_input_and_weights_is_floating_point (line 54) | def assert_neither_input_and_weights_is_floating_point( class Mux (line 62) | class Mux(IMultiplier): method __init__ (line 66) | def __init__(self, weight_quantizer: quantizer_impl.IQuantizer, method implemented_as (line 115) | def implemented_as(): class XorGate (line 119) | class XorGate(IMultiplier): method __init__ (line 122) | def __init__(self, weight_quantizer: quantizer_impl.IQuantizer, method implemented_as (line 138) | def implemented_as(): class Shifter (line 142) | class Shifter(IMultiplier): method __init__ (line 183) | def __init__( method implemented_as (line 228) | def implemented_as(): class AndGate (line 232) | class AndGate(IMultiplier): method __init__ (line 236) | def __init__( method implemented_as (line 273) | def implemented_as(): class Adder (line 277) | class Adder(IMultiplier): method __init__ (line 280) | def __init__(self, weight_quantizer: quantizer_impl.IQuantizer, method implemented_as (line 310) | def implemented_as(): class FloatingPointMultiplier (line 314) | class FloatingPointMultiplier(IMultiplier): method __init__ (line 317) | def __init__(self, weight_quantizer: quantizer_impl.IQuantizer, method implemented_as (line 337) | def implemented_as(): class FixedPointMultiplier (line 341) | class FixedPointMultiplier(IMultiplier): method __init__ (line 344) | def __init__(self, weight_quantizer: quantizer_impl.IQuantizer, method implemented_as (line 373) | def implemented_as(): FILE: qkeras/qtools/quantized_operators/qbn_factory.py class QBNFactory (line 32) | class QBNFactory: method make_quantizer (line 40) | def make_quantizer( FILE: qkeras/qtools/quantized_operators/quantizer_factory.py class QuantizerFactory (line 29) | class QuantizerFactory: method __init__ (line 32) | def __init__(self): method _make_quantizer_util (line 94) | def _make_quantizer_util(self, quantizer) -> quantizer_impl.IQuantizer: method make_quantizer (line 110) | def make_quantizer(self, quantizer) -> quantizer_impl.IQuantizer: method is_quantizer_supported (line 123) | def is_quantizer_supported(self, quantizer) -> bool: method make_default_quantizer (line 130) | def make_default_quantizer(self, mode) -> quantizer_impl.IQuantizer: method clone_quantizer (line 162) | def clone_quantizer( FILE: qkeras/qtools/quantized_operators/quantizer_impl.py function get_np_value (line 30) | def get_np_value(val): function get_exp (line 41) | def get_exp(quantizer): class IQuantizer (line 67) | class IQuantizer(abc.ABC): method __init__ (line 70) | def __init__(self): class QuantizedBits (line 82) | class QuantizedBits(IQuantizer): method __init__ (line 94) | def __init__(self): method convert_qkeras_quantizer (line 100) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 107) | def convert_to_qkeras_quantizer( class QuantizedTanh (line 122) | class QuantizedTanh(QuantizedBits): method __init__ (line 125) | def __init__(self): method convert_qkeras_quantizer (line 129) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 135) | def convert_to_qkeras_quantizer( class QuantizedUlaw (line 144) | class QuantizedUlaw(QuantizedBits): method __init__ (line 148) | def __init__(self): method convert_qkeras_quantizer (line 152) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 159) | def convert_to_qkeras_quantizer(self, symmetric=0, u=255.0): class Binary (line 166) | class Binary(IQuantizer): method __init__ (line 169) | def __init__(self, use_01=False): method convert_qkeras_quantizer (line 183) | def convert_qkeras_quantizer(self, quantizer: quantizers.binary): method convert_to_qkeras_quantizer (line 193) | def convert_to_qkeras_quantizer(self, alpha=None, class StochasticBinary (line 201) | class StochasticBinary(Binary): method __init__ (line 205) | def __init__(self): method convert_qkeras_quantizer (line 209) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 215) | def convert_to_qkeras_quantizer(self, alpha=None, temperature=6.0, class Bernoulli (line 223) | class Bernoulli(Binary): method __init__ (line 226) | def __init__(self): method convert_qkeras_quantizer (line 230) | def convert_qkeras_quantizer(self, quantizer: quantizers.bernoulli): method convert_to_qkeras_quantizer (line 233) | def convert_to_qkeras_quantizer(self, alpha=None, temperature=6.0, class QuantizedRelu (line 241) | class QuantizedRelu(IQuantizer): method __init__ (line 244) | def __init__(self): method convert_qkeras_quantizer (line 249) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 267) | def convert_to_qkeras_quantizer( class Ternary (line 281) | class Ternary(IQuantizer): method __init__ (line 284) | def __init__(self): method convert_qkeras_quantizer (line 292) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 296) | def convert_to_qkeras_quantizer( class StochasticTernary (line 307) | class StochasticTernary(Ternary): method __init__ (line 310) | def __init__(self): method convert_qkeras_quantizer (line 315) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 319) | def convert_to_qkeras_quantizer( class FloatingPoint (line 330) | class FloatingPoint(IQuantizer): method __init__ (line 333) | def __init__(self, bits): method convert_qkeras_quantizer (line 342) | def convert_qkeras_quantizer(self, bits): method convert_to_qkeras_quantizer (line 345) | def convert_to_qkeras_quantizer(self, bits): class PowerOfTwo (line 349) | class PowerOfTwo(IQuantizer): method __init__ (line 352) | def __init__(self, is_signed=True): method convert_qkeras_quantizer (line 364) | def convert_qkeras_quantizer(self, quantizer): method convert_to_qkeras_quantizer (line 387) | def convert_to_qkeras_quantizer( method get_min_max_exp (line 408) | def get_min_max_exp(self): method quantizer_bits_calculator (line 411) | def quantizer_bits_calculator(self, val): method update_quantizer (line 451) | def update_quantizer(self, val, reset=False): method update_inference_values (line 482) | def update_inference_values(self, weights): class ReluPowerOfTwo (line 489) | class ReluPowerOfTwo(PowerOfTwo): method __init__ (line 492) | def __init__(self): method convert_qkeras_quantizer (line 499) | def convert_qkeras_quantizer( method convert_to_qkeras_quantizer (line 509) | def convert_to_qkeras_quantizer( FILE: qkeras/qtools/quantized_operators/subtractor_factory.py class ISubtractor (line 26) | class ISubtractor(adder_factory.IAdder): method make_quantizer (line 33) | def make_quantizer(self, quantizer_1: quantizer_impl.IQuantizer, FILE: qkeras/qtools/run_qtools.py class QTools (line 34) | class QTools: method __init__ (line 37) | def __init__(self, model, process, source_quantizers=None, method qtools_stats_to_json (line 68) | def qtools_stats_to_json(self, json_name): method qtools_stats_print (line 74) | def qtools_stats_print(self): method pe (line 80) | def pe(self, weights_on_memory="dram", method extract_energy_sum (line 100) | def extract_energy_sum(self, cfg_setting, energy_dict): method extract_energy_profile (line 114) | def extract_energy_profile(self, cfg_setting, energy_dict): method calculate_ace (line 131) | def calculate_ace(self, default_float_bits): method calculate_output_bytes (line 162) | def calculate_output_bytes(self, include_model_input_size, method calculate_weight_bytes (line 193) | def calculate_weight_bytes(self, default_float_bits): method get_roofline_numbers (line 225) | def get_roofline_numbers(self, include_model_input_size=True, FILE: qkeras/qtools/settings.py class ConfigClass (line 25) | class ConfigClass: method __init__ (line 28) | def __init__(self): method update (line 59) | def update(self, process, cfg_setting): FILE: qkeras/quantizer_registry.py function register_quantizer (line 24) | def register_quantizer(quantizer): function lookup_quantizer (line 32) | def lookup_quantizer(name): FILE: qkeras/quantizers.py function get_weight_scale (line 43) | def get_weight_scale(quantizer, x=None): function _get_integer_bits (line 59) | def _get_integer_bits(min_value, function _get_scaling_axis (line 127) | def _get_scaling_axis(scale_axis: Any, len_axis: int) -> List[int]: function _get_unrolled_shape (line 157) | def _get_unrolled_shape(input_shape: List[int], unroll_factor: Any, function _get_rolled_back_shape (line 219) | def _get_rolled_back_shape(input_shape: List[int], roll_axis: Any) -> Li... function _validate_axis_and_eps (line 262) | def _validate_axis_and_eps(x_shape: List[int], scale_axis: Any, function _repeat_along_axis (line 356) | def _repeat_along_axis(x: tf.Tensor, axis: int, repeats: int) -> tf.Tensor: function _repeat_along_axes (line 361) | def _repeat_along_axes(x: tf.Tensor, axis: Any, repeats: Any) -> tf.Tensor: function _get_scale_mean (line 371) | def _get_scale_mean( function _clip_po2_scale (line 429) | def _clip_po2_scale(scale: tf.Tensor, min_po2_exponent: Any, function _get_least_squares_scale (line 439) | def _get_least_squares_scale( function _get_scale (line 508) | def _get_scale(*args, **kwargs): function smooth_sigmoid (line 512) | def smooth_sigmoid(x): function hard_sigmoid (line 522) | def hard_sigmoid(x): function binary_sigmoid (line 528) | def binary_sigmoid(x): function set_internal_sigmoid (line 541) | def set_internal_sigmoid(mode): function binary_tanh (line 560) | def binary_tanh(x): function hard_tanh (line 565) | def hard_tanh(x): function smooth_tanh (line 570) | def smooth_tanh(x): function stochastic_round (line 575) | def stochastic_round(x, precision=0.5): function stochastic_round_po2 (line 586) | def stochastic_round_po2(x): function _round_through (line 616) | def _round_through(x, use_stochastic_rounding=False, precision=0.5): function _sign_through (line 651) | def _sign_through(x): function _ceil_through (line 662) | def _ceil_through(x): function _floor_through (line 668) | def _floor_through(x): class quantized_linear (line 683) | class quantized_linear(base_quantizer.BaseQuantizer): method __init__ (line 837) | def __init__( method _check_bits (line 874) | def _check_bits(self, bits): method _check_alpha (line 880) | def _check_alpha(self, alpha): method bits (line 898) | def bits(self): method integer (line 902) | def integer(self): method keep_negative (line 906) | def keep_negative(self): method use_stochastic_rounding (line 910) | def use_stochastic_rounding(self): method scale_axis (line 914) | def scale_axis(self): method use_variables (line 918) | def use_variables(self): method scale (line 922) | def scale(self): method data_type_scale (line 926) | def data_type_scale(self): method auto_alpha (line 933) | def auto_alpha(self): method use_sign_function (line 939) | def use_sign_function(self): method default_quantization_scale (line 945) | def default_quantization_scale(self): method get_clip_bounds (line 957) | def get_clip_bounds(self): method __call__ (line 972) | def __call__(self, x): method _scale_clip_and_round (line 998) | def _scale_clip_and_round(self, x, quantization_scale): method _get_auto_quantization_scale (line 1021) | def _get_auto_quantization_scale(self, x): method _get_quantization_scale_from_max_data (line 1038) | def _get_quantization_scale_from_max_data(self, x): method _po2_autoscale (line 1058) | def _po2_autoscale(self, x, quantization_scale): method _build (line 1103) | def _build(self): method max (line 1109) | def max(self): method min (line 1114) | def min(self): method range (line 1119) | def range(self): method __str__ (line 1134) | def __str__(self): method _set_trainable_parameter (line 1155) | def _set_trainable_parameter(self): method from_config (line 1161) | def from_config(cls, config): method get_config (line 1164) | def get_config(self): class quantized_bits (line 1179) | class quantized_bits(base_quantizer.BaseQuantizer): # pylint: disable=i... method __init__ (line 1250) | def __init__(self, method __str__ (line 1299) | def __str__(self): method __call__ (line 1320) | def __call__(self, x): method _set_trainable_parameter (line 1454) | def _set_trainable_parameter(self): method max (line 1460) | def max(self): method min (line 1472) | def min(self): method range (line 1485) | def range(self): method from_config (line 1500) | def from_config(cls, config): method get_config (line 1507) | def get_config(self): class bernoulli (line 1535) | class bernoulli(base_quantizer.BaseQuantizer): # pylint: disable=invali... method __init__ (line 1565) | def __init__(self, alpha=None, temperature=6.0, use_real_sigmoid=True): method __str__ (line 1574) | def __str__(self): method __call__ (line 1587) | def __call__(self, x): method _set_trainable_parameter (line 1625) | def _set_trainable_parameter(self): method max (line 1629) | def max(self): method min (line 1636) | def min(self): method from_config (line 1641) | def from_config(cls, config): method get_config (line 1644) | def get_config(self): class ternary (line 1650) | class ternary(base_quantizer.BaseQuantizer): # pylint: disable=invalid-... method __init__ (line 1670) | def __init__(self, alpha=None, threshold=None, use_stochastic_rounding... method __str__ (line 1682) | def __str__(self): method __call__ (line 1699) | def __call__(self, x): method _set_trainable_parameter (line 1767) | def _set_trainable_parameter(self): method max (line 1771) | def max(self): method min (line 1778) | def min(self): method from_config (line 1786) | def from_config(cls, config): method get_config (line 1789) | def get_config(self): class stochastic_ternary (line 1800) | class stochastic_ternary(ternary): # pylint: disable=invalid-name method __init__ (line 1820) | def __init__( method __str__ (line 1843) | def __str__(self): method __call__ (line 1860) | def __call__(self, x): method _set_trainable_parameter (line 1923) | def _set_trainable_parameter(self): method max (line 1927) | def max(self): method min (line 1934) | def min(self): method from_config (line 1942) | def from_config(cls, config): method get_config (line 1945) | def get_config(self): class binary (line 1957) | class binary(base_quantizer.BaseQuantizer): # pylint: disable=invalid-name method __init__ (line 2011) | def __init__(self, use_01=False, alpha=None, use_stochastic_rounding=F... method __str__ (line 2026) | def __str__(self): method __call__ (line 2058) | def __call__(self, x): method _set_trainable_parameter (line 2123) | def _set_trainable_parameter(self): method max (line 2127) | def max(self): method min (line 2134) | def min(self): method from_config (line 2144) | def from_config(cls, config): method get_config (line 2147) | def get_config(self): class stochastic_binary (line 2157) | class stochastic_binary(binary): # pylint: disable=invalid-name method __init__ (line 2175) | def __init__(self, alpha=None, temperature=6.0, use_real_sigmoid=True): method __str__ (line 2184) | def __str__(self): method __call__ (line 2197) | def __call__(self, x): method _set_trainable_parameter (line 2232) | def _set_trainable_parameter(self): method max (line 2236) | def max(self): method min (line 2243) | def min(self): method from_config (line 2251) | def from_config(cls, config): method get_config (line 2254) | def get_config(self): function fast_relu_quantize (line 2264) | def fast_relu_quantize(p, m_i, factor): class quantized_relu (line 2269) | class quantized_relu(base_quantizer.BaseQuantizer): # pylint: disable=i... method __init__ (line 2320) | def __init__(self, method __str__ (line 2350) | def __str__(self): method __call__ (line 2367) | def __call__(self, x): method max (line 2434) | def max(self): method min (line 2447) | def min(self): method range (line 2461) | def range(self): method from_config (line 2474) | def from_config(cls, config): method get_config (line 2477) | def get_config(self): class quantized_ulaw (line 2500) | class quantized_ulaw(base_quantizer.BaseQuantizer): # pylint: disable=i... method __init__ (line 2514) | def __init__(self, bits=8, integer=0, symmetric=0, u=255.0): method __str__ (line 2521) | def __str__(self): method __call__ (line 2529) | def __call__(self, x): method max (line 2541) | def max(self): method min (line 2550) | def min(self): method from_config (line 2560) | def from_config(cls, config): method get_config (line 2563) | def get_config(self): class quantized_tanh (line 2574) | class quantized_tanh(base_quantizer.BaseQuantizer): # pylint: disable=i... method __init__ (line 2593) | def __init__(self, bits=8, use_stochastic_rounding=False, method __str__ (line 2601) | def __str__(self): method __call__ (line 2611) | def __call__(self, x): method max (line 2621) | def max(self): method min (line 2625) | def min(self): method from_config (line 2630) | def from_config(cls, config): method get_config (line 2633) | def get_config(self): class quantized_sigmoid (line 2644) | class quantized_sigmoid(base_quantizer.BaseQuantizer): # pylint: disabl... method __init__ (line 2658) | def __init__(self, bits=8, symmetric=False, method __str__ (line 2667) | def __str__(self): method __call__ (line 2677) | def __call__(self, x): method max (line 2687) | def max(self): method min (line 2691) | def min(self): method from_config (line 2696) | def from_config(cls, config): method get_config (line 2699) | def get_config(self): function _clip_power_of_two (line 2709) | def _clip_power_of_two(x_abs, function _need_exponent_sign_bit_check (line 2781) | def _need_exponent_sign_bit_check(max_value): function _get_min_max_exponents (line 2810) | def _get_min_max_exponents(non_sign_bits, need_exponent_sign_bit, class quantized_po2 (line 2833) | class quantized_po2(base_quantizer.BaseQuantizer): # pylint: disable=in... method __init__ (line 2859) | def __init__(self, method __str__ (line 2887) | def __str__(self): method __call__ (line 2898) | def __call__(self, x): method max (line 2918) | def max(self): method min (line 2925) | def min(self): method from_config (line 2933) | def from_config(cls, config): method get_config (line 2936) | def get_config(self): class quantized_relu_po2 (line 2970) | class quantized_relu_po2(base_quantizer.BaseQuantizer): # pylint: disab... method __init__ (line 2996) | def __init__(self, method __str__ (line 3031) | def __str__(self): method __call__ (line 3044) | def __call__(self, x): method max (line 3084) | def max(self): method min (line 3091) | def min(self): method from_config (line 3103) | def from_config(cls, config): method get_config (line 3106) | def get_config(self): class quantized_hswish (line 3144) | class quantized_hswish(quantized_bits): # pylint: disable=invalid-name method __init__ (line 3186) | def __init__( method __str__ (line 3216) | def __str__(self): method __call__ (line 3251) | def __call__(self, x): method min (line 3270) | def min(self): method get_config (line 3288) | def get_config(self): function get_quantizer (line 3303) | def get_quantizer(identifier): function get_quantized_initializer (line 3334) | def get_quantized_initializer(w_initializer, w_range): FILE: qkeras/registry.py class Registry (line 45) | class Registry(object): method __init__ (line 48) | def __init__(self): method register (line 52) | def register(self, item, name=None): method lookup (line 64) | def lookup(self, name): FILE: qkeras/safe_eval.py function Num (line 31) | def Num(s): function Str (line 47) | def Str(s): function IsNum (line 50) | def IsNum(s): function IsBool (line 61) | def IsBool(s): function IsNone (line 67) | def IsNone(s): function Bool (line 70) | def Bool(s): function ListofNums (line 73) | def ListofNums(s): function IsListofNums (line 79) | def IsListofNums(s): function GetArg (line 92) | def GetArg(s): function GetParams (line 105) | def GetParams(s): function safe_eval (line 137) | def safe_eval(eval_str, op_dict, *params, **kwparams): # pylint: disabl... FILE: qkeras/utils.py function find_bn_fusing_layer_pair (line 102) | def find_bn_fusing_layer_pair(model, custom_objects={}): function add_bn_fusing_weights (line 147) | def add_bn_fusing_weights(prev_layer, bn_layer, saved_weights): function model_save_quantized_weights (line 223) | def model_save_quantized_weights(model, filename=None, custom_objects={}): function quantize_activation (line 416) | def quantize_activation(layer_config, activation_bits): function get_config (line 442) | def get_config(quantizer_config, layer, layer_class, parameter=None): function is_TFOpLambda_layer (line 453) | def is_TFOpLambda_layer(layer): function get_y_from_TFOpLambda (line 457) | def get_y_from_TFOpLambda(model_cfg, layer): function convert_to_folded_model (line 483) | def convert_to_folded_model(model): function model_quantize (line 579) | def model_quantize(model, function _add_supported_quantized_objects (line 1029) | def _add_supported_quantized_objects(custom_objects): function clone_model (line 1072) | def clone_model(model, custom_objects=None): function quantized_model_from_json (line 1089) | def quantized_model_from_json(json_string, custom_objects=None): function load_qmodel (line 1103) | def load_qmodel(filepath, custom_objects=None, compile=True): function print_model_sparsity (line 1137) | def print_model_sparsity(model): function get_model_sparsity (line 1165) | def get_model_sparsity(model, per_layer=False, allow_list=None): function quantized_model_debug (line 1234) | def quantized_model_debug(model, X_test, plot=False, plt_instance=None): function quantized_model_dump (line 1316) | def quantized_model_dump(model, function clone_model_and_freeze_auto_po2_scale (line 1357) | def clone_model_and_freeze_auto_po2_scale( FILE: tests/automatic_conversion_test.py function create_network (line 27) | def create_network(): function create_network_with_bn (line 36) | def create_network_with_bn(): function create_network_sequential (line 47) | def create_network_sequential(): function test_linear_activation (line 57) | def test_linear_activation(): function test_linear_activation_conversion (line 63) | def test_linear_activation_conversion(): function test_no_activation_conversion_to_quantized (line 78) | def test_no_activation_conversion_to_quantized(): function test_automatic_conversion_from_relu_to_qr (line 86) | def test_automatic_conversion_from_relu_to_qr(): function test_conversion_from_relu_activation_to_qr_qactivation (line 97) | def test_conversion_from_relu_activation_to_qr_qactivation(): function test_conversion_from_relu_activation_to_qadaptiveactivation (line 114) | def test_conversion_from_relu_activation_to_qadaptiveactivation(): function test_conversion_qadaptiveactivation_with_preference (line 131) | def test_conversion_qadaptiveactivation_with_preference(): function test_sequential_model_conversion (line 156) | def test_sequential_model_conversion(): function test_folded_layer_conversion (line 167) | def test_folded_layer_conversion(): FILE: tests/autoqkeras_test.py function dense_model (line 38) | def dense_model(): function test_autoqkeras (line 58) | def test_autoqkeras(): FILE: tests/bn_folding_test.py function get_sgd_optimizer (line 42) | def get_sgd_optimizer(learning_rate): function get_qconv2d_model (line 49) | def get_qconv2d_model(input_shape, kernel_size, kernel_quantizer=None): function get_qconv2d_batchnorm_model (line 92) | def get_qconv2d_batchnorm_model(input_shape, kernel_size, folding_mode, function get_models_with_one_layer (line 113) | def get_models_with_one_layer(kernel_quantizer, folding_mode, ema_freeze... function get_debug_model (line 167) | def get_debug_model(model): function generate_dataset (line 177) | def generate_dataset(train_size=10, function run_training (line 200) | def run_training(model, epochs, loss_fn, loss_metric, optimizer, function test_unfold_model (line 243) | def test_unfold_model(): function test_loading (line 353) | def test_loading(): function test_same_training_and_prediction (line 402) | def test_same_training_and_prediction(): function test_populate_bias_quantizer_from_accumulator (line 612) | def test_populate_bias_quantizer_from_accumulator(): FILE: tests/callbacks_test.py function qconv_model (line 34) | def qconv_model(): function test_QNoiseScheduler (line 49) | def test_QNoiseScheduler(): FILE: tests/codebook_test.py function test_codebook_weights (line 62) | def test_codebook_weights(bits, axis, quantizer, weights, expected_result): FILE: tests/leakyrelu_test.py function test_quantized_relu (line 74) | def test_quantized_relu(bits, integer, use_sigmoid, negative_slope, test... function test_quantized_relu_po2 (line 131) | def test_quantized_relu_po2(bits, negative_slope, test_values, expected_... FILE: tests/min_max_test.py function test_binary (line 26) | def test_binary(): function test_ternary (line 36) | def test_ternary(): function test_quantized_bits (line 46) | def test_quantized_bits(): function test_po2 (line 81) | def test_po2(): FILE: tests/print_qstats_test.py function create_network (line 33) | def create_network(): function create_mix_network (line 42) | def create_mix_network(): function create_network_with_bn (line 52) | def create_network_with_bn(): function test_conversion_print_qstats (line 65) | def test_conversion_print_qstats(): FILE: tests/qactivation_test.py function disable_test_quantized_po2 (line 118) | def disable_test_quantized_po2( function disable_test_quantized_relu_po2 (line 193) | def disable_test_quantized_relu_po2(bits, max_value, use_stochastic_roun... function test_smooth_sigmoid (line 207) | def test_smooth_sigmoid(): function test_hard_sigmoid (line 226) | def test_hard_sigmoid(): function test_quantized_sigmoid (line 281) | def test_quantized_sigmoid(bits, sigmoid_type, use_real_sigmoid, function test_quantized_sigmoid_limits (line 330) | def test_quantized_sigmoid_limits( function test_quantized_tanh (line 373) | def test_quantized_tanh(bits, use_real_tanh, test_values, expected_values): function test_quantized_tanh_limits (line 420) | def test_quantized_tanh_limits(bits, sigmoid_type, use_real_tanh, test_v... function test_quantized_relu (line 469) | def test_quantized_relu(bits, integer, use_sigmoid, test_values, expecte... function test_quantized_bits (line 527) | def test_quantized_bits(bits, integer, symmetric, keep_negative, test_va... function test_quantized_bits_with_auto_po2_scale (line 547) | def test_quantized_bits_with_auto_po2_scale( function test_quantized_bits_with_post_training_scale (line 561) | def test_quantized_bits_with_post_training_scale(): function test_ternary (line 592) | def test_ternary(alpha, threshold, test_values, expected_values): function test_binary (line 613) | def test_binary(use_01, alpha, test_values, expected_values): function test_stochastic_round_quantized_po2 (line 630) | def test_stochastic_round_quantized_po2(test_values, expected_values): function test_stochastic_round_quantized_relu_po2 (line 648) | def test_stochastic_round_quantized_relu_po2(test_values, expected_values): function test_stochastic_binary (line 659) | def test_stochastic_binary(): function test_stochastic_binary_inference_mode (line 706) | def test_stochastic_binary_inference_mode(alpha, test_values, expected_v... function test_stochastic_ternary (line 738) | def test_stochastic_ternary(bound, alpha, temperature, expected_values, function test_stochastic_ternary_inference_mode (line 772) | def test_stochastic_ternary_inference_mode(alpha, threshold, test_values, function test_quantized_hswish (line 806) | def test_quantized_hswish(bits, integer, symmetric, relu_shift, function test_quantized_relu_fast_inference (line 816) | def test_quantized_relu_fast_inference(): FILE: tests/qadaptiveactivation_test.py function run_qadaptiveactivation_test (line 31) | def run_qadaptiveactivation_test(input_val, kwargs): function test_qadaptiveact_ema (line 121) | def test_qadaptiveact_ema(momentum, ema_freeze_delay, total_steps, function test_qadaptiveactivation (line 169) | def test_qadaptiveactivation(): FILE: tests/qalpha_test.py function test_binary_auto (line 37) | def test_binary_auto(): function test_binary_auto_po2 (line 58) | def test_binary_auto_po2(): function test_ternary_auto (line 83) | def test_ternary_auto(): function test_ternary_auto_po2 (line 103) | def test_ternary_auto_po2(): function test_get_integer_bits (line 128) | def test_get_integer_bits(): FILE: tests/qconvolutional_test.py function test_qnetwork (line 52) | def test_qnetwork(): function test_sequential_qnetwork (line 162) | def test_sequential_qnetwork(): function test_qconv1d (line 206) | def test_qconv1d(layer_cls): function test_qconv2dtranspose (line 288) | def test_qconv2dtranspose(): function test_masked_qconv2d_creates_correct_parameters (line 312) | def test_masked_qconv2d_creates_correct_parameters(): function test_qconv2d_masks_weights (line 328) | def test_qconv2d_masks_weights(): function test_masked_qconv2d_load_restore_works (line 355) | def test_masked_qconv2d_load_restore_works(): function test_qconv2d_groups_works (line 385) | def test_qconv2d_groups_works(): FILE: tests/qdepthwise_conv2d_transpose_test.py function create_model (line 118) | def create_model(group_size=1): function create_quantized_model (line 137) | def create_quantized_model(group_size=1): function test_qseparable_conv2d_transpose (line 156) | def test_qseparable_conv2d_transpose(): function test_quantization_in_separable_conv2d_transpose (line 198) | def test_quantization_in_separable_conv2d_transpose(): function test_qseparable_conv2d_transpose_with_groups (line 241) | def test_qseparable_conv2d_transpose_with_groups(): function test_save_and_load_model (line 284) | def test_save_and_load_model(): FILE: tests/qlayers_test.py function qdense_util (line 45) | def qdense_util(layer_cls, function test_qdense (line 93) | def test_qdense(layer_kwargs, input_data, weight_data, bias_data, function test_qactivation_loads (line 103) | def test_qactivation_loads(): FILE: tests/qmac_test.py function create_qmac_model (line 37) | def create_qmac_model(layer_cls, function test_qmac (line 64) | def test_qmac(layer_kwargs, input_data, weight_data, bias_data, FILE: tests/qnoise_test.py function test_qnoise_quantized_bits (line 30) | def test_qnoise_quantized_bits(): function test_qnoise_quantized_relu (line 69) | def test_qnoise_quantized_relu(): FILE: tests/qpooling_test.py function test_q_average_pooling (line 81) | def test_q_average_pooling(pooling, input_size, pool_size, strides, padd... function test_qpooling_in_model_quantize (line 145) | def test_qpooling_in_model_quantize(): function test_qpooling_in_qtools (line 175) | def test_qpooling_in_qtools(): function test_QAveragePooling_output (line 263) | def test_QAveragePooling_output(): function test_QGlobalAveragePooling_output (line 280) | def test_QGlobalAveragePooling_output(): FILE: tests/qrecurrent_test.py function test_qrnn (line 101) | def test_qrnn(rnn, all_weights_signature, expected_output): function test_qbidirectional (line 204) | def test_qbidirectional(rnn, all_weights_signature, expected_output): function create_network_rnn (line 267) | def create_network_rnn(rnn): function test_rnn_conversion (line 274) | def test_rnn_conversion(rnn): function create_network_birnn (line 300) | def create_network_birnn(rnn): function test_birnn_conversion (line 307) | def test_birnn_conversion(rnn): function test_birnn_subrnn (line 343) | def test_birnn_subrnn(): FILE: tests/qseparable_conv2d_transpose_test.py function create_model (line 33) | def create_model(): function create_quantized_model (line 53) | def create_quantized_model(): function test_qseparable_conv2d_transpose (line 73) | def test_qseparable_conv2d_transpose(): function test_quantization_in_separable_conv2d_transpose (line 139) | def test_quantization_in_separable_conv2d_transpose(): function test_save_and_load_model (line 179) | def test_save_and_load_model(): FILE: tests/qtools_model_test.py function qdense_model_fork (line 44) | def qdense_model_fork(): function qconv_model (line 71) | def qconv_model(): function po2_qbits_model (line 98) | def po2_qbits_model(): function float_po2_model (line 111) | def float_po2_model(): function qbn_model (line 133) | def qbn_model( function qbn_model_inference (line 154) | def qbn_model_inference(): function add_qmodel (line 210) | def add_qmodel(quantizer1, quantizer2, quantizer3): function multiply_qmodel (line 245) | def multiply_qmodel(): function pooling_qmodel (line 281) | def pooling_qmodel(): function maximum_qmodel (line 294) | def maximum_qmodel(quantizer1, quantizer2, quantizer3): function concatenate_qmodel (line 327) | def concatenate_qmodel(quantizer1, quantizer2, quantizer3): function run (line 361) | def run(model, input_quantizers, is_inference=False, function test_wrong_input_quantizers (line 382) | def test_wrong_input_quantizers(): function test_qbn_inference (line 410) | def test_qbn_inference(): function test_invalid_denominator_qbn (line 477) | def test_invalid_denominator_qbn(): function test_conv2d (line 489) | def test_conv2d(): function test_qdense_model_fork (line 522) | def test_qdense_model_fork(): function test_util_layers (line 542) | def test_util_layers(): function test_merge_layers (line 583) | def test_merge_layers(): function test_pooling (line 627) | def test_pooling(): function test_qenergy (line 643) | def test_qenergy(): function test_quntized_reference_energy_same_as_floating_trial (line 745) | def test_quntized_reference_energy_same_as_floating_trial(): function test_auto_po2 (line 839) | def test_auto_po2(): function test_big_bias_quantizer (line 901) | def test_big_bias_quantizer(): function test_qdepthwiseconv2d (line 914) | def test_qdepthwiseconv2d(): function test_divide_and_conquer_sequential_conv2d (line 950) | def test_divide_and_conquer_sequential_conv2d(): FILE: tests/qtools_util_test.py function test_adjust_multiplier_for_auto_po2 (line 42) | def test_adjust_multiplier_for_auto_po2( FILE: tests/quantizer_impl_test.py function test_QuantizedBits (line 34) | def test_QuantizedBits(): function test_QuantizedBits_ElementsPerScale (line 49) | def test_QuantizedBits_ElementsPerScale(): function test_QuantizedTanh (line 99) | def test_QuantizedTanh(): function test_QuantizedUlaw (line 112) | def test_QuantizedUlaw(): function test_Binary (line 125) | def test_Binary(): function test_StochasticBinary (line 138) | def test_StochasticBinary(): function test_Bernoulli (line 152) | def test_Bernoulli(): function test_QuantizedRelu (line 165) | def test_QuantizedRelu(): function test_Ternary (line 182) | def test_Ternary(): function test_StochasticTernary (line 197) | def test_StochasticTernary(): function test_PowerOfTwo (line 212) | def test_PowerOfTwo(): function test_ReluPowerOfTwo (line 226) | def test_ReluPowerOfTwo(): function test_GetScale_PerChannelScale (line 240) | def test_GetScale_PerChannelScale(): function _get_num_unique_elements (line 282) | def _get_num_unique_elements(input_tensor): function test_GetScale_ElementsPerScale_Scalar_ScaleAxis_EPS (line 286) | def test_GetScale_ElementsPerScale_Scalar_ScaleAxis_EPS(): function test_GetScale_ElementsPerScale_List_ScaleAxis_EPS (line 363) | def test_GetScale_ElementsPerScale_List_ScaleAxis_EPS(): function test_GetScale_MinPO2Exponent_MaxPO2Exponent (line 443) | def test_GetScale_MinPO2Exponent_MaxPO2Exponent(): function test_GetUnrolledShape_GetRolledBackShape (line 486) | def test_GetUnrolledShape_GetRolledBackShape(): FILE: tests/quantizer_registry_test.py function test_lookup (line 44) | def test_lookup(quantizer_name): FILE: tests/range_test.py function test_quantized_relu_range (line 47) | def test_quantized_relu_range(bits, integer, expected_values): function test_quantized_bits_range (line 70) | def test_quantized_bits_range(bits, integer, expected_values): FILE: tests/registry_test.py function sample_function (line 25) | def sample_function(arg): class SampleClass (line 30) | class SampleClass(object): method __init__ (line 33) | def __init__(self, arg): method get_arg (line 36) | def get_arg(self): function test_register_function (line 40) | def test_register_function(): function test_register_class (line 48) | def test_register_class(): function test_register_with_name (line 56) | def test_register_with_name(): function test_lookup_missing_item (line 65) | def test_lookup_missing_item(): function test_lookup_missing_name (line 70) | def test_lookup_missing_name(): FILE: tests/safe_eval_test.py function test_get_params1 (line 31) | def test_get_params1(): function test_get_params2 (line 38) | def test_get_params2(): function test_get_params3 (line 47) | def test_get_params3(): function test_safe_eval1 (line 63) | def test_safe_eval1(): function i_func (line 68) | def i_func(s): function myadd2 (line 72) | def myadd2(a, b): function myadd (line 76) | def myadd(a=32, b=10): class myaddcls (line 79) | class myaddcls(object): method __call__ (line 80) | def __call__(self, a=32, b=10): function test_safe_eval2 (line 83) | def test_safe_eval2(): function test_safe_eval3 (line 88) | def test_safe_eval3(): function test_safe_eval4 (line 93) | def test_safe_eval4(): function test_safe_eval5 (line 98) | def test_safe_eval5(): FILE: tests/utils_test.py function create_quantized_network (line 39) | def create_quantized_network(): function create_quantized_po2_network (line 64) | def create_quantized_po2_network(): function set_network_sparsity (line 75) | def set_network_sparsity(model, sparsity): function test_get_model_sparsity (line 90) | def test_get_model_sparsity(): function test_get_po2_model_sparsity (line 104) | def test_get_po2_model_sparsity(): function test_convert_to_folded_model (line 123) | def test_convert_to_folded_model(): function test_find_bn_fusing_layer_pair (line 171) | def test_find_bn_fusing_layer_pair(): function create_test_model_for_scale_freezing (line 230) | def create_test_model_for_scale_freezing(bias_quantizer): function test_clone_model_and_freeze_auto_po2_scale (line 291) | def test_clone_model_and_freeze_auto_po2_scale(): function test_clone_model_and_freeze_auto_po2_scale_serialization (line 317) | def test_clone_model_and_freeze_auto_po2_scale_serialization(): function test_clone_model_and_freeze_auto_po2_scale_error (line 330) | def test_clone_model_and_freeze_auto_po2_scale_error():