Implement Cross-entropy in parallel

0 0
  • 0 Collaborators

This project uses the heterogeneous computing principle of Intel oneAPI, and can calculate the cross-entropy of the input three-dimensional array as the loss value Loss through CPU serial and GPU parallel calculation, and finally calculate the two-dimensional cross-entropy result. ...learn more

Project status: Under Development

oneAPI

Intel Technologies
DevCloud, oneAPI, DPC++

Links [1]

Overview / Usage

In my project, a three-dimensional matrix x[K][M][N] is randomly generated, where K is the number of samples, M is the number of classifications, N is the number of features, the two-dimensional coordinate array mask[K][N], the weight array weight[K][N], the K dimensions are independent of each other, and the above two-dimensional cross-entropy calculation is done on each face, and the final result is the two-dimensional array loss[K][N].

Methodology / Approach

My code includes two main parts, one is the CPU cross-entropy serial calculation, the other is the GPU cross-entropy parallel calculation, and the rest is the verify function to determine whether the absolute value of the error of the GPU calculation result and the CPU calculation result is within 0.001, and if not, the error is logged. Finally, the performance of the program is measured by time, and the time taken to output the calculation process after the CPU serial and GPU parallel calculations are completed, the smaller the performance, the better the performance.

Technologies Used

This project uses the heterogeneous computing principle of Intel oneAPI to realize the cross-entropy of parallel computing using multiple GPUs.

Comments (0)