| As one of the basic components of deep learning,artificial neural network algorithm has produced significant influence in the past decades.Since its birth,it has attracted the attention of many researchers and been widely used in various fields.The difference of Bayesian neural network(BNN)lies in that its weights and thresholds are expressed in the form of probability distribution.Compared with the neural network with fixed weights,it is equivalent to the introduction of uncertainty and plays a regularization effect,which is also a manifestation of integrated neural network.Changing the form of weight and threshold into probability distribution brings some advantages to Bayesian neural network,such as preventing overfitting effectively.However,when the BNN network is applied to hardware in engineering applications,it is not easy to implement the traditional digital logic circuit,and it will take up a lot of hardware resources.So finding a reasonable way to represent the weight and threshold of Bayesian neural network has certain value in engineering application.The innovation of this paper lies in the comprehensive design of Bayesian neural network based on probability calculation,and the errors generated in the process of probability calculation are introduced into the Bayesian neural network as its weight and bias.This paper USES Python and Verilog language to implement the neural network system in software and hardware.The research work of this paper is divided into the following three parts,the contents of which are as follows:(1)Design the probability calculation module.The errors in probability calculation are introduced into The Bayesian neural network,which is used as its weight and bias.The process is divided into three parts: forward conversion,probability calculation and backward conversion.On the one hand,using logic gate to calculate multiplication and addition in probability calculation can significantly reduce power and hardware consumption compared with traditional binary algorithm implementation.On the other hand,the probabilistic calculation method has the defect of insufficient accuracy,and the results obtained by the calculation will fluctuate with the expected correct results.By using the inherent error property of probability calculation and collecting the output of probability multiplier for many times,an approximate normal distribution result can be obtained,which will be used as the distributed weight of Bayesian neural network.(2)Architecture design of Bayesian neural network based on probability calculation.In pycharm software platform,Python language is used to build Bayesian neural network in a traditional way,and MNIST data set is used to train it,and weight and threshold parameters are extracted.The inherent error of probabilistic calculation is used to generate the required distributed weights when the network is used for prediction.With the probability computing unit as the core module,the input data and weights are multiplied by probability,and the results are accumulated to complete the design of a single neuron operation circuit.On this basis,the network structure is clarified to complete the establishment of the whole probabilistic computing Bayesian neural network.(3)Conduct probabilistic calculation neuron simulation verification.Verilog language was used to write probabilistic computation-based weight generation module and probabilistic computation neuron to verify the possibility of neuron design on FPGA hardware platform.The simulation results show that the distributed weights generated by probability calculation method can be effectively applied to Bayesian neural network,and the hardware cost can be effectively reduced compared with the traditional method.LUT,the main resource consumption type,is reduced by 86.23%. |