Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions part2_advanced_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"from hls4ml.model.profiling import numerical, get_ymodel_keras\n",
"\n",
"for layer in config['LayerName'].keys():\n",
" config['LayerName'][layer]['Trace'] = True\n",
"hls_model = hls4ml.converters.convert_from_keras_model(\n",
" model, hls_config=config, output_dir='model_1/hls4ml_prj_2', part='xcu250-figd2104-2L-e'\n",
")\n",
"hls4ml.model.profiling.numerical(model=model, hls_model=hls_model, X=X_test[:1000])"
"numerical(model=model, hls_model=hls_model, X=X_test[:1000])"
]
},
{
Expand All @@ -146,7 +148,7 @@
"hls_model = hls4ml.converters.convert_from_keras_model(\n",
" model, hls_config=config, output_dir='model_1/hls4ml_prj_2', part='xcu250-figd2104-2L-e'\n",
")\n",
"hls4ml.model.profiling.numerical(model=model, hls_model=hls_model)\n",
"numerical(model=model, hls_model=hls_model)\n",
"hls4ml.utils.plot_model(hls_model, show_shapes=True, show_precision=True, to_file=None)"
]
},
Expand Down Expand Up @@ -190,7 +192,7 @@
"source": [
"hls_model.compile()\n",
"hls4ml_pred, hls4ml_trace = hls_model.trace(X_test[:1000])\n",
"keras_trace = hls4ml.model.profiling.get_ymodel_keras(model, X_test[:1000])\n",
"keras_trace = get_ymodel_keras(model, X_test[:1000])\n",
"y_hls = hls_model.predict(X_test)"
]
},
Expand Down
6 changes: 4 additions & 2 deletions part6_cnns.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,9 @@
"metadata": {},
"outputs": [],
"source": [
"hls4ml.model.profiling.numerical(model=model, hls_model=hls_model)"
"from hls4ml.model.profiling import numerical\n",
"\n",
"numerical(model=model, hls_model=hls_model)"
]
},
{
Expand Down Expand Up @@ -767,7 +769,7 @@
"metadata": {},
"outputs": [],
"source": [
"hls4ml.model.profiling.numerical(model=qmodel, hls_model=hls_model_q)\n",
"numerical(model=qmodel, hls_model=hls_model_q)\n",
"hls4ml.utils.plot_model(hls_model_q, show_shapes=True, show_precision=True, to_file=None)"
]
},
Expand Down
Loading