Skip to content

andreapurgato/dynamicNetworksGpu

Repository files navigation

Project description

This whole project aims to compute the measure used for the dynamic network definition on GPU devices. The purpose of the GPU usage is to accelerate the computation that usually on CPU requires a long time.

In this project actually are implemented the following measures:

  • Pearson correlation coefficient.

Project versions

Pearson Coefficient

There are three different version of the program that computes the pearson correlation coeeficient.

  • Integer Version: takes as input Integer values and the results is composed by a series of files (one per each time instant) that represent the similarity matrices. You can find it in the folder 'pearsonComputationInteger' (Integer Version Folder).
  • Float Version: takes as input Float values and the results is composed by a series of files (one per each time instant) that represent the similarity matrices. You can find it in the folder 'pearsonComputationFloat' (Float Version Folder).
  • Counter Version: takes as input Integer values and the results is composed by the number pairs with the similarity in each interval from -1 to +1 with step 0.1. You can find it in the folder 'pearsonComputationCounter' (Counter Version Folder).

Input Data Format

The input data format accepted by the program is composed by two different text files: one conntaining the values of each node for each time instant and the other containinng some information.

The names of the two files are arbitrary, the important thing is that in the execution phase the right names are given to the program launched.

Node Values File (e.g. named values.txt)

More precisely the format saved in the fali must be as follow:

t0, v0,1, v0,2, v0,3, ... , v0,P
t1, v1,1, v1,2, v1,3, ... , v1,P
t2, v2,1, v2,2, v2,3, ... , v2,P
...
tN, vN,1, vN,2, vN,3, ... , vN,P

Where:

  • N: is the number of time instant of the dataset (number of frames of the video that record the experiments).
  • P: number of input nodes of the network (number of pixels/brain cells given as input of the program).
  • ti: identifier of the time i, which will be the number i.
  • vi,j: value of node j at time instant i.

For each time instant all the values are ordered by nodes, so each node must be represented by a numeric index that indicates the position of the node in the ordering. You can use the ordering you want, the important thing is that the identifiers will be used in the results to refers to the node associated to it.

Node Information File (e.d. named info.txt)

This filemust contain two exact rows an they must be written in the following way:

nodes,P
images,N

Where:

  • N: is the number of time instant of the dataset (number of frames of the video that record the experiments).
  • P: number of input nodes of the network (number of pixels/brain cells given as input of the program).

Compilation

To compile the code you must have installed the CUDA framework, which you can find here. Then enter the folder where you downloaded the code and execute the following command:

nvcc kernel.cu -o pearsonComputation

After this command the executable of the code is generated (some warnings could appear during the compilationof the code).


Execution

To execute the code you have to create the following hierarchy of folder:

root/
  ├── data/                     # Folder where the two input files are copied.
      ├── values.txt       
      └── info.txt
  ├── logs/                     # Folder where the log files are created.
  ├── output/                   # Folder where the output files are created (containing the similarity matrices).
  └── pearsonComputation.exe    # Executable file generated before.

After the folder hierarchy is created you can enter the root folder and execute the following command:

  • Integer and Float versions:
pearsonComputation.exe TW info.txt value.txt P 
  • Counter version:
pearsonComputation.exe TW info.txt values.txt P D

Where:

  • TW: is the size of the Time Window.
  • info.txt: file with the information of the input.
  • values.txt: file with the values of the input.
  • P: number of nodes in the input (same number written in the info file).
  • D: identifiers of the verison of the data (used to differentiate different datasets, not used if you run the program singularly).

Output Format

The otput of the program consists in a set of text files, one per each time instant of the input. Each contains the top half of the similarity matrix computed in the following format:

na, nb, sa,b
na, nc, sa,c
na, nd, sa,d
...
nN, nN, sN,N

Where:

  • ni: is the node number, same order of the input data.
  • si,j: is the similarity between node i and node j.

People Involved

  • Andrea Purgato: Software Engineer, developer of the code available in this repo.
  • Tanya Berger-Wolf: Supervisor of the work available in this repo.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published