-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Geunho Lee <quic_geunlee@quicinc.com>
- Loading branch information
1 parent
3b9589d
commit 616d44a
Showing
4 changed files
with
92 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
:orphan: | ||
|
||
.. _api-keras-quant-analyzer: | ||
|
||
================================ | ||
AIMET Keras Quant Analyzer API | ||
================================ | ||
|
||
AIMET Keras Quant Analyzer analyzes the Keras model and points out sensitive layers to quantization in the model. | ||
It checks model sensitivity to weight and activation quantization, performs per layer sensitivity and MSE analysis. | ||
It also exports per layer encodings min and max ranges and statistics histogram for every layer. | ||
|
||
Top-level API | ||
============= | ||
.. autoclass:: aimet_tensorflow.keras.quant_analyzer.QuantAnalyzer | ||
:members: analyze | ||
|
||
Code Examples | ||
============= | ||
|
||
**Required imports** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:lines: 39-47 | ||
|
||
**Prepare toy dataset to run example code** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:start-after: # Step 0. Prepare toy dataset to run example code | ||
:end-before: # End step 0 | ||
|
||
**Prepare forward pass callback** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:start-after: # Step 1. Prepare forward pass callback | ||
:end-before: # End step 1 | ||
|
||
**Prepare eval callback** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:start-after: # Step 2. Prepare eval callback | ||
:end-before: # End step 2 | ||
|
||
**Prepare model** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:start-after: # Step 3. Prepare model | ||
:end-before: # End step 3 | ||
|
||
**Create QuantAnalyzer object** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:start-after: # Step 4. Create QuantAnalyzer object | ||
:end-before: # End step 4 | ||
|
||
**Run QuantAnalyzer** | ||
|
||
.. literalinclude:: ../keras_code_examples/quant_analyzer_code_example.py | ||
:language: python | ||
:start-after: # Step 5. Run QuantAnalyzer | ||
:end-before: # End step 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters