|
118 | 118 | "outputs": [],
|
119 | 119 | "source": [
|
120 | 120 | "%matplotlib inline\n",
|
| 121 | + "from hls4ml.model.profiling import numerical, get_ymodel_keras\n", |
| 122 | + "\n", |
121 | 123 | "for layer in config['LayerName'].keys():\n",
|
122 | 124 | " config['LayerName'][layer]['Trace'] = True\n",
|
123 | 125 | "hls_model = hls4ml.converters.convert_from_keras_model(\n",
|
124 | 126 | " model, hls_config=config, output_dir='model_1/hls4ml_prj_2', part='xcu250-figd2104-2L-e'\n",
|
125 | 127 | ")\n",
|
126 |
| - "hls4ml.model.profiling.numerical(model=model, hls_model=hls_model, X=X_test[:1000])" |
| 128 | + "numerical(model=model, hls_model=hls_model, X=X_test[:1000])" |
127 | 129 | ]
|
128 | 130 | },
|
129 | 131 | {
|
|
146 | 148 | "hls_model = hls4ml.converters.convert_from_keras_model(\n",
|
147 | 149 | " model, hls_config=config, output_dir='model_1/hls4ml_prj_2', part='xcu250-figd2104-2L-e'\n",
|
148 | 150 | ")\n",
|
149 |
| - "hls4ml.model.profiling.numerical(model=model, hls_model=hls_model)\n", |
| 151 | + "numerical(model=model, hls_model=hls_model)\n", |
150 | 152 | "hls4ml.utils.plot_model(hls_model, show_shapes=True, show_precision=True, to_file=None)"
|
151 | 153 | ]
|
152 | 154 | },
|
|
190 | 192 | "source": [
|
191 | 193 | "hls_model.compile()\n",
|
192 | 194 | "hls4ml_pred, hls4ml_trace = hls_model.trace(X_test[:1000])\n",
|
193 |
| - "keras_trace = hls4ml.model.profiling.get_ymodel_keras(model, X_test[:1000])\n", |
| 195 | + "keras_trace = get_ymodel_keras(model, X_test[:1000])\n", |
194 | 196 | "y_hls = hls_model.predict(X_test)"
|
195 | 197 | ]
|
196 | 198 | },
|
|
0 commit comments