In this post we're going to build a simple neural network in Microsoft Excel. Excel is surprisingly good for doing this as it's familiar to many people and simple to use after minimal exposure. Moreover, it has a lot of built in functions (IF, CHOOSE, etc) that are the same as in any programming language (Matlab, C#, Java), plus many other useful functions.
What you’ve said here is that there are two inputs, each with a value of zero. There are two weights, with values of -0.5 and 0.2 respectively. There is a threshold of 1. There are also activation and output values, but these are not set yet – this is because we are going to have the network (Grak) calculate these itself.
When you press return, the value zero should appear in cell C4. This is because S1*w1 + S2*w2 = 0.
4. Finally, we need to compare the value we’ve just calculated with the threshold, and output a 1 if the value exceeds the threshold and a 0 otherwise.
Click on cell E4. Now go up to the formalas tabbed menu and select 'Insert Function':
When you have done this, a separate window will pop up that gives the option to “Select a function:”. From this list, choose IF. Another window will pop up. Input the following data and click ok:
What you have said is: if the data in cell C4 is greater than or equal to ( >= ) the value in cell D4, then make the value in cell E4 1. If not, make it 0. Simple, isn’t it!
5. Now try each of the following input pairs for the Darwinian Grak's sensors:
Bearing in mind that the Darwinian Grak only feeds on Fraggles, does the Grak you have made survive? Why, or why not?
So far we’ve seen two sibling Graks whose behaviours are pre-determined at birth (perhaps genetically). Should one of them be born with a mutation that makes it perform badly, it will die. This was the case with the first of the two, but not with the second. This is all fine, but it would be better if a baby were able to get some instruction from their mother so that any birth defects in synapse strength could be updated and they could survive... it would be better if it could learn! This is the case with the Common Grak that we'll look at in the next post.
Here's a video of me going through the steps from this post:
No comments:
Post a Comment