CN115905546A - Graph convolution network document identification device and method based on resistive random access memory - Google Patents

Graph convolution network document identification device and method based on resistive random access memory Download PDF

Info

Publication number
CN115905546A
CN115905546A CN202310017218.7A CN202310017218A CN115905546A CN 115905546 A CN115905546 A CN 115905546A CN 202310017218 A CN202310017218 A CN 202310017218A CN 115905546 A CN115905546 A CN 115905546A
Authority
CN
China
Prior art keywords
layer
quantization
graph convolution
graph
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310017218.7A
Other languages
Chinese (zh)
Other versions
CN115905546B (en
Inventor
高丽丽
时拓
刘琦
顾子熙
张徽
王志斌
李一琪
崔狮雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lab
Original Assignee
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lab filed Critical Zhejiang Lab
Priority to CN202310017218.7A priority Critical patent/CN115905546B/en
Publication of CN115905546A publication Critical patent/CN115905546A/en
Application granted granted Critical
Publication of CN115905546B publication Critical patent/CN115905546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a graph convolution network document identification device and method based on a resistive random access memory, which are used for constructing a training set and a test set of a document identification data set; constructing a floating point graph convolution network model based on a resistive random access memory, and pre-training by using a training set to obtain pre-trained model parameters; constructing a graph convolution network quantification model based on a training phase of the resistive random access memory according to the floating point graph convolution network model; inputting the training set into a graph convolution network quantization model in a training stage, and performing quantization perception training to obtain the truncation bit width of each layer of output values, the weight of a loss function and model parameters after quantization perception training; constructing a graph convolution network quantitative model based on an inference phase of the resistive random access memory according to the graph convolution network quantitative model in the training phase; and mapping the model parameters after the quantitative sensing training to the resistive random access memory, and inputting the test set to a graph volume network quantitative model based on an inference stage of the resistive random access memory to perform forward inference test.

Description

Graph convolution network document identification device and method based on resistive random access memory
Technical Field
The invention relates to the technical field of neural network literature identification, in particular to a graph volume network literature identification device and method based on a resistive random access memory.
Background
With the rapid development of deep learning, the graph convolution network technology has been widely applied to various fields such as text classification, recommendation systems, knowledge graph spectrum completion and the like. These applications typically need to be deployed at the edge device side. In a traditional chip architecture, a memory and a calculation are separated, a calculation unit reads data from the memory first, and the data is stored back to the memory after the calculation is completed. However, in the face of the high concurrency requirement of the neural network, the conventional chip architecture needs to frequently carry data, which results in huge power consumption and computation bottleneck.
The resistive random access memory has the advantages of low power consumption, simple structure, high working speed, controllable and variable resistance value and the like, and can realize various operation forms such as logic operation, matrix multiplication and the like. The characteristic of the resistive random access memory integrating storage can reduce data transportation and reduce storage requirements. Therefore, the resistive random access memory has great potential to solve the problems brought by the traditional chip architecture. In recent years, a graph convolution network accelerator based on a resistive random access memory provides an effective solution for reasoning of a graph convolution network.
Although the resistive random access memory has great advantages for realizing the inference of the graph convolution network, the graph convolution network model needs to be compressed in the implementation process, which causes the loss of precision. The reasonable and effective quantization method can reduce the storage space of data and improve the calculation speed under the condition of low precision loss. Because the conductance range of the resistive random access memory device is limited, a limited bit width is required to store the weight of the graph convolution network. Meanwhile, since the quantization bit width of the output value of the current layer is exceeded after the sub-operation of the graph volume calculation is performed, the output value of the current layer needs to be stored by using the output quantization bit width through truncation operation after the sub-operation of the graph volume calculation is performed. If the truncation bit width of the convolution output value of each layer of the graph is not optimized, the identification precision of the graph convolution network is reduced. Therefore, designing a reasonable and effective quantization method for specific hardware constraints is a difficult problem that researchers in the field need to overcome.
Disclosure of Invention
In order to solve the defects of the prior art, realize the consistency of the truncation bit width and the measuring range of an analog-to-digital converter and reduce the precision loss caused by quantization, the invention adopts the following technical scheme:
a graph convolution network document identification method based on a resistive random access memory comprises the following steps:
step S1: constructing a training set and a test set for a document identification data set;
step S2: constructing a floating point graph convolution network model based on a resistive random access memory, and performing model pre-training by using a training set to obtain pre-trained model parameters;
and step S3: constructing a graph convolution network quantification model based on a training phase of a resistive random access memory according to the floating point graph convolution network model;
and step S4: inputting the training set into a graph convolution network quantization model in a training stage, and performing quantization perception training to obtain a truncation bit width of each layer of output values, a weight of a loss function and model parameters after quantization perception training;
step S5: constructing a graph convolution network quantitative model based on an inference phase of the resistive random access memory according to the graph convolution network quantitative model in the training phase;
step S6: and mapping the model parameters after the quantitative perception training to the resistive random access memory, inputting the test set to a graph convolution network quantitative model based on an inference stage of the resistive random access memory, and performing forward inference test.
Further, the step S4 includes the steps of:
step S4-1: aggregating information of neighbor nodes through a feature aggregation layer for each document node of the training set;
step S4-2: performing quantization operation on the characteristic values of all the training set nodes obtained in the step S4-1 in the characteristic aggregation layer through an activation quantization layer to obtain quantized activation values;
step S4-3: the image convolution kernel is subjected to quantization operation through an image convolution quantization layer to obtain a quantized image convolution kernel, and the image convolution kernel is subjected to inverse quantization operation through an image convolution inverse quantization layer to obtain an inverse quantized image convolution kernel;
step S4-4: carrying out graph convolution operation on the inversely quantized activation value and the inversely quantized graph convolution kernel to obtain an inversely quantized graph convolution output value; obtaining the truncation bit width of the graph convolution output value based on the quantization factor and the quantization value, and in the same way, inversely quantizing the last graph convolution and then obtaining the output of the graph convolution network quantization model in the training stage through a classifier;
step S4-5: and updating network parameters including quantization factors of each layer, truncation bit width of convolution output values of each layer of the graph and weight of the loss function by optimizing the loss function until the network converges to obtain a graph convolution network quantization model after quantization perception training.
Further, the polymerization manner in step S4-1 is: acquiring the characteristics of a fixed number of first-order neighbor nodes of the node in a random sampling mode, cascading the characteristics with the characteristics of the node, then calculating the mean value of the cascaded characteristics in each characteristic dimension to be used as a new characteristic of the node, and obtaining the characteristic values of all training set nodes in a characteristic aggregation layer; the aggregation function is as follows:
Figure 887417DEST_PATH_IMAGE001
(1)
wherein the content of the first and second substances,
Figure 992776DEST_PATH_IMAGE002
representing a target node
Figure 4594DEST_PATH_IMAGE003
The input characteristic value of (2) is,
Figure 624931DEST_PATH_IMAGE004
first order neighbor node representing target node
Figure 747608DEST_PATH_IMAGE005
The input characteristic value of (a) is,
Figure 973053DEST_PATH_IMAGE006
meaning that the target node is concatenated with the input eigenvalues of all first order neighbor nodes,
Figure 952510DEST_PATH_IMAGE007
representing a target node
Figure 528985DEST_PATH_IMAGE003
The characteristic value of the characteristic aggregation layer.
Further, the activation value after quantization in the step S4-2:
Figure 189774DEST_PATH_IMAGE008
(2)
then, carrying out inverse quantization operation by activating an inverse quantization layer, and obtaining an activation value after inverse quantization by a ReLU activation function:
Figure 66463DEST_PATH_IMAGE009
(3)
wherein
Figure 420084DEST_PATH_IMAGE010
Representing the floating-point eigenvalues of all training set nodes at the feature aggregation level,
Figure 218276DEST_PATH_IMAGE011
it is meant to round-off the process,
Figure 739213DEST_PATH_IMAGE012
it is indicated that the operation of truncation is performed,
Figure 673670DEST_PATH_IMAGE014
the minimum value after the quantization is represented by,
Figure 198193DEST_PATH_IMAGE015
the maximum value after the quantization is represented,
Figure 483681DEST_PATH_IMAGE016
a quantization factor representing a floating point value of a training set node feature at a feature aggregation layer.
The graph convolution kernel after quantization in the step S4-3:
Figure 548589DEST_PATH_IMAGE017
(4)
the graph convolution kernel after the dequantization:
Figure 603132DEST_PATH_IMAGE018
(5)
wherein
Figure 298556DEST_PATH_IMAGE019
Representing the graph convolution kernel floating point values,
Figure 602498DEST_PATH_IMAGE011
it is meant to round-off the process,
Figure 674359DEST_PATH_IMAGE012
it is indicated that the operation of truncation is performed,
Figure 583409DEST_PATH_IMAGE014
the minimum value after the quantization is represented by,
Figure 246472DEST_PATH_IMAGE015
the maximum value after the quantization is represented,
Figure 240973DEST_PATH_IMAGE020
representing the quantization factor at which the floating point value is to be accumulated in the graph volume.
Further, in step S4-4, the graph convolution operation is a matrix multiplication operation:
Figure 850946DEST_PATH_IMAGE021
(6)
Figure 676819DEST_PATH_IMAGE022
(7)
wherein, the first and the second end of the pipe are connected with each other,
Figure 448466DEST_PATH_IMAGE023
representing the inverse quantized convolution output value of the graph,
Figure 992580DEST_PATH_IMAGE024
representing the inverse-quantized activation value,
Figure 406244DEST_PATH_IMAGE025
representing the inverse quantized graph convolution kernel,
Figure 24307DEST_PATH_IMAGE026
a graph convolution operation is shown in a graph convolution operation,
Figure 294751DEST_PATH_IMAGE027
representation diagramThe quantization factor of the convolved output values,
Figure 263844DEST_PATH_IMAGE028
a quantized value representing the convolution output value of the graph,
Figure 950041DEST_PATH_IMAGE029
is composed of
Figure 953769DEST_PATH_IMAGE023
Quantization factor of floating point value of training set node characteristic based on characteristic aggregation layer
Figure 129535DEST_PATH_IMAGE016
Quantization factor of the floating point value of the graph convolution kernel
Figure 585924DEST_PATH_IMAGE020
Quantization factor of graph convolution output value
Figure 75811DEST_PATH_IMAGE027
And/or the activation value after quantization
Figure 736643DEST_PATH_IMAGE030
Quantized graph convolution kernel
Figure 552152DEST_PATH_IMAGE031
Quantized value of the output value of the graph convolution
Figure 495838DEST_PATH_IMAGE028
Obtaining the truncation bit width of the graph convolution output value
Figure 523836DEST_PATH_IMAGE032
Obtaining the formula (8) through the formulas (2) - (7)
Figure 33315DEST_PATH_IMAGE033
(8)
In the diagram convolution network quantification model based on the resistive random access memory, floating point values after the last diagram convolution inverse quantification are output through the softmax classifier.
Further, the loss function in step S4-5 is as shown in equations (9) - (12):
Figure 754146DEST_PATH_IMAGE034
(9)
wherein
Figure 185128DEST_PATH_IMAGE035
The node characteristic of the input training set passes through the output value of the ith neuron of the last layer of the graph convolution network model, C is the number of the output neurons, namely the category number of image classification,
Figure 79134DEST_PATH_IMAGE036
representing an output value of the node characteristic of the input training set after passing through the softmax classifier;
Figure 380803DEST_PATH_IMAGE037
(10)
wherein
Figure 538115DEST_PATH_IMAGE038
A value of a tag representing the true value of the input image,
Figure 253130DEST_PATH_IMAGE039
representing cross-entropy loss with the aim of reducing the error between the network output and the correct category of artificial labels;
Figure 888510DEST_PATH_IMAGE040
(11)
wherein, the first and the second end of the pipe are connected with each other,
Figure 310265DEST_PATH_IMAGE041
representing the number of current graph convolution layers in the graph convolution network,
Figure 435215DEST_PATH_IMAGE042
representing the total number of layers of graph convolution in the graph convolution network,
Figure 575210DEST_PATH_IMAGE043
represents the truncated bit width of the current graph convolution output value,
Figure 14281DEST_PATH_IMAGE044
the target truncation bit width representing the convolution output value of the current graph is determined by the measuring range of the analog-to-digital converter;
Figure 352859DEST_PATH_IMAGE045
optimizing the truncation bit width of the convolution output value of each layer of graph learned by the network to keep the truncation bit width consistent with the target truncation bit width;
Figure 851973DEST_PATH_IMAGE046
(12)
wherein
Figure 213684DEST_PATH_IMAGE047
Represent
Figure 190868DEST_PATH_IMAGE039
The weight of (a) is calculated,
Figure 649531DEST_PATH_IMAGE048
represent
Figure 53967DEST_PATH_IMAGE045
The weight of (a) is calculated,
Figure 168554DEST_PATH_IMAGE047
and
Figure 746166DEST_PATH_IMAGE048
are all learnable parameters;
Figure 14597DEST_PATH_IMAGE049
representing an overall loss function of the graph convolution network model; by optimising the loss functionAnd updating the weight parameters of the graph convolution network model, the quantization factors, the truncation bit width of the convolution output value of each layer of the graph, and the weight of the loss function until the network is converged.
Further, the step S6 includes the following steps:
step S6-1: firstly, for each document node of a test set, acquiring the characteristics of neighbor nodes of the node through a neighborhood characteristic extraction layer, and calculating the average value of the characteristics of the neighbor nodes and the characteristics of the neighbor nodes to be used as new characteristics of the node to obtain the new characteristics of all the nodes of the test set;
step S6-2: quantifying the floating point values of the new characteristics of all the test set nodes, then obtaining the quantified value of the activation quantification layer through activation operation, and mapping the quantified value into the voltage value of the resistive random access memory; quantizing the graph convolution kernel of the graph convolution quantization layer, and mapping the well-paid convolution kernel into a conductivity value of the resistive random access memory;
step 6-3: and performing graph convolution operation by adopting a resistive random access memory array, mapping the result of the graph convolution operation to a current value output by the resistive random access memory, converting the current value into a voltage value, sampling the voltage value through an analog-to-digital converter, taking the value obtained by sampling the quantized graph convolution as the input of the next layer of the network, and repeating the steps to obtain the prediction category of image classification according to the output value of the last layer of the graph convolution quantization layer.
Further, in the step S6-2, floating point values of all the node features of the test set are quantized according to the formula (13), and then the quantized values of the activated quantization layer are obtained through the ReLU activation operation
Figure 855514DEST_PATH_IMAGE050
Will be
Figure 254134DEST_PATH_IMAGE050
Mapping the voltage value V to a voltage value V, quantizing the graph convolution kernel of the graph convolution quantization layer learned by the network according to a formula (14) to obtain a quantized convolution kernel
Figure 573120DEST_PATH_IMAGE051
Then will be
Figure 944058DEST_PATH_IMAGE051
Mapping to a conductance value G based on the resistive random access memory;
Figure 752614DEST_PATH_IMAGE052
(13)
Figure 310635DEST_PATH_IMAGE053
(14)
wherein
Figure 698891DEST_PATH_IMAGE054
A floating point value representing the characteristics of all test set nodes,
Figure 721073DEST_PATH_IMAGE019
floating point values representing the graph convolution quantization layer graph convolution kernel,
Figure 638214DEST_PATH_IMAGE016
a quantization factor representing the network learned active layer,
Figure 214689DEST_PATH_IMAGE020
representing the quantization factors of the graph convolution layer of the network learned graph convolution kernel,
Figure 937794DEST_PATH_IMAGE055
a quantized value representing an activated quantized layer,
Figure 17745DEST_PATH_IMAGE051
representing the value of the graph convolution quantization layer after the convolution kernel quantization.
Graph convolution operation using resistive random access memory array
Figure 371366DEST_PATH_IMAGE056
Figure 169558DEST_PATH_IMAGE057
Recording the graph volume as a result of the graph convolution operationThe result of the product operation is mapped to a current value I output from the resistance change memory, the current value is converted into a voltage value,
Figure 634037DEST_PATH_IMAGE058
sampling the voltage value through an analog-to-digital converter, and finally obtaining a value after convolution and quantization of the graph
Figure 630812DEST_PATH_IMAGE059
Taking the maximum value index of the output value of the last graph convolution quantization layer as the type of network prediction;
Figure 155335DEST_PATH_IMAGE060
(15)
wherein the content of the first and second substances,
Figure 175243DEST_PATH_IMAGE059
representing the values of the graph after convolution quantization,
Figure 708993DEST_PATH_IMAGE032
represents the truncated bit width of the graph convolution layer output value learned by the network,
Figure 560274DEST_PATH_IMAGE050
a quantized value representing an activated quantized layer,
Figure 990118DEST_PATH_IMAGE051
representing the value of the graph convolution quantization layer after the convolution kernel quantization.
Further, the floating point map convolution network model structure in step S2 is: input layer → neighborhood feature extraction layer → first convolution layer → first active layer → second convolution layer → second active layer → third convolution layer → softmax layer;
the structure of the graph convolution network quantization model in the step S3 is as follows: input layer → neighborhood feature extraction layer → first activation quantization layer → first activation inverse quantization layer → first graph volume inverse quantization layer → second activation quantization layer → second graph volume inverse quantization layer → second graph volume quantization layer → third activation quantization layer → third graph volume inverse quantization layer → softmax layer.
The structure of the graph convolution network quantization model in the step S5 is as follows: input layer → neighborhood feature extraction layer → first activation quantization layer → first map volume quantization layer → second activation quantization layer → second map volume quantization layer → third activation quantization layer → third map volume quantization layer → softmax layer.
The graph volume network document identification device based on the resistive random access memory comprises a memory and one or more processors, wherein executable codes are stored in the memory, and when the one or more processors execute the executable codes, the graph volume network document identification device based on the resistive random access memory is used for realizing the graph volume network document identification method based on the resistive random access memory.
The invention has the advantages and beneficial effects that:
aiming at specific hardware constraint, the invention learns the weight parameter, the quantization factor, the weight of the loss function and the truncation bit width of the convolution layer output value of each layer of the graph through a graph convolution network quantization model by combining a new loss function, the limited range of the conductance of the resistive random access memory and the fixed range of the analog-to-digital converter, so that the weight parameter, the quantization factor, the weight of the loss function and the truncation bit width of the convolution layer output value of each layer of the graph are kept consistent with the range of the analog-to-digital converter, and the precision loss caused by quantization is reduced. For the cora literature identification dataset, the quantization precision of 8 to 4 bits is almost lossless compared with the floating point precision.
Drawings
FIG. 1 is a flow chart of a method in an embodiment of the invention.
Fig. 2 is a partial network relationship diagram between documents in the embodiment of the present invention.
Fig. 3 is a diagram of a resistive random access memory crossbar array in an embodiment.
FIG. 4 is a schematic diagram of the apparatus of the present invention.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present invention, are given by way of illustration and explanation only, not limitation.
As shown in fig. 1, an example of an implementation of the present invention is the identification of a cora document identification data set. The documents in the data set have seven categories, and the categories of the documents are respectively based on cases, genetic algorithms, neural networks, probabilistic methods, reinforcement learning, rule learning and theories. Each document is cited or cited by at least one other document in the corpus. There are 2708 documents in the entire corpus, 5429 sides, and each document has 1433 unique words as features associated with the document. Fig. 2 shows a partial network relationship diagram between documents, and numbers in the diagram represent indexes of the documents.
The invention provides a literature identification device and method based on a resistive random access memory, which comprises the following steps:
step S1: and constructing a training set and a test set for the document identification data set, selecting 1208 documents as the training set, and randomly selecting 500 documents as the test set from the rest documents.
Step S2: constructing a floating point graph convolution network model based on a resistive random access memory, and performing model pre-training by using a training set to obtain pre-trained model parameters;
the specific floating point image convolution network model structure is as follows: input layer → neighborhood feature extraction layer → first convolution layer → first active layer → second convolution layer → second active layer → third convolution layer → softmax layer. And carrying out model pre-training by using the training set to obtain pre-trained model parameters. The size of the weight parameter for each layer is set as follows:
the size of the input layer is
Figure 762902DEST_PATH_IMAGE061
A first graph convolution layer having a parameter of size
Figure 631501DEST_PATH_IMAGE062
Second graph convolution layer, convolution kernel parameterThe size of the number is
Figure 540551DEST_PATH_IMAGE063
A third graph convolution layer with convolution kernel parameters of size
Figure 412736DEST_PATH_IMAGE064
And step S3: constructing a graph convolution network quantification model based on a training phase of a resistive random access memory according to the floating point graph convolution network model;
the specific graph convolution network quantization model structure is as follows: input layer → neighborhood feature extraction layer → first activation quantization layer → first activation inverse quantization layer → first graph volume inverse quantization layer → second activation quantization layer → second graph volume inverse quantization layer → second graph volume quantization layer → third activation quantization layer → third graph volume inverse quantization layer → softmax layer. The size of the weight parameter for each layer is set as follows:
the size of the input layer is
Figure 407236DEST_PATH_IMAGE061
A first graph convolution quantization layer with a graph convolution kernel parameter of size
Figure 79526DEST_PATH_IMAGE062
A second graph convolution quantization layer with convolution kernel parameters of size
Figure 108662DEST_PATH_IMAGE063
A third graph convolution quantization layer with convolution kernel parameters of size
Figure 880309DEST_PATH_IMAGE064
And step S4: inputting the training set into a graph convolution network quantization model in a training stage, and performing quantization perception training to obtain a truncation bit width of each layer of output values, a weight of a loss function and model parameters after quantization perception training;
the quantization bit width of the present embodiment is 8 bit,4 bit, 3 bit,2 bit. To [ -128,127] for 8-bit quantization, to [ -8,7] for 4-bit quantization, to [ -4,3] for 3-bit quantization, and to [ -2,1] for 2-bit quantization. The method comprises the following specific steps:
step S4-1: aggregating information of neighbor nodes through a feature aggregation layer for each document node of the training set;
the specific polymerization mode is as follows: acquiring the characteristics of a fixed number of first-order neighbor nodes of the node in a random sampling mode, cascading the characteristics with the characteristics of the node, then calculating the mean value of the cascaded characteristics in each characteristic dimension to be used as a new characteristic of the node, and obtaining the characteristic values of all training set nodes in a characteristic aggregation layer; the aggregation function is shown in equation (1):
Figure 424423DEST_PATH_IMAGE001
(1)
wherein, the first and the second end of the pipe are connected with each other,
Figure 838087DEST_PATH_IMAGE002
representing a target node
Figure 721729DEST_PATH_IMAGE003
The input characteristic value of (2) is,
Figure 664277DEST_PATH_IMAGE004
first order neighbor node representing target node
Figure 633370DEST_PATH_IMAGE005
The input characteristic value of (2) is,
Figure 647463DEST_PATH_IMAGE006
meaning that the target node is concatenated with the input eigenvalues of all first-order neighbor nodes,
Figure 385611DEST_PATH_IMAGE007
representing a target node
Figure 764640DEST_PATH_IMAGE003
The characteristic value of the characteristic aggregation layer.
Step S4-2: the characteristic values of all the training set nodes obtained in the step S4-1 in the characteristic aggregation layer are quantized through the activation quantization layer to obtain quantized activation values
Figure 221029DEST_PATH_IMAGE030
As shown in formula (2), performing inverse quantization operation by the first active inverse quantization layer, and obtaining the active value after inverse quantization by the ReLU activation function
Figure 773233DEST_PATH_IMAGE024
As shown in equation (3);
Figure 631468DEST_PATH_IMAGE008
(2)
wherein
Figure 181398DEST_PATH_IMAGE010
Floating-point eigenvalues representing all training set nodes at the feature aggregation level,
Figure 656242DEST_PATH_IMAGE011
it is meant to round-off the process,
Figure 215399DEST_PATH_IMAGE012
it is indicated that the operation of truncation is performed,
Figure 928140DEST_PATH_IMAGE014
which represents the minimum value after the quantization and,
Figure 648971DEST_PATH_IMAGE015
representing the maximum value after quantization.
Figure 876690DEST_PATH_IMAGE016
Expressing trainingAnd refining the quantization factor of the floating point value of the node characteristic.
Figure 973959DEST_PATH_IMAGE065
(3)
Step S4-3: performing quantization operation on the graph convolution kernel through a graph convolution quantization layer to obtain a quantized graph convolution kernel, and performing inverse quantization operation on the graph convolution kernel through a graph convolution inverse quantization layer to obtain an inverse quantized graph convolution kernel;
obtaining the graph convolution kernel after quantization as shown in formula (4)
Figure 806786DEST_PATH_IMAGE031
Performing inverse quantization operation by the first graph convolution inverse quantization layer, as shown in formula (5), to obtain graph convolution kernel after inverse quantization
Figure 964098DEST_PATH_IMAGE025
Figure 407675DEST_PATH_IMAGE017
(4)
Figure 308635DEST_PATH_IMAGE018
(5)
Step S4-4: inverse quantizing the activation value
Figure 995968DEST_PATH_IMAGE024
And inverse quantized graph convolution kernel
Figure 58602DEST_PATH_IMAGE025
Performing graph convolution operation to obtain inverse quantized graph convolution output value
Figure 995334DEST_PATH_IMAGE023
Figure 434405DEST_PATH_IMAGE020
Representing graph convolution kernelsThe quantization factor of (a);
as shown in formula (6), wherein
Figure 976245DEST_PATH_IMAGE026
Representing graph convolution operations, i.e., matrix multiplication operations;
Figure 209780DEST_PATH_IMAGE021
(6)
Figure 633808DEST_PATH_IMAGE022
(7)
Figure 876571DEST_PATH_IMAGE033
(8)
equation (8) can be derived from equations (2) - (7), wherein,
Figure 272917DEST_PATH_IMAGE027
a quantization factor representing the output value of the graph convolution,
Figure 942933DEST_PATH_IMAGE028
a quantized value representing the output value of the graph convolution,
Figure 791940DEST_PATH_IMAGE029
is composed of
Figure 635131DEST_PATH_IMAGE023
Figure 885984DEST_PATH_IMAGE032
Representing the truncated bit width of the first graph convolution output value.
And obtaining the truncation bit width of the graph convolution output value based on the quantization factor and the quantization value, and in the same way, inversely quantizing the last graph convolution by using the floating point value, and obtaining the output of the graph convolution network quantization model in the training stage through the classifier.
Step S4-5: and updating network parameters including quantization factors of each layer, truncation bit width of convolution output values of each layer of the graph and weight of the loss function by optimizing the loss function until the network converges to obtain a graph convolution network quantization model after quantization perception training.
The specific loss functions are shown in equations (9) - (12):
Figure 726901DEST_PATH_IMAGE034
(9)
wherein
Figure 859942DEST_PATH_IMAGE035
The node characteristic representing the input training set passes through the output value of the ith neuron of the last layer of the graph convolution network model, C is the number of the output neurons, namely the classified category number,
Figure 444507DEST_PATH_IMAGE036
and (4) representing the output value of the node feature of the input training set after passing through the softmax classifier.
Figure 549867DEST_PATH_IMAGE037
(10)
Wherein
Figure 358423DEST_PATH_IMAGE038
A value of a tag representing the true value of the input image,
Figure 447601DEST_PATH_IMAGE039
represents cross-entropy loss with the goal of reducing the error between the network output and the correct category of artificial labeling.
Figure 304699DEST_PATH_IMAGE040
(11)
Wherein, the first and the second end of the pipe are connected with each other,
Figure 795723DEST_PATH_IMAGE041
representing the number of layers of the current graph convolution in the graph convolution network,
Figure 775180DEST_PATH_IMAGE042
representing the total number of layers of graph convolution in the graph convolution network,
Figure 86076DEST_PATH_IMAGE043
represents the truncated bit width of the current graph convolution output value,
Figure 752724DEST_PATH_IMAGE044
the target truncation bit width representing the convolution output value of the current diagram is determined by the range of the analog-to-digital converter.
Figure 894992DEST_PATH_IMAGE045
The truncation bit width of the convolution output value of each layer of graph learned by the network is optimized, so that the truncation bit width is consistent with the target truncation bit width.
Figure 983034DEST_PATH_IMAGE046
(12)
Wherein
Figure 781226DEST_PATH_IMAGE047
To represent
Figure 308022DEST_PATH_IMAGE039
The weight of (a) is calculated,
Figure 508059DEST_PATH_IMAGE048
to represent
Figure 767002DEST_PATH_IMAGE045
The weight of (a) is calculated,
Figure 52490DEST_PATH_IMAGE047
and
Figure 382977DEST_PATH_IMAGE048
are all learnable parameters.
Figure 437521DEST_PATH_IMAGE066
The overall loss function of the graph convolution network model is represented. By optimizing the lossAnd (4) losing functions, updating weight parameters and quantization factors of the graph convolution network model, and truncating bit width of each layer of graph convolution output values until the network is converged.
Step S5: constructing a graph convolution network quantization model of an inference stage based on the resistive random access memory according to the graph convolution network quantization model of the training stage;
the specific graph convolution network quantization model structure is as follows: the input layer → the neighborhood feature extraction layer → the first activation quantization layer → the first volume quantization layer → the second activation quantization layer → the second volume quantization layer → the third activation quantization layer → the third volume quantization layer → the softmax layer.
Step S6: and mapping the model parameters after the quantitative perception training to the resistive random access memory, inputting the test set to a graph convolution network quantitative model based on an inference stage of the resistive random access memory, and performing forward inference test.
As shown in fig. 3, V represents a voltage value, G represents a conductance value, and I represents a current value, and the specific steps are as follows:
step S6-1: firstly, for each document node of a test set, acquiring the characteristics of neighbor nodes of the node through a neighborhood characteristic extraction layer, and calculating the average value of the characteristics of the neighbor nodes and the characteristics of the neighbor nodes to be used as new characteristics of the node to obtain the new characteristics of all the nodes of the test set;
step S6-2: quantizing the floating point values of the new characteristics of all the nodes of the test set, then obtaining a quantized value of an activation quantization layer through activation operation, and mapping the quantized value into a voltage value of the resistive random access memory; quantizing the graph convolution kernel of the graph convolution quantization layer, and mapping the well-paid convolution kernel into a conductivity value of the resistive random access memory;
specifically, the new features of all the nodes in the test set pass through a first activation quantization layer and a first graph convolution quantization layer to obtain a value after convolution quantization of a first graph
Figure 867365DEST_PATH_IMAGE059
. The quantization method is shown in equations (13) to (15):
Figure 640149DEST_PATH_IMAGE052
(13)
Figure 508748DEST_PATH_IMAGE053
(14)
wherein
Figure 152219DEST_PATH_IMAGE054
A floating point value representing the characteristics of all test set nodes,
Figure 284123DEST_PATH_IMAGE019
a floating point value representing a convolution kernel of the first graph volume quantization layer graph,
Figure 75362DEST_PATH_IMAGE016
a quantization factor representing the first active layer learned by the network,
Figure 950914DEST_PATH_IMAGE020
a quantization factor representing a first graph convolution layer learned by the network,
Figure 448891DEST_PATH_IMAGE055
representing the quantized values of the first activated quantization layer.
Figure 548434DEST_PATH_IMAGE051
Representing the quantized values of the first map convolution quantization layer map convolution kernel.
Quantizing the floating point values of all the node characteristics of the test set according to a formula (13), and then obtaining the quantized value of the first activation quantization layer through the ReLU activation operation
Figure 30231DEST_PATH_IMAGE050
Will be
Figure 443895DEST_PATH_IMAGE050
Mapped to a voltage value. Quantizing the graph convolution kernel of the first graph convolution quantization layer learned by the network according to the formula (14) to obtain a quantized convolution kernel
Figure 61958DEST_PATH_IMAGE051
. Then will be
Figure 535665DEST_PATH_IMAGE051
The mapping is based on the conductance value of the resistive random access memory.
Step 6-3: and performing graph convolution operation by adopting a resistive random access memory array, mapping the result of the graph convolution operation to a current value output by the resistive random access memory, converting the current value into a voltage value, sampling the voltage value through an analog-to-digital converter, taking the value obtained by sampling the quantized graph convolution as the input of the next layer of the network, and repeating the steps to obtain the prediction category of image classification according to the output value of the last layer of the graph convolution quantization layer.
Figure 301495DEST_PATH_IMAGE060
(15)
Figure 253271DEST_PATH_IMAGE032
Indicating the truncation bit width of the first graph convolution layer output value learned by the network.
Specifically, a resistive random access memory array is used for graph convolution operation
Figure 821498DEST_PATH_IMAGE056
Figure 262843DEST_PATH_IMAGE057
Is recorded as the result of the graph convolution operation. And mapping the result of the graph convolution operation to a current value output by the resistive random access memory, and converting the current value into a voltage value.
Figure 719233DEST_PATH_IMAGE058
Sampling the voltage value through an analog-to-digital converter to obtain a value after convolution and quantization of a first graph
Figure 209120DEST_PATH_IMAGE059
As input to the next layer of the network. By parity of reasoning, obtainAnd taking the index of the maximum value of the output value of the last layer of graph convolution quantization layer as the category of the network prediction.
The effect of the present invention is further explained by combining the simulation experiment as follows:
1. simulation conditions are as follows:
the simulation experiment of the invention is carried out under the hardware environment of NVIDIA GV100 and the software environment of Pytrch 1.5.
2. Simulation content and result analysis:
the invention carries out literature identification on the cora literature identification data set through the graph convolution network. The invention respectively uses a graph convolution floating point model, an 8 bit quantization model, a 4 bit quantization model, a 3 bit quantization model and a 2 bit quantization model to identify the cora test set. Table 1 shows the average recognition accuracy of the test set and the truncation bit width of the output value of the first layer graph convolution layer after the convergence of the network model
Figure 864092DEST_PATH_IMAGE067
Truncation bit width of the second layer map convolution layer output value
Figure 414022DEST_PATH_IMAGE068
Loss function
Figure 357707DEST_PATH_IMAGE069
Weight of (2)
Figure 651285DEST_PATH_IMAGE070
Loss function
Figure 364026DEST_PATH_IMAGE071
Weight of (2)
Figure 147175DEST_PATH_IMAGE072
. The range of the analog-to-digital converter of the present embodiment is
Figure DEST_PATH_IMAGE073
I.e., 0.03125, it can be seen that after the above network model converges,
Figure 578156DEST_PATH_IMAGE067
and
Figure 675425DEST_PATH_IMAGE068
very close to the range of the analog-to-digital converter. Meanwhile, the average test precision of the 8-bit quantization model and the average test precision of the 4-bit quantization model are basically consistent with the average test precision of the floating point model, the average test precision of the 3-bit quantization model is 3% lower than the average test precision of the floating point model, and the average test precision of the 2-bit quantization model is 8.9% lower than the average test precision of the floating point model, so that the loss of the quantization precision is low when the quantization bit width is 3-8 bits, and the method can achieve good effect on document identification application of the core data set.
Table 1 comparison table of average identification precision of floating point model and low bit quantization model to test set
Figure 304990DEST_PATH_IMAGE074
In summary, the invention provides a graph convolution network document identification device and method based on a resistive random access memory, which are applied to various fields such as text classification, recommendation systems, knowledge graph spectrum compensation and the like, aiming at specific hardware constraints. The method combines the characteristics of limited conductance range of the resistive random access memory and fixed range of the analog-to-digital converter, and learns the weight parameters, the quantization factors, the weight of the loss function and the truncation bit width of the output value of each layer of graph convolution layer through the graph convolution network model, so that the weight parameters, the quantization factors, the weight of the loss function and the truncation bit width of each layer of graph convolution layer are consistent with the range of the analog-to-digital converter, and the precision loss caused by quantization is reduced. For the cora literature identification data set, 3 bit to 8 bit quantization models can achieve good effects.
Corresponding to the embodiment of the graph convolution network document identification method based on the resistive random access memory, the invention also provides an embodiment of a graph convolution network document identification device based on the resistive random access memory.
Referring to fig. 4, the apparatus for identifying a literature of a resistance change memory-based graph volume network provided by an embodiment of the present invention includes a memory and one or more processors, where the memory stores executable codes, and when the one or more processors execute the executable codes, the apparatus is configured to implement the method for identifying a literature of a resistance change memory-based graph volume network in the above embodiment.
The embodiment of the graph convolution network document identification device based on the resistive random access memory can be applied to any equipment with data processing capability, such as computers and other equipment or devices. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for running through the processor of any device with data processing capability. In terms of hardware, as shown in fig. 4, the diagram is a hardware structure diagram of an arbitrary device with data processing capability where the apparatus is located based on the graph convolution network document identification of the resistive random access memory according to the present invention, and besides the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the arbitrary device with data processing capability where the apparatus is located in the embodiment may also include other hardware according to the actual function of the arbitrary device with data processing capability, which is not described again.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement without inventive effort.
The embodiment of the invention also provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the method for identifying the literature of the graph volume network based on the resistive random access memory in the above embodiment is implemented.
The computer readable storage medium may be an internal storage unit, such as a hard disk or a memory, of any data processing capability device described in any of the foregoing embodiments. The computer readable storage medium may also be any external storage device of a device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the computer readable storage medium may include both an internal storage unit and an external storage device of any data processing capable device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the arbitrary data processing capable device, and may also be used for temporarily storing data that has been output or is to be output.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A graph convolution network document identification method based on a resistive random access memory is characterized by comprising the following steps:
step S1: constructing a training set and a test set for a document identification data set;
step S2: constructing a floating point graph convolution network model based on a resistive random access memory, and performing model pre-training by using a training set to obtain pre-trained model parameters;
and step S3: constructing a graph convolution network quantification model based on a training phase of the resistive random access memory according to the floating point graph convolution network model;
and step S4: inputting the training set into a graph convolution network quantization model in a training stage, and performing quantization perception training to obtain a truncation bit width of each layer of output values, a weight of a loss function and model parameters after quantization perception training;
step S5: constructing a graph convolution network quantization model of an inference stage based on the resistive random access memory according to the graph convolution network quantization model of the training stage;
step S6: and mapping the model parameters after the quantitative perception training to the resistive random access memory, inputting the test set to a graph convolution network quantitative model based on an inference stage of the resistive random access memory, and performing forward inference test.
2. The graph convolution network document identification method based on the resistive random access memory according to claim 1, characterized in that: the step S4 includes the steps of:
step S4-1: for each document node of the training set, aggregating the information of neighbor nodes through a feature aggregation layer;
step S4-2: performing quantization operation on the characteristic values of all the training set nodes in the characteristic aggregation layer obtained in the step S4-1 through an activation quantization layer to obtain activation values after quantization;
step S4-3: carrying out quantization operation on the graph convolution kernel through a graph convolution quantization layer to obtain a quantized graph convolution kernel, and carrying out inverse quantization operation on the graph convolution kernel through a graph convolution inverse quantization layer to obtain an inverse quantized graph convolution kernel;
step S4-4: carrying out the graph convolution operation on the activation value after the inverse quantization and the graph convolution kernel after the inverse quantization to obtain a graph convolution output value after the inverse quantization; obtaining the truncation bit width of the graph convolution output value based on the quantization factor and the quantization value, and in the same way, inversely quantizing the last graph convolution and then obtaining the output of the graph convolution network quantization model in the training stage through a classifier;
step S4-5: and updating network parameters including quantization factors of each layer, truncation bit width of a convolution output value of each layer and weight of the loss function by optimizing the loss function until the network converges to obtain a convolution network quantization model after quantization perception training.
3. The method for identifying the graph convolution network literature based on the resistive random access memory according to claim 2, wherein the method comprises the following steps: the polymerization mode in the step S4-1 is as follows: acquiring the characteristics of a fixed number of first-order neighbor nodes of the node in a random sampling mode, cascading the characteristics with the characteristics of the node, then calculating the mean value of the cascaded characteristics in each characteristic dimension to be used as a new characteristic of the node, and obtaining the characteristic values of all training set nodes in a characteristic aggregation layer; the aggregation function is as follows:
Figure 487560DEST_PATH_IMAGE001
(1)
wherein, the first and the second end of the pipe are connected with each other,
Figure 201439DEST_PATH_IMAGE002
representing a target node
Figure 512334DEST_PATH_IMAGE003
The input characteristic value of (2) is,
Figure 641964DEST_PATH_IMAGE004
first order neighbor node representing target node
Figure 987495DEST_PATH_IMAGE005
The input characteristic value of (2) is,
Figure 341116DEST_PATH_IMAGE006
meaning that the target node is concatenated with the input eigenvalues of all first order neighbor nodes,
Figure 404887DEST_PATH_IMAGE007
representing a target node
Figure 134945DEST_PATH_IMAGE003
The characteristic value of the characteristic aggregation layer.
4. The graph convolution network document identification method based on the resistive random access memory according to claim 2, characterized in that: the activation value after quantization in step S4-2:
Figure 538245DEST_PATH_IMAGE008
(2)
then, carrying out inverse quantization operation by activating an inverse quantization layer, and obtaining an activation value after inverse quantization by a ReLU activation function:
Figure 328346DEST_PATH_IMAGE009
(3)
wherein
Figure 613834DEST_PATH_IMAGE010
Representing the floating-point eigenvalues of all training set nodes at the feature aggregation level,
Figure 882004DEST_PATH_IMAGE011
it is meant to round-off the process,
Figure 139811DEST_PATH_IMAGE012
it is indicated that the operation of truncation is performed,
Figure 366392DEST_PATH_IMAGE013
which represents the minimum value after the quantization and,
Figure 139176DEST_PATH_IMAGE014
the maximum value after the quantization is represented,
Figure 148721DEST_PATH_IMAGE015
a quantization factor representing a floating point value of a training set node feature at a feature aggregation layer;
the graph convolution kernel after quantization in the step S4-3:
Figure 588929DEST_PATH_IMAGE016
(4)
the graph convolution kernel after the dequantization:
Figure 658517DEST_PATH_IMAGE017
(5)
wherein
Figure 918597DEST_PATH_IMAGE018
Representing the graph convolution kernel floating point values,
Figure 794149DEST_PATH_IMAGE011
it is meant to round-off the process,
Figure 823285DEST_PATH_IMAGE012
it is indicated that the operation of truncation is performed,
Figure 329352DEST_PATH_IMAGE013
the minimum value after the quantization is represented by,
Figure 76728DEST_PATH_IMAGE014
the maximum value after the quantization is represented,
Figure 490392DEST_PATH_IMAGE019
representing the quantization factor at which the floating point value is rolled up in the graph.
5. The graph convolution network document identification method based on the resistive random access memory according to claim 2, characterized in that: in step S4-4, the graph convolution operation is a matrix multiplication operation:
Figure 577297DEST_PATH_IMAGE020
(6)
Figure 316583DEST_PATH_IMAGE021
(7)
wherein the content of the first and second substances,
Figure 285676DEST_PATH_IMAGE022
representing the inverse quantized convolution output value of the graph,
Figure 440714DEST_PATH_IMAGE023
representing the inverse-quantized activation value,
Figure 444442DEST_PATH_IMAGE024
representing the inverse quantized graph convolution kernel,
Figure 354629DEST_PATH_IMAGE025
a graph convolution operation is shown in a graph convolution operation,
Figure 811018DEST_PATH_IMAGE026
a quantization factor representing the output value of the graph convolution,
Figure 769747DEST_PATH_IMAGE027
a quantized value representing the output value of the graph convolution,
Figure 627981DEST_PATH_IMAGE028
is composed of
Figure 443491DEST_PATH_IMAGE022
Quantization factor of floating point value of training set node characteristic based on characteristic aggregation layer
Figure 590438DEST_PATH_IMAGE015
Quantization factor of the floating point value of the graph convolution kernel
Figure 149595DEST_PATH_IMAGE019
Quantization factor of graph convolution output value
Figure 127916DEST_PATH_IMAGE026
And/or the activation value after quantization
Figure 52009DEST_PATH_IMAGE029
Quantized graph convolution kernel
Figure 748570DEST_PATH_IMAGE030
Quantized value of the convolution output value
Figure 845839DEST_PATH_IMAGE027
Obtaining the truncation bit width of the output value of the graph convolution
Figure 881928DEST_PATH_IMAGE031
Obtaining the formula (8) through the formulas (2) - (7)
Figure 39240DEST_PATH_IMAGE032
(8)
In the diagram convolution network quantification model based on the resistive random access memory, floating point values after the last diagram convolution inverse quantification are output through the softmax classifier.
6. The graph convolution network document identification method based on the resistive random access memory according to claim 2, characterized in that: the loss function in step S4-5 is shown in equations (9) - (12):
Figure 957517DEST_PATH_IMAGE033
(9)
wherein, the node characteristic of the input training set passes through the output value of the ith neuron of the last layer of the graph convolution network model, C is the number of the output neurons, namely the class number of the image classification,
Figure 61740DEST_PATH_IMAGE034
representing an output value of the node characteristic of the input training set after passing through the softmax classifier;
Figure 483494DEST_PATH_IMAGE035
(10)
wherein
Figure 77286DEST_PATH_IMAGE036
A value of a tag representing the true value of the input image,
Figure 420543DEST_PATH_IMAGE037
represents the cross entropy loss;
Figure 125194DEST_PATH_IMAGE038
(11)
wherein, the first and the second end of the pipe are connected with each other,
Figure 932613DEST_PATH_IMAGE039
representing the number of layers of the current graph convolution in the graph convolution network,
Figure 431727DEST_PATH_IMAGE040
representing the total number of layers of graph convolution in the graph convolution network,
Figure 262280DEST_PATH_IMAGE041
represents the truncated bit width of the current graph convolution output value,
Figure 770622DEST_PATH_IMAGE042
a target truncation bit width representing a current graph convolution output value;
Figure 166968DEST_PATH_IMAGE043
optimizing the truncation bit width of the convolution output value of each layer of graph learned by the network to keep the truncation bit width consistent with the target truncation bit width;
Figure 40246DEST_PATH_IMAGE044
(12)
wherein
Figure 420412DEST_PATH_IMAGE045
To represent
Figure 201286DEST_PATH_IMAGE037
The weight of (a) is calculated,
Figure 920980DEST_PATH_IMAGE046
to represent
Figure 761897DEST_PATH_IMAGE043
The weight of (a) is calculated,
Figure 629359DEST_PATH_IMAGE045
and
Figure 417186DEST_PATH_IMAGE046
are all learnable parameters;
Figure 788125DEST_PATH_IMAGE047
representing an overall loss function of the graph convolution network model; by optimizing the loss function, the weight parameter, the quantization factor, the truncation bit width of the convolution output value of each layer of the graph and the weight of the loss function are updated until the network is converged.
7. The graph convolution network document identification method based on the resistive random access memory according to claim 1, characterized in that: in the step S6, the method includes the following steps:
step S6-1: firstly, for each document node of a test set, acquiring the characteristics of neighbor nodes of the node through a neighborhood characteristic extraction layer, and calculating the average value of the characteristics of the neighbor nodes and the characteristics of the neighbor nodes to be used as new characteristics of the node to obtain the new characteristics of all the nodes of the test set;
step S6-2: quantizing the floating point values of the new characteristics of all the nodes of the test set, then obtaining a quantized value of an activation quantization layer through activation operation, and mapping the quantized value into a voltage value of the resistive random access memory; quantizing a graph convolution kernel of a graph convolution quantization layer, and mapping the quantized convolution kernel to a conductance value of the resistive random access memory;
step 6-3: the method comprises the steps of performing graph convolution operation by adopting a resistive random access memory array, mapping a result of the graph convolution operation to a current value output by the resistive random access memory, converting the current value into a voltage value, sampling the voltage value through an analog-to-digital converter, taking a value obtained by sampling after graph convolution quantization as input of a next layer of a network, and repeating the steps in sequence to obtain a prediction type of image classification according to an output value of a last layer of graph convolution quantization layer.
8. The graph convolution network document identification method based on the resistive random access memory is characterized in that: in the step S6-2, floating point values of all the node characteristics of the test set are quantized according to a formula (13), and then the quantized values of the activated quantization layer are obtained through ReLU activation operation
Figure 65523DEST_PATH_IMAGE048
Will be
Figure 889122DEST_PATH_IMAGE049
Mapping the voltage value V to a voltage value V, quantizing the graph convolution kernel of the graph convolution quantization layer learned by the network according to a formula (14) to obtain a quantized convolution kernel
Figure 480640DEST_PATH_IMAGE050
Then will be
Figure 971665DEST_PATH_IMAGE050
Mapping to a conductance value G based on the resistive random access memory;
Figure 154384DEST_PATH_IMAGE051
(13)
Figure 934121DEST_PATH_IMAGE052
(14)
wherein
Figure 860489DEST_PATH_IMAGE053
A floating point value representing the characteristics of all test set nodes,
Figure 206020DEST_PATH_IMAGE018
floating point values representing the graph convolution quantization layer graph convolution kernel,
Figure 28482DEST_PATH_IMAGE015
a quantization factor representing the network learned active layer,
Figure 826674DEST_PATH_IMAGE019
representing the quantization factors of the network learned graph convolution kernel,
Figure 822312DEST_PATH_IMAGE054
representing the quantized values of the active quantization layer,
Figure 960032DEST_PATH_IMAGE050
representing a value quantized by a graph convolution quantization layer graph convolution kernel;
graph convolution operation using resistive random access memory array
Figure 773571DEST_PATH_IMAGE055
Figure 324638DEST_PATH_IMAGE056
Mapping the result of the graph convolution operation to a current value I output from the resistance change memory, converting the current value into a voltage value,
Figure 592808DEST_PATH_IMAGE057
sampling the voltage value through an analog-to-digital converter, and finally obtaining a value after convolution and quantization of the graph
Figure 850614DEST_PATH_IMAGE058
Obtaining the quantization value of the convolution of the last layer of the graph by analogy as the input of the next layer of the network, and taking the index of the maximum value of the output value of the convolution quantization layer of the last layer of the graph as the category of the network prediction;
Figure 77196DEST_PATH_IMAGE059
(15)
wherein, the first and the second end of the pipe are connected with each other,
Figure 787664DEST_PATH_IMAGE058
representing the values of the graph after convolution quantization,
Figure 859525DEST_PATH_IMAGE031
indicating the truncation bit width of the graph convolution layer output value learned by the network,
Figure 299733DEST_PATH_IMAGE048
a quantized value representing an activated quantized layer,
Figure 166058DEST_PATH_IMAGE050
representing the value of the graph after the graph convolution quantization layer graph convolution kernel quantization.
9. The graph convolution network document identification method based on the resistive random access memory according to claim 1, characterized in that:
the floating point image convolution network model structure in the step S2 is connected in sequence: the system comprises an input layer, a neighborhood feature extraction layer, a first graph volume layer, a first activation layer, a second graph volume layer, a second activation layer, a third graph volume layer and a softmax layer;
the graph convolution network quantization model structure in the step S3 is connected in sequence: the system comprises an input layer, a neighborhood feature extraction layer, a first activation quantification layer, a first activation inverse quantification layer, a first graph volume inverse quantification layer, a second activation inverse quantification layer, a second graph volume inverse quantification layer, a third activation inverse quantification layer, a third graph volume inverse quantification layer and a softmax layer;
the graph convolution network quantization model structure in the step S5 is sequentially connected: the system comprises an input layer, a neighborhood feature extraction layer, a first activation quantification layer, a first graph volume quantification layer, a second activation quantification layer, a second graph volume quantification layer, a third activation quantification layer, a third graph volume quantification layer and a softmax layer.
10. A resistance change memory-based graph volume network document identification device, comprising a memory and one or more processors, wherein the memory stores executable codes, and the one or more processors execute the executable codes to implement the resistance change memory-based graph volume network document identification method according to any one of claims 1 to 9.
CN202310017218.7A 2023-01-06 2023-01-06 Graph convolution network literature identification device and method based on resistive random access memory Active CN115905546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310017218.7A CN115905546B (en) 2023-01-06 2023-01-06 Graph convolution network literature identification device and method based on resistive random access memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310017218.7A CN115905546B (en) 2023-01-06 2023-01-06 Graph convolution network literature identification device and method based on resistive random access memory

Publications (2)

Publication Number Publication Date
CN115905546A true CN115905546A (en) 2023-04-04
CN115905546B CN115905546B (en) 2023-07-14

Family

ID=86495677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310017218.7A Active CN115905546B (en) 2023-01-06 2023-01-06 Graph convolution network literature identification device and method based on resistive random access memory

Country Status (1)

Country Link
CN (1) CN115905546B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190340492A1 (en) * 2018-05-04 2019-11-07 Microsoft Technology Licensing, Llc Design flow for quantized neural networks
CN110852439A (en) * 2019-11-20 2020-02-28 字节跳动有限公司 Neural network model compression and acceleration method, data processing method and device
US20200293889A1 (en) * 2018-03-06 2020-09-17 Tdk Corporation Neural network device, signal generation method, and program
CN112215331A (en) * 2019-07-10 2021-01-12 华为技术有限公司 Data processing method for neural network system and neural network system
CN112598123A (en) * 2020-12-25 2021-04-02 清华大学 Weight quantization method and device of neural network and storage medium
CN113516234A (en) * 2021-05-10 2021-10-19 西安交通大学 Method and device for relieving nonideal factors of memristor accelerator
CN114646839A (en) * 2022-01-28 2022-06-21 国网河北省电力有限公司保定供电分公司 Power distribution network fault section positioning method and device based on graph convolution neural network
CN114677548A (en) * 2022-05-26 2022-06-28 之江实验室 Neural network image classification system and method based on resistive random access memory
CN115310595A (en) * 2022-08-11 2022-11-08 中国人民解放军国防科技大学 Neural network mixing precision quantification method and system of memristor
CN115311506A (en) * 2022-10-11 2022-11-08 之江实验室 Image classification method and device based on quantization factor optimization of resistive random access memory

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200293889A1 (en) * 2018-03-06 2020-09-17 Tdk Corporation Neural network device, signal generation method, and program
US20190340492A1 (en) * 2018-05-04 2019-11-07 Microsoft Technology Licensing, Llc Design flow for quantized neural networks
CN112215331A (en) * 2019-07-10 2021-01-12 华为技术有限公司 Data processing method for neural network system and neural network system
CN110852439A (en) * 2019-11-20 2020-02-28 字节跳动有限公司 Neural network model compression and acceleration method, data processing method and device
CN112598123A (en) * 2020-12-25 2021-04-02 清华大学 Weight quantization method and device of neural network and storage medium
WO2022135209A1 (en) * 2020-12-25 2022-06-30 清华大学 Quantization method and quantization apparatus for weight of neural network, and storage medium
CN113516234A (en) * 2021-05-10 2021-10-19 西安交通大学 Method and device for relieving nonideal factors of memristor accelerator
CN114646839A (en) * 2022-01-28 2022-06-21 国网河北省电力有限公司保定供电分公司 Power distribution network fault section positioning method and device based on graph convolution neural network
CN114677548A (en) * 2022-05-26 2022-06-28 之江实验室 Neural network image classification system and method based on resistive random access memory
CN115310595A (en) * 2022-08-11 2022-11-08 中国人民解放军国防科技大学 Neural network mixing precision quantification method and system of memristor
CN115311506A (en) * 2022-10-11 2022-11-08 之江实验室 Image classification method and device based on quantization factor optimization of resistive random access memory

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WANG MENG: "Study on methods of suppressing signal truncation error in digital signal processing", 《2019 14TH IEEE INTERNATIONAL CONFERENCE ON ELECTRONIC MEASUREMENT & INSTRUMENTS(ICEMI)》 *
孙磊;肖金球;夏禹;顾敏明;: "改进的基于嵌入式SoC卷积神经网络识别模型", 计算机应用与软件, no. 03 *

Also Published As

Publication number Publication date
CN115905546B (en) 2023-07-14

Similar Documents

Publication Publication Date Title
Carreira-Perpinán Model compression as constrained optimization, with application to neural nets. Part I: General framework
US11544542B2 (en) Computing device and method
CN113837370B (en) Method and apparatus for training a model based on contrast learning
US11537879B2 (en) Neural network weight discretizing method, system, device, and readable storage medium
CN114677548B (en) Neural network image classification system and method based on resistive random access memory
CN115311506B (en) Image classification method and device based on quantization factor optimization of resistive random access memory
Moya Rueda et al. Neuron pruning for compressing deep networks using maxout architectures
WO2023124342A1 (en) Low-cost automatic neural architecture search method for image classification
Rani et al. DeepCompNet: A novel neural net model compression architecture
EP3882823A1 (en) Method and apparatus with softmax approximation
Bao et al. Cross-entropy pruning for compressing convolutional neural networks
CN112949610A (en) Improved Elman neural network prediction method based on noise reduction algorithm
CN113378866B (en) Image classification method, system, storage medium and electronic device
CN115905546A (en) Graph convolution network document identification device and method based on resistive random access memory
US20220253709A1 (en) Compressing a Set of Coefficients for Subsequent Use in a Neural Network
CN115599918A (en) Mutual learning text classification method and system based on graph enhancement
Goel et al. CompactNet: High accuracy deep neural network optimized for on-chip implementation
CN114595641A (en) Method and system for solving combined optimization problem
CN114819140A (en) Model pruning method and device and computer equipment
CN112988548A (en) Improved Elman neural network prediction method based on noise reduction algorithm
Hossain et al. Computational Complexity Reduction Techniques for Deep Neural Networks: A Survey
CN113361707A (en) Model compression method, system and computer readable medium
CN112651492A (en) Self-connection width graph convolution neural network model and training method thereof
CN116737607B (en) Sample data caching method, system, computer device and storage medium
Dong et al. An optimization method for pruning rates of each layer in CNN based on the GA-SMSM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant