NMSIS-NN  Version 1.2.0
NMSIS NN Software Library
Convolutional Neural Network Example
Demonstrates a convolutional neural network (CNN) example with the use of convolution, ReLU activation, pooling and fully-connected functions.
Model definition:
The CNN used in this example is based on CIFAR-10 example from Caffe [1]. The neural network consists of 3 convolution layers interspersed by ReLU activation and max pooling layers, followed by a fully-connected layer at the end. The input to the network is a 32x32 pixel color image, which will be classified into one of the 10 output classes. This example model implementation needs 32.3 KB to store weights, 40 KB for activations and 3.1 KB for storing the im2col data.
Neural Network model definition
Variables Description:
  • conv1_wt, conv2_wt, conv3_wt are convolution layer weight matrices
  • conv1_bias, conv2_bias, conv3_bias are convolution layer bias arrays
  • ip1_wt, ip1_bias point to fully-connected layer weights and biases
  • input_data points to the input image data
  • output_data points to the classification output
  • col_buffer is a buffer to store the im2col output
  • scratch_buffer is used to store the activation data (intermediate layer outputs)
NMSIS DSP Software Library Functions Used:

Refer riscv_nnexamples_cifar10.cpp

[1] https://github.com/BVLC/caffe