Neuron 101

A neural network from scratch / Neuron

Türkçe

Plate43

Unit 5 · Topic 1 of 12

Neuron

Easy, 6 min, 7 steps

2x₁1x₂1constant 1
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 7 Inputs

Inputs

The neuron takes numbers: x₁ = 2, x₂ = 1. The third input is always 1; its weight will be b. Tap a node to change its value.

Open in Colab
  1. import math
  2. x = [2.0, 1.0]
  3. w = [0.8, -0.5]
  4. b = 0.2
  5. z = sum(a * c for a, c in zip(x, w))
  6. z = z + b
  7. y = 1 / (1 + math.exp(-z))
  8. print(z, y)
z
1.30
y
0.79