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

Function loss

05_2_gradientdescent_auto.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
22print(f'Prediction before training: f(5) = {forward(5).item():.3f}')
23

Calls

no outgoing calls

Tested by

no test coverage detected