diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-07-30 11:32:26 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-07-30 11:32:26 +0900 |
commit | 05e0ec30a632339a8533082476f27bda31ccde16 (patch) | |
tree | 5f220ac83084fe133ffb08a6a17e99f9bb36ec1c /compiler/pota-quantization-value-test/README.md | |
parent | e2ef8438a24f7c56a0744eb579a6e293ee2fbf8e (diff) | |
download | nnfw-05e0ec30a632339a8533082476f27bda31ccde16.tar.gz nnfw-05e0ec30a632339a8533082476f27bda31ccde16.tar.bz2 nnfw-05e0ec30a632339a8533082476f27bda31ccde16.zip |
Imported Upstream version 1.7.0upstream/1.7.0
Diffstat (limited to 'compiler/pota-quantization-value-test/README.md')
-rw-r--r-- | compiler/pota-quantization-value-test/README.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/compiler/pota-quantization-value-test/README.md b/compiler/pota-quantization-value-test/README.md new file mode 100644 index 000000000..e3359ae4f --- /dev/null +++ b/compiler/pota-quantization-value-test/README.md @@ -0,0 +1,41 @@ +# pota-quantization-value-test + +`pota-quantization-value-test` checks whether a Circle model listed in `test.lst` is correctly quantized (`pota` denotes post-training affine). The circle models are generated from the recipes saved in `res/TensorFlowLiteRecipes`. + +Write `test.local.lst` for local test. + +### Test process + +#### Step 1. Fake quantization + +Run `circle-quantizer` with `--quantize_dequantize_weights` option. + +Dump the fake-quantized model with `circle-tensordump`. + +Compare the dumped model with the expected output in "expected_outputs/<model_name>/\<granularity\>/<quantized_type>/fake_quantization/<tensor_name>.json" + +The expected output should include + (1) values of weights (only for conv, transposed_conv, depthwise_conv, and fc layers) + +#### Step 2. Record moving avg of min and moving avg of max for activations + +Run `record-minmax` with the fake-quantized model (input data is saved in "test_inputs/<model_name>/\<granularity\>/<quantized_type>/<record_number>.txt") + +Dump the minmax-recorded model with `circle-tensordump`. +Compare the dumped model with the expected output in "expected_outputs/<model_name>/\<granularity\>/<quantized_type>/record_minmax/<tensor_name>.json" + +The expected output should include + (1) min/max of activations + +#### Step 3. Quantization + +Run `circle-quantizer` with `--quantize_with_minmax` option. + +Dump the quantized model with `circle-tensordump`. + +Compare the dumped model with the expected output in "expected_outputs/<model_name>/\<granularity\>/<quantized_type>/quantization/<tensor_name>.json" + +The expected output should include + (1) scale, zero point of activations + (2) scale, zero point, values of weights + (3) scale, values (weights) of bias |