Skip to content
Open
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
17 changes: 17 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: enet-script-env
channels:
- conda-forge
- defaults
dependencies:
- python=3.9.5
- pip=23.3.2
- pip:
- git+https://github.com/nicologhielmetti/hls4ml.git@enet#egg=hls4ml[profiling]
- torch==2.1.2
- keras==2.7.0
- numpy==1.26.1
- qkeras==0.9.0
- seaborn==0.13.1
- tensorflow==2.7.1
- tensorflow-datasets==4.9.3
- opencv-python==4.9.0.80
6 changes: 3 additions & 3 deletions generate_y_hls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import hls4ml
import numpy as np
hls4ml_model_path = '/eos/home-n/nghielme/enet-results-run2/results_hls_f8_clk7_rf6_q4_ap_fixed_8-4_/hls_f8_clk7_rf6_q4_ap_fixed_8-4__FIFO_OPT'
hls4ml_model_path = './hls4ml_example_output'
hls_model = hls4ml.converters.convert_from_config(hls4ml_model_path + '/hls4ml_config.yml')
hls_model.compile()
X = np.load('X_test.npy')
X = np.load('./data_pickles/X_test.npy')
y_hls = hls_model.predict(X)
np.save('y_hls.npy', y_hls)
np.save('./data_pickles/y_hls.npy', y_hls)
7 changes: 3 additions & 4 deletions generate_y_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import os
import numpy as np

X = np.load('X_test.npy')
X = np.load('./data_pickles/X_test.npy')
for model in os.listdir('models_h5_run2'):
if model.endswith('.h5'):
keras_model = load_qmodel('models_h5_run2/' + model, compile=False)
y_keras = keras_model(X)
np.save('models_h5_run2/y_keras_' + model[:8] + '.npy')
else:
continue
np.save('models_h5_run2/y_keras_' + model[:8] + '.npy', y_keras)

Loading