Skip to content

Commit

Permalink
first attempt to prune VAE
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoValente3 committed Dec 9, 2021
1 parent 87f8e5d commit 10fdf60
Show file tree
Hide file tree
Showing 138 changed files with 877 additions and 630 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jupyter.jupyterServerType": "local"
}
759 changes: 366 additions & 393 deletions AE.ipynb

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions MNIST_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@ def crop_and_interpolate(self, size_initial, size_final, color_depth):

X_train_flat_zoom = []
X_test_flat_zoom = []

X_train_flat_zoom_int = []
X_test_flat_zoom_int = []

for image in self.x_train:
tmp = scipy.ndimage.zoom(image[bordo:bordo_top, bordo:bordo_top],
size_final/size_initial).flatten()
tmp = (tmp/(256//2**color_depth)).astype(int)
X_train_flat_zoom.append(tmp/2**color_depth)
X_train_flat_zoom_int.append(tmp)

X_train_flat_zoom = np.array(X_train_flat_zoom)
X_train_flat_zoom_int = np.array(X_train_flat_zoom_int)

self.x_train=X_train_flat_zoom

#processing Test Set
Expand All @@ -74,7 +81,10 @@ def crop_and_interpolate(self, size_initial, size_final, color_depth):
size_final/size_initial).flatten()
tmp = (tmp/(256//2**color_depth)).astype(int)
X_test_flat_zoom.append(tmp/2**color_depth)
X_test_flat_zoom_int.append(tmp)

X_test_flat_zoom = np.array(X_test_flat_zoom)
X_test_flat_zoom_int = np.array(X_test_flat_zoom_int)
self.x_test=X_test_flat_zoom


Expand Down
732 changes: 496 additions & 236 deletions VAE.ipynb

Large diffs are not rendered by default.

Binary file modified __pycache__/MNIST_dataset.cpython-38.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion hls4ml_conversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@
"hls_model = hls4ml.converters.convert_from_keras_model(ae_wo_classifier,\n",
" hls_config=config,\n",
" output_dir='model/AE_model/hls4ml_prj',\n",
" part='xcu250-figd2104-2L-e')\n"
" part='xc250-figd2104-2L-e')\n",
" #part='xcvu9p-flgc2104aaz')\n"
]
},
{
Expand Down
Binary file modified images/AE/Accuracy of Autoencoder without classifier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/AE/Latent dimension of Autoencoder without classifier.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/AE/reconstructed images.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified model/AE_model/KERAS_check_best_model.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_best_model_classifier.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_model_w_classifier.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_model_wo_classifier.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_pruned_best_model.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_pruned_best_model_classifier.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_pruned_model_w_classifier.h5
Binary file not shown.
Binary file modified model/AE_model/KERAS_check_pruned_model_wo_classifier.h5
Binary file not shown.
Binary file modified model/AE_model/model_2/KERAS_check_best_model.h5
Binary file not shown.
Binary file modified model/AE_model/model_2/KERAS_check_best_model_weights.h5
Binary file not shown.
Binary file modified model/AE_model/model_2/KERAS_check_model_epoch10.h5
Binary file not shown.
Binary file modified model/AE_model/model_2/KERAS_check_model_epoch20.h5
Binary file not shown.
Binary file modified model/AE_model/model_2/KERAS_check_model_last.h5
Binary file not shown.
Binary file modified model/AE_model/model_2/KERAS_check_model_last_weights.h5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added model/VAE_model/KERAS_check_best_model.h5
Binary file not shown.
Binary file removed model/VAE_model/KERAS_check_model_w_classifier.h5
Binary file not shown.
Binary file removed model/VAE_model/KERAS_check_model_wo_classifier.h5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 10fdf60

Please sign in to comment.