Deriving a Contribution Matrix for Two Patterns Help?

8 views
Skip to first unread message

Justin Bozonier

unread,
Feb 1, 2009, 12:39:43 AM2/1/09
to Neural Networks Study Group
So I'm following along in the book (Chapter 3 I think) and I'm trying
to create a weight matrix for a Hopfield Neural Network. I create the
two contribution matrices both of which recall their individual
patterns correctly. The problem arises when I attempt to add the two
matrices together to create a single weight matrix that will recognize
both patterns. Here is a brief summary of my work:

Pattern 1:

P1 = [0 1 0 1]

Contribution Matrix (P1') =
[ 0 -1 1 -1]
[-1 0 -1 1]
[ 1 -1 0 -1]
[-1 1 -1 0]

Pattern 2:

P2 = [1 0 0 1]

Contribution Matrix (P2') =
[ 0 -1 -1 1]
[-1 0 1 -1]
[-1 1 0 -1]
[ 1 -1 -1 0]

Now to get the overall weight matrix for the HNN that recognizes both
patterns the book says I should add P1' and P2'...

P1' + P2' =
[ 0 -2 0 0]
[-2 0 0 0]
[ 0 0 0 -2]
[ 0 0 -2 0]

Now if I try to recognize P2 I end up with [0 -2 -2 0]
and for P1 I get [-2 0 -2 0]

Both of which look fine relative to the other numbers in the set but
when evaluated of course never return high. Is it legal to add 1 to
all values of one matrix to try and that? :)

Am I doing something wrong?

Justin Bozonier

unread,
Feb 2, 2009, 2:51:24 AM2/2/09
to Neural Networks Study Group
So I figured out through trial and error that I need to multiply the
two matrices like so:

-P1' * P2' =
[ 0 -1 1 1]
[-1 0 1 1]
[ 1 1 0 -1]
[ 1 1 -1 0]

That weight matrix seems to recognize both patterns now (note the need
to multiply by a negative).

Does this look right?
Reply all
Reply to author
Forward
0 new messages