Skip to content

Commit

Permalink
Update example_keras_network_editor.ipynb (#1001)
Browse files Browse the repository at this point in the history
Add attribute name to the action of editing an attribute configuration of Conv2D (kernel).
  • Loading branch information
reuvenperetz authored Mar 17, 2024
1 parent 539b592 commit c71fedb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"\n",
" Now let's see how to customize the quantization process for specific layers using MCT's network editor. An `EditRule` is created with a `NodeTypeFilter` targeting the Conv2D layer type.\n",
"\n",
" The action associated with this rule changes the quantization configuration of the weights to 4 bits instead of the default 8 bits. This rule is then included in a list (`edit_rules_list`) which is passed to the `DebugConfig`.\n",
" The action associated with this rule changes the quantization configuration of the 'kernel' attribute to 4 bits instead of the default 8 bits. This rule is then included in a list (`edit_rules_list`) which is passed to the `DebugConfig`.\n",
" \n",
" The `DebugConfig`, with our custom rule, is then used to create a `CoreConfig`. This configuration will be applied when quantizing the model, resulting in the Conv2D layers being quantized using 4 bits while other layers follow the default setting."
],
Expand All @@ -182,7 +182,7 @@
"edit_rules_list = [\n",
" mct.core.network_editor.EditRule(\n",
" filter=mct.core.network_editor.NodeTypeFilter(Conv2D),\n",
" action=mct.core.network_editor.ChangeCandidatesWeightsQuantConfigAttr(weights_n_bits=4)\n",
" action=mct.core.network_editor.ChangeCandidatesWeightsQuantConfigAttr(attr_name='kernel', weights_n_bits=4)\n",
" )\n",
"]\n",
"\n",
Expand Down

0 comments on commit c71fedb

Please sign in to comment.