CPC G06N 3/04 (2013.01) | 20 Claims |
1. A method for generating a network representation for a neural network, the method comprising:
obtaining, by a device comprising a memory storing instructions and a processor in communication with the memory, a source-side vector sequence corresponding to an input sequence;
performing, by the device, linear transformation on the source-side vector sequence, to obtain a request vector sequence, a key vector sequence, and a value vector sequence corresponding to the source-side vector sequence;
calculating, by the device, a logical similarity between the request vector sequence and the key vector sequence;
constructing, by the device, a local strength matrix according to the request vector sequence;
performing, by the device, nonlinear transformation based on the logical similarity and the local strength matrix, to obtain a local strength attention weight distribution corresponding to elements in the input sequence; and
fusing, by the device, value vectors in the value vector sequence according to the local strength attention weight distribution, to obtain a network representation sequence corresponding to the input sequence.
|