Artificial Intelligence By Example
上QQ阅读APP看书,第一时间看更新

Step 1 – Defining a feedforward neural network

We look at our piece of paper. We don't have a computer. We're going to have to write code; then we'll hopefully find a computer in a university or a corporation that has a 1960 state-of-the-art language to program in.

We have to be unconventional to solve this problem. First, we must ignore Minsky and Papert's publication and also forget complicated words and theory of the 21st century. In fact, we don't remember much anyway. Time travel made our future fuzzy!

A perceptron is usually represented by a graph. But that doesn't mean much right now. After all, I can't compute circles and lines. In fact, beyond seeing circles and lines, we type characters in computer languages, not circles. So, I decide to simply to write a layer in high-school format. A hidden layer will simply be: 

Ok, now I have one layer. In fact, I just realized that a layer is merely a function. This function can be expressed as:

 

In which x is the input value and w is some kind of value to multiply x by. I also realized that hidden just means that it's the computation, just as x=2 and x+2 is the hidden layer that leads to 4.

At this point, I've defined a neural network in three lines: 

  • Input x.
  • Some kind of function that changes its value, like 2 x 2 = 4, which transformed 2. That is a layer. And if the result is superior to 2, for example, then great! The output is 1, meaning yes or true. Since we don't see the computation, this is the hidden layer. 
  • An output.

Now that I know that basically any neural network is built with values transformed by an operation to become an output of something, I need the logic to solve the XOR problem.