Neural Networks

Status
Not open for further replies.

Emily

Daemon Poster
Messages
1,179
Anyone know anything about them? I'm trying to use a Hopfield network for pattern recognition in music composition, but I've run into a problem... As far as I can see (which isn't very far), a pattern in a Hopfield network will be recognized as long as the network has been trained with a pattern that fires the same neurons in a different order. For example, I could train a Hopfield network with a pattern that fires neuron 1, then neuron 2, then neuron 3, and then it would recognize a pattern that fires neuron 1, then neuron 3, and then neuron 2. A better way to describe it might be that it can't distinguish between the two; it doesn't have a sequence, and all the neurons fire at the same time. Obviously this makes it a little bit hard in music, since C, E, D, F is very different from C, D, E, F.

Er... anyone have any words of wisdom for me? :D
 
.:blink:.

[confusion]

uhhhh

[/confusion]

Ok, that's way beyond me. ^_^ I'll have to punch that in google or something sometime.
 
eh, music composition = GarageBand

GarageBand = NOT CONFUSING!

I have absolutely no clue as to what you are reffering, but the only reason I have interest is because I love composing music. What exactly are these 'neurons' you're talking about? :confused:
 
Heh heh. :p How do I explain... Sorry in advance for the mammoth post, I worked on this stuff for about 8 hours today so I need to get it all out. :p

So I'm writing an AI program that composes music (I've posted about it on here a couple times before). First it just composed stuff (there's a first version available for download at virtualoso.blogspot.com but it won't run on anything but Windows)... then I re-wrote it with a genetic algorithm so that new compositions are combinations of two old ones, plus a little bit of randomness. All the compositions are rated on how aurally pleasing they are, and only the aurally pleasing ones "survive." (Survival of the fittest, sort of.) That's all well and good, except that so far nothing it composes has much of a structure. So I want to use a neural network for pattern recognition, since that's one of their main uses. A neural network is based on the human brain, with "neurons" that have connections of varying strengths to other neurons. In a simple neural network there are inputs that are multiplied by the weights (strengths) to produce outputs. The kind of neural network I want to use is called a Hopfield network; it takes binary inputs (0 and 1 determine whether a neuron fires or doesn't fire) and it's autoassociative, which means that if the output pattern is the same as the input pattern, the pattern is recognized.

So for a basic Hopfield network with, say, 4 neurons, you start by training it to recognize certain input patterns - for example, 0101 and 1100 and 1110. For each pattern, you put the bipolarized input pattern into a matrix and multiply it by its inverse matrix. Then you add all of the matrices together and create what's called a connection weights matrix..

Then to test if a pattern is recognized, you match the input pattern against each connection's weights, and sum all the cells in a row where the corresponding cells of the input pattern are 1. Then if the sum is greater than 0, the neuron fires (it returns 1), and if the sum is less than or equal to 0, the neuron doesn't fire (it returns 0). The output pattern tells you which neurons fire and which don't; if the output pattern is the same as the input pattern, then the network recognizes it.

So basically I'm going to have one Hopfield network for note patterns and one for rhythmic patterns, and each note/rhythm is a neuron, and each note/rhythm either fires or doesn't fire (1 or 0, plays or doesn't play). They will be trained off of music that humans have composed. Then if the computer's patterns are recognized in the network, they should be kept because they resemble human music. So obviously sequencing is important, because C D E F is a completely different pattern than C E D F.

As a sidenote, I think I solved my sequencing problem... I'll just have an array that corresponds to the binary input and store the sequencing in that array.

Hallelujah, the post is finally over. :)
 
Status
Not open for further replies.
Back
Top Bottom