EECS/EEAP 484 Problem Set 5: Recurrent Neural Networks and Autoassociative Memory (Content-Addressable Memory) solution




5/5 - (5 votes)

Neural networks with feedback (recurrent neural nets) can be used for error-tolerant data encoding,
content-addressable memory, recovery of complete memories based on incomplete or flawed cues, and as
a means for solving combinatorial problems.
In the present assignment, you are to use a bipolar (output values of +1 or -1), recurrent (outputs fed back
to inputs) neural net–i.e., a Hopfield net– to memorize and recall images.
From Canvas, download the starter code and the example bitmaps. The starter code is a nearly complete
solution, but you will have to complete the function for updating nodes. Further, you should consider
suppressing the diagonal of the matrix memory.
Functions are provided for reading B/W (monochrome) bitmap (*.bmp) images and converting them into
vectors of numbers. An image consists of a vector describing the raster of pixels in sequence. A
complimentary function records results from your program as a bitmap. You can use “paint” or a variety
of other applications to view the bitmaps, whether inputs, outputs, or intermediate results from your
Example bitmaps, 32×16, are available for download. In addition, there are examples of flawed versions
of some of these (“err_*.bmp”). You are encouraged to consider alternative inputs. (E.g., you can use
Paint or some other icon editor to create your own, or to alter any of these examples).
Write (or complete) the code for a Hopfield autoassociative memory. Once your code is working, perform
experiments on the data. Report on:
• How many (and which) memories can you encode and recover perfectly from flawed cues?
• Show some of the intermediate states of results of your program, illustrating the process of convergence
to a perfect recall.
• Think about and report on properties of memories that can be recalled and memories that interfere with
each other. (e.g. look at orthogonality)