The present invention relates to recurrent neural network. In particular, the present invention relates to how to implement and accelerate a recurrent neural network based on an embedded FPGA. Specifically, it proposes an overall design processing method of matrix decoding, matrix-vector multiplication, vector accumulation and activation function. In another aspect, the present invention proposes an overall hardware design to implement and accelerate the above process.
Please help me write a proper abstract based on the patent claims. CLAIM: 1. A device for implementing compressed RNN (recurrent neural network), said device comprising: a receiving unit, which is used to receive a plurality of input vectors and distributed them to a plurality of processing elements (PE); a plurality of processing elements (PE), each of which comprising: a reading unit configured to read weight matrices W, said W indicates weights of said RNN; ALU configured to perform multiplication and addition calculation of said weight matrices W; calculation buffer configured to store intermediate results of matrix-vector multiplication and output results to an assembling unit; an assembling unit configured to receive results from PEs and assemble them into a complete result vector; a controller unit configured for controlling said plurality of processing elements. 2. The device of claim 1, further comprising: hidden layer unit, configured to perform hidden layer's activation function of said RNN. 3. The device of claim 2, further comprising: a vector buffer configured to receive the RNN's hidden layer's activation vector from said hidden layer unit and store the hidden layer's activation vector and bias vector. 4. The device of claim 3, further comprising: an adder tree unit configured to perform vector accumulation on vectors output from the assembling unit and the vector buffer. 5. The device of claim 1, wherein said receiving unit further comprises: a plurality of first-in-first-out buffer, each of which corresponds to a PE. 6. The device of claim 1, wherein said reading unit further comprises: location unit configured to read and store location information of non-zero elements in the weight matrix W; decoding unit configured to decoding the weight matrix to obtain the weight value of the weight matrix W. 7. The device of claim 1, wherein said ALU comprises: a plurality of multipliers configured to perform multiplication operation on matrix elements and input vector elements; a plurality of adders configured to perform addition operation on the results of above multiplication operation. 8. The device of claim 1, wherein said calculation buffer comprises: a first output buffer and a second output buffer, said first and second buffer receive and output computation result alternatively, wherein while one buffer receives present computation result, the other buffer outputs the previous computation result. 9. The device of claim 3, wherein said vector buffer further comprises: a plurality of sub-buffers configured to store computation results of respective hidden layers. 10. A method for implementing compressed RNN based on FPGA, comprising: a) receiving data from off-chip memory and storing the data into on-chip memory of FPGA, wherein said data are related to RNN computation, including input vector, bias vector and weight matrices; b) decoding the data received in step a) using FPGA on-chip processor in order to obtain the real weights, and storing the real weight into FPGA on-chip memory; c) matrix computing by performing matrix-vector multiplication using FPGA on-chip processing elements and storing the result into FPGA on-chip memory; d) vector accumulating by performing vector accumulation using FPGA on-chip processing elements and storing the results into FPGA on-chip memory, said vectors including both resultant vector obtained in step c) and said bias vector; e) activation function computing by performing activation function on the result of the above step d), and storing the result into FPGA on-chip memory; iterating the above steps a), b), c), d), e) to obtain RNN's activation sequences and computing RNN's output sequence according to the activation sequences. 11. The method of claim 10, further comprising: distributing received data to a plurality of parallel processing elements (PE) after receiving data in step a); and assembling results from each PE to obtain a complete result vector of matrix-vector multiplication after computation in step c). 12. The method of claim 11, further comprising: in each PE, providing a plurality of on-chip adders and multipliers for parallel processing. 13. The method of claim 10, in at least one of said steps a), b), c), providing a pair of ping-pong buffers in the on-chip memory. 14. A method for implementing a Recurrent Neural Network (RNN), wherein the weights of said RNN being characterized by Whh and Whx, where Whh is the weight matrix of hidden layers of said RNN, Whx is the weigh matrix being applied to input of the hidden layers, where an activation to be applied to an input vector by said hidden layers is ht, the input of said RNN is a series of input vectors x=(x1,x2. . . , xT), said method comprises: initialization step of reading necessary data for computing Whxx into a FPGA on-chip memory, said data including input vectors x and Whx, where Whx is a weight matrix to be applied to said input vector x; step 1 of computing Whxx by processing elements of said FPGA, and reading necessary data for computing Whhx into the FPGA on-chip memory; step 2 of computing Whhht−1 by processing elements of said FPGA, where ht−1 is an activation to be applied to the previous input vector by the hidden layer, and reading necessary data for computing the next Whxx into the FPGA on-chip memory; and iteratively repeating said step 1 and step 2. 15. The method of claim 14, wherein each of said Step 1 and Step 2 further comprises: while computing matrix-vector multiplication for the present input vector, computing the activation ht of hidden layers and RNN's output yt. 16. The method of claim 14, wherein: said initial step, step 1 and step 2 are processed sequentially; and said step 1 and step 2 are processed periodically.