Week 02 lab · hidden layers

Multi-neuron neural network

One neuron draws one straight line. This network combines 4 hidden neurons to learn more useful regions.

Network graphRed = positive weight · Teal = negative weight
xyh1h2h3h4ŷ2 inputs4 hidden1 output
Live training
Class A Class B Learned region
-6-6-4-4-2-200224466xyBPoint 1: (-4.4, -3.6), Class BBPoint 2: (-3.1, -4.5), Class BAPoint 3: (-4.1, 3.4), Class AAPoint 4: (-2.8, 4.5), Class AAPoint 5: (3.1, -4.2), Class AAPoint 6: (4.4, -2.9), Class ABPoint 7: (3.2, 3.6), Class BBPoint 8: (4.6, 4.5), Class B

Click the graph to add the selected class. The colored map is the network's prediction.

Pseudocode

How it learns.

give every neuron random weights

repeat:
  for each point:
    hidden values ← hidden neurons read x and y
    guess ← output neuron reads hidden values
    error ← guess − correct label

    adjust output weights using the error
    adjust hidden weights using the error

stop after the chosen number of training steps