Homework 13 - DNA OCR via Hopfield. There will be neither lab nor prelab this week and so No First draft. Final Draft due 5pm Wednesday, November 28

We will apply Hopfield technology to last week's task. In particular, we will write a function

hopmaster(nstim)

That
  1. Constructs the Hopfield weight matrix W associated with our 4 input patterns (the bitstream of last week, with each zero replaced with -1),
  2. Runs nstim random stimuli through the associated Hopfield net, and either plots the before and after results (if nstim=1) or collect statistics (if nstim is larger than 1).
As example before/after plots we offer a pair ending in A and a pair ending in -G

Here 1=red and -1=white. I recommend generating these in a subfunction called led that exploits subplot and patch. For example, patch([0 2 2 0],[0 0 1 1],'r') produces a red rectangle with vertices (0,0), (2,0), (2,1) and (0,1).

For nstim larger than 1 your hopmaster should count the number of times that each letter, or its mirror image, or none of the above, is hit, and produce a histogram like that below.

I used bar to get the bars and set(gca,'xticklabel',dnalab) to set those cool letters. The last category corresponds to a mystery attractor, for example as in this before and after picture,

Your work will be graded as follows

     Final Draft,
        8 pts for headers CONTAINING detailed USAGE
        8 pts for further comments in code
        4 pts for indentation
        4 pts for correct hopfield net
        5 pts for correct led

        2 pts for before/after jpg ending in T
        2 pts for before/after jpg ending in -C 
        2 pts for before/after jpg ending in a mystery attractor
               distinct from that above
        4 pts for Hopfield histogram for nstim at least 5000.

	15 pts for a 500 word essay. The essay must be typed and
           have a title, introduction and body. The backbone of the
           essay should be an overview of Hopfield
           Into that foundation you should weave detailed reference to 
           your 2 weeks of neural net experience.  You may neither
           give nor receive aid from other students. You may consult
           and must cite both paper and electronic media. Your citation list
           does not count toward the 500 word minimum.