From 6695e8df7f6a2c7715b9ed69c4b78157376bb60b Mon Sep 17 00:00:00 2001 From: Fabian Grob Date: Wed, 15 Nov 2023 15:45:18 +0000 Subject: [PATCH] Fix (GPFQ): change default value for p to 1 --- src/brevitas/graph/gpfq.py | 8 ++++---- .../imagenet_classification/ptq/ptq_evaluate.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/brevitas/graph/gpfq.py b/src/brevitas/graph/gpfq.py index 444e6e0ba..2d312a549 100644 --- a/src/brevitas/graph/gpfq.py +++ b/src/brevitas/graph/gpfq.py @@ -43,7 +43,7 @@ def __init__( inplace: bool = True, create_weight_orig: bool = True, use_quant_activations: bool = True, - p: int = 0.25, + p: float = 1.0, return_forward_output: bool = False, act_order: bool = False) -> None: if not inplace: @@ -117,10 +117,10 @@ def __init__( act_order, len_parallel_layers=1, create_weight_orig=True, - p=0.25) -> None: - + p=1.0) -> None: + super().__init__(layer, name, act_order, len_parallel_layers, create_weight_orig) - + self.float_input = None self.quantized_input = None self.index_computed = False diff --git a/src/brevitas_examples/imagenet_classification/ptq/ptq_evaluate.py b/src/brevitas_examples/imagenet_classification/ptq/ptq_evaluate.py index 34d8cb97f..6f4243741 100644 --- a/src/brevitas_examples/imagenet_classification/ptq/ptq_evaluate.py +++ b/src/brevitas_examples/imagenet_classification/ptq/ptq_evaluate.py @@ -167,7 +167,7 @@ default=True, help='Narrow range for weight quantization (default: enabled)') parser.add_argument( - '--gpfq-p', default=0.25, type=float, help='P parameter for GPFQ (default: 0.25)') + '--gpfq-p', default=1.0, type=float, help='P parameter for GPFQ (default: 0.25)') parser.add_argument( '--quant-format', default='int',