With the continuous development of artificial intelligence technology, image classification has become a popular research area. In this field, deep learning techniques are widely used. However, the computational complexity of deep learning techniques is high and requires a large amount of computational resources. To solve this problem, Intel has launched the oneAPI tool suite, which includes tools such as DPC++ programming language, Intel® oneMKL, and Intel® oneTBB, which can help developers to better utilize the hardware gas pedals of Intel architecture.
First, we need to prepare training data and test data. In this example, we will use the MNIST dataset, which is a handwritten digital image dataset containing 60,000 training images and 10,000 test images. We will use the DPC++ programming language to implement the neural network model and use Intel® oneMKL to perform linear algebra calculations.
The following is the code of the neural network model written in DPC++: