MCPcopy Index your code
hub / github.com/patrickloeber/pytorchTutorial / loss

Function loss

05_1_gradientdescent_manually.py:19–20  ·  view source on GitHub ↗
(y, y_pred)

Source from the content-addressed store, hash-verified

17
18# loss = MSE
19def loss(y, y_pred):
20 return ((y_pred - y)**2).mean()
21
22# J = MSE = 1/N * (w*x - y)**2
23# dJ/dw = 1/N * 2x(w*x - y)

Calls

no outgoing calls

Tested by

no test coverage detected