The inputs will be binary and correspond to the LED-like figure to the left.
In particular, the input pattern for the character C is
[1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1]. For your targets,
please use
Write a functionT = [0 0], A = [0 1], C = [1 0], and G = [1 1].
that returns the two weight matrices after successful training at the given rate. Drive this function with a function called ocr, as in,[V,W] = ocrtrain(V0,W0,maxiter,rate)
that "reads" the N-by-25 bitstream through the net with V and W and produces a string of N letters. For example, ifseq = ocr(bitstream)
then seq should be CGAT. Hint The grad formulas on the lecture page work nice for scalar outputs. But here your outputs have two components, in particular your W has two rows. What to do? Well, on each iteration just work on updating a single row of W. How should you choose which row? Flip a rand.bitstream = [1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1; 1 1 1 1 1 1 0 0 0 0 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1; 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1; 1 1 1 1 1 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0]
Your work will be graded as follows
First Draft,
3 pts for guts of ocrtrain
3 pts for guts of ocr
Final Draft,
8 pts for headers CONTAINING detailed USAGE
8 pts for further comments in code
4 pts for indentation
14 pts for correct ocrtrain
10 pts for correct ocr
10 pts for diary of training session and translation of the
4-by-25 bitstream above.