Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions part6_cnns.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -737,19 +737,13 @@
"source": [
"# Then the QKeras model\n",
"hls_config_q = hls4ml.utils.config_from_keras_model(qmodel, granularity='name', backend='Vitis')\n",
"hls_config_q['Model']['ReuseFactor'] = 1\n",
"hls_config['Model']['Precision'] = 'ap_fixed<16,6>'\n",
"hls_config_q['LayerName']['output_softmax']['Strategy'] = 'Stable'\n",
"\n",
"plotting.print_dict(hls_config_q)\n",
"\n",
"cfg_q = hls4ml.converters.create_config(backend='Vitis')\n",
"cfg_q['IOType'] = 'io_stream' # Must set this if using CNNs!\n",
"cfg_q['HLSConfig'] = hls_config_q\n",
"cfg_q['KerasModel'] = qmodel\n",
"cfg_q['OutputDir'] = 'quantized_pruned_cnn/'\n",
"cfg_q['XilinxPart'] = 'xcu250-figd2104-2L-e'\n",
"hls_model_q = hls4ml.converters.convert_from_keras_model(\n",
" qmodel, hls_config=hls_config_q, output_dir='quantized_pruned_cnn', backend='Vitis', io_type='io_stream'\n",
")\n",
"\n",
"hls_model_q = hls4ml.converters.keras_to_hls(cfg_q)\n",
"hls_model_q.compile()"
]
},
Expand Down Expand Up @@ -1321,7 +1315,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.11"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Loading