Patent ID: 11899744
Assignee: SAMSUNG ELECTRONICS CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 5:
6. A method in a neural network apparatus, the method comprising:
accessing at least a portion of a neural network comprising an input layer, multiple hidden layers, and an output layer, each layer comprising a respective set of nodes, each layer other than the input layer having weights of connections to a preceding adjacent layer, the neural network further comprising a weight matrix and a number of heads of the neural network, the weight matrix comprising weight values of the weights, the weight matrix having a row dimension and a column dimension
reading an input feature map and the weight matrix from a memory, wherein a matrix operation is performed on the input feature map and the weight matrix, wherein the matrix operation comprises a matrix multiplication operation, a transpose operation, and a reshape operation, wherein the method is capable of performing the transpose operation and the reshape operation before the matrix multiplication operation, and wherein the method is capable of performing the transpose operation and the reshape operation after the matrix multiplication operation;
selecting between a column dimension and a row dimension as a split dimension, wherein the split dimension is selected according to whether the reshape operation and the transpose operation are to be performed before or after the matrix multiplication operation;
splitting, in the selected split dimension, the weight matrix into a number weight sub-matrices based on the number of heads;
generating intermediate feature maps by performing the matrix multiplication operation between the input feature map and the weight sub-matrices;
generating a final feature map by performing an operation on the intermediate feature maps; and
generating activations of nodes, according to an activation function, of one of the layers of the neural network based on the final feature map.