Skip to content

Commit

Permalink
Update MobileVit XS tutorial with z threshold parameter (#1093)
Browse files Browse the repository at this point in the history
* Add z threshold to mobilevit_xs tut
  • Loading branch information
lapid92 authored Jun 3, 2024
1 parent 59babd9 commit 3bf6e9a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,11 @@
"tpc = mct.get_target_platform_capabilities(fw_name=\"pytorch\",\n",
" target_platform_name='imx500',\n",
" target_platform_version='v1')\n",
"\n",
"# We adjusted the quantization configuration to match the model, activated the shift negative activation correction, and set the z-threshold to 7.0. This is a general best practice for transformer architectures.\n",
"ptq_config = mct.core.CoreConfig(quantization_config=mct.core.QuantizationConfig(\n",
" shift_negative_activation_correction=True))\n",
" shift_negative_activation_correction=True,\n",
" z_threshold=7.0))\n",
"\n",
"# Perform post training quantization\n",
"quant_model, _ = mct.ptq.pytorch_post_training_quantization(in_module=model,\n",
Expand Down

0 comments on commit 3bf6e9a

Please sign in to comment.