Design of Hardware-Friendly Memory Enhanced Neural Networks

Ann Franchesca Lagunaa, Michael Niemierb and X. Sharon Huc
University of Notre Dame, Notre Dame, USA
aalaguna@nd.edu
bmniemier@nd.edu
cshu@nd.edu

ABSTRACT


Neural networks with external memories have been proven to minimize catastrophic forgetting, a major problem in applications such as lifelong and few-shot learning. However, such memory enhanced neural networks (MENNs) often require a large number of floating point-based cosine distance metric calculations to perform necessary attentional operations, which greatly increases energy consumption and hardware cost. This paper investigates other distance metrics in such neural networks in order to achieve more efficient hardware implementations in MENNs. We propose using content addressable memories (CAMs) to accelerate and simplify attentional operations. Our hardware friendly approach implements fixed point L distance calculations via ternary content addressable memories (TCAM) and fixed point L1 and L2 distance calculations on a general purpose graphical processing unit (GPGPU). As a representative example, a 32-bit floating point-based cosine distance MENN with M . D multiplications has a 99.06% accuracy for the Omniglot 5-way 5-shot classification task. Based on our approach, with just 4-bit fixed point precision, a L- L1 distance hardware accuracy of 90.35% can be achieved with just 16 TCAM lookups and 16.D addition and subtraction operations. With 4-bit precision and a L-L2 distance, hardware classification accuracies of 96.00% are possible. Hence, 16 TCAM lookups and 16 .D multiplication operations are needed. Assuming the hardware memory has 512 entries, the number of multiplication operations is reduced by 32x versus the cosine distance approach.

Keywords: TCAM, Neural Networks, Associative Memories, One-Shot Learning, MANN, Nearest Neighbor.



Full Text (PDF)