通过Matlab仿真实现了MLP(multilayer perceptron)神经网络的硬件定点计算,其中用CX)RDIC算法实现神经元激活函数(tanh)的计算.分析了计算误差与MLP网络各个部分有限字长的关系,特别是双曲正切型激活函数的误差与CORDIC迭代时输入数据有限字长、中间数据保护位位数以及迭代次数之间的关系,为MLP神经网络计算的硬件算法流程和数据位字长的选择做必要准备.
Fixed point calculation of MLP (multilayer perceptron) neural network, whose active function was based on CORDIC algorithm, was simulated by means of Matlab. The relation between the calculation errors and the bit width of each part of MLP was analyzed. Especially the error curve of tan-sigmoid activation function varying with the bit width of the input data, the protection bit number and iteration number of CORDIC was presented. The conclusions are useful guidelines for hardware implementations of CORDIC and MLP neural network.