CPC G06V 10/764 (2022.01) [G06V 10/955 (2022.01)] | 13 Claims |
1. A method of designing a memristor-based naive Bayes classifier, comprising:
S1: constructing a naive Bayes classifier comprising a memristor array of M rows by 2N columns, where M is the number of types outputted by the naive Bayes classifier, N is the number of pixels in a picture, and the pixel value of each pixel is 0 or 1;
S2: selecting a jth training sample corresponding to a jth type from training samples and calculating the number hj,2i-1 of the pixel value of 0 and the number hj,2i of the pixel value of 1 in an ith pixel in the jth training sample, where j=1, 2, . . . , and M, and i=1, 2, . . . , and N; and
S3: applying hj,2i-1 pulses to a memristor Rj,2i-1 in a jth row and a 2i−1th column to modulate the conductance of the memristor Rj,2i-1 and applying hj,2i pulses to a memristor Rj,2i in the jth row and a 2ith column to modulate the conductance of the memristor Rj,2i,
wherein the memristor-based naive Bayes classifier is obtained through S1 to S3,
wherein during modulation, the conductance of each memristor is:
G=a×ln(N1)+b, and
a classification statistical calculation probability corresponding to the memristor and the conductance of the memristor satisfy:
ln P∝−G
wherein G is the conductance of the memristor, N1 is the number of pulses applied to the memristor, P is a conditional probability value corresponding to the memristor, ln P is the classification statistical calculation probability, a is a first fitting parameter, and b is a second fitting parameter.
|