Jump to content
  • Advertisement
Sign in to follow this  
johnnyBravo

I don't understand the rule for this weight determination of a NN, from book

This topic is 4923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm reading a book about neural networks, and I've come across a small example on how to determine the weights for a neural network that has 2 input neurons connections to 1 output neuron. heres the line I don't understand:
Quote:
If the output with input pattern (a, b) is greater than what it should be, then subtract 1 from w1 if the product aw1 is smaller than 1, and adjust w2 similarly.
Theres two outputs. actualOutput = 0; //what the out neuron actually outputted shouldBeOutput = 1; //what the out neuron should be outputting And the input to input neuron1 is 'a'; From what I can tell it is,
if(actualOutput > shouldBeOutput) {
   w1--; //subtract 1 from weight1
   
   //I'm not sure if this is what the rule meant, which is underlined in the quote
   if(a*w1 < 1) {
      w2--; //subtract 1 from weight2

   }
}



So is the code above right or wrong from what you can tell from the quote? if you need anymore information, let me know. Thanks

Share this post


Link to post
Share on other sites
Advertisement
I think it is saying "only adjust w1 and w2 if the product is less than 1". So:

if (actualInput > shouldBeOutput) {
if (a*w1 < 1) {
--w1;
--w2;
}
}

I'm not familiar with the book, I'm just interpreting the quote you posted.

Share this post


Link to post
Share on other sites
Another possible interpretation:

if (actualInput > shouldBeOutput) {
if (a*w1 < 1) {
--w1;
}
if (a*w2 < 1) {
--w2;
}
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!