Neuron 101

Learning from examples / Loss function

Türkçe

Plate25

Unit 3 · Topic 4 of 11

Loss function

Medium, 7 min, 8 steps

05101520253035010203040506070temperature, degreesice creams soldmodel
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 8 Model

One line, eight days

We have a line with w = 1.20 and b = 10. It is hard to say by eye how close it passes to the dots; we want to measure that with a number.

Open in Colab
  1. w, b = 1.2, 10.0
  2. x = [12, 15, 18, 20, 23, 26, 29, 32]
  3. y = [25, 26, 35, 33, 42, 48, 48, 56]
  4. toplam = 0
  5. for a, gercek in zip(x, y):
  6. hata = gercek - (w * a + b)
  7. toplam += hata ** 2
  8. mse = toplam / len(x)
  9. print(mse)
w
1.20
b
10
mse
18.82