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

Claim 0:
1. A neural network apparatus, comprising:
a memory having at least one program stored therein, the memory storing at least a portion of a neural network comprising a weight matrix and a number of heads of the deep neural network, the neural network further 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 weight matrix comprising weight values of the weights, the weight matrix having a row dimension and a column dimension; and
a processor configured to perform one or more operations by executing the at least one program, wherein the processor is configured to:
read, from the memory, an input feature map and the weight matrix, wherein the processor is configured to perform a matrix operation on the input feature map and the weight matrix, the matrix operation comprising a matrix multiplication operation, a transpose operation, and a reshape operation, wherein the processor is configured to be capable of performing the transpose operation and the reshape operation before the matrix multiplication operation, and wherein the processor is configured to be capable of performing the transpose operation and the reshape operation after the matrix multiplication operation,
select between the column dimension and the row dimension as a split dimension, wherein the split dimension is selected according to whether the matrix operation is performed by performing the reshape operation and the transpose operation before or after the matrix multiplication operation,
split, in the selected the split dimension, the weight matrix into a number of weight sub-matrices based on the number of heads,
generate intermediate feature maps by performing the matrix multiplication operation between the input feature map and the weight sub-matrices,
generate a final feature map by performing an operation on the intermediate feature maps, and
generate activations of nodes, according to an activation function, of one of the layers of the neural network based on the final feature map.