Neuron 101

A neural network from scratch / Computational graph

Türkçe

Plate49

Unit 5 · Topic 7 of 12

Computational graph

Medium, 8 min, 11 steps

1.50x0.80w−0.40bu = w · xz = u + bŷ = σ(z)L = ½(ŷ − t)²
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 11 Graph

The graph of one neuron

The computation of a single neuron is split into four operations: multiply, add, sigmoid, loss. The inputs are x = 1.50, w = 0.80, b = −0.40; the target is t = 1. Tap an input node to type a value.

Open in Colab
  1. import math
  2. x, w, b, t = 1.5, 0.8, -0.4, 1.0
  3. u = w * x
  4. z = u + b
  5. y = 1 / (1 + math.exp(-z))
  6. L = 0.5 * (y - t) ** 2
  7. gy = y - t
  8. gz = gy * y * (1 - y)
  9. gu, gb = gz, gz
  10. gw, gx = gu * x, gu * w
  11. print(gw, gx, gb)
x
1.50
w
0.80
b
−0.40
u
1.20
z
0.80
y
0.69
L
0.05