This is the official public repository of the project "GEM: Gradient Enabled Mutual information", by Luigi Fusco (luigi1.fusco@mail.polimi.it) and Eleonora D'Arnese (eleonora.darnese@polimi.it), supervised by Prof. Marco D. Santambrogio (marco.santambrogio@polimi.it).
This repository contains the source code for the accelerators, jupyter notebooks containing demos, and a small registration framework built for demonstration purposes. Everything has been tested on a ZCU104 Evaluation Kit.
Vivado: 2019.2
Vivado HLS: 2019.2
Python: 3.x.x
The registration framework is written in python3 and expects the following libraries to be installed: numpy, matplotlib, scipy, opencv-python, pydicom, jupyter, ctypes
The submitted zip file contains the folder gem
. The folder can be transferred to a ZCU104 board connected to the network with the command:
rsync -avz <board_username>@<board_ip>:~/jupyter_notebooks/ gem/
The gem
folder already contains the compiled files and the bitstreams ready to be used.
-
Be sure to have Vivado in path (e.g.,
source <path_to_vivado>/settings64.sh
) -
The bitstreams can be generated by running the
gen_all.sh
script. This should create thebuild/assets
subfolder, containing one subfolder for each accelerator.mutual_information
contains the mutual information accelerator,mutual_information_gradient_matrix
contains the mutual information gradient accelerator in the version outputting the gradient matrix for performing the lookup in software. -
At this point the folder containing the whole repository should be moved to the target board. The C++ files containing the reference SW implementations can now be compiled. This can be done by navigating to the framework folder and running
make
.
The sources for the accelerators are found in the metrics
folder. The configuration files are mutual_information_gradient_matrix.hpp
for the gradient accelerators and parzen.hpp
for the mutual information accelerator.
The number of processing elements can be modified by changing the number at line 47
. All powers of 2 up to 64 can be used.
The data type used to perform fractions and logarithms can be changed to fixed point by commenting out line 34
. The number of processing elements can be modified by changing the number at line 35
. All powers of 2 up to 64 can be used.
The demo seen in the presentation video can be run by executing jupyter notebook
in the main directory and opening and running the demo.ipynb
notebook.
The full suite of benchmarks is found in the benchmark.ipynb
notebook.