MCPcopy
hub / github.com/hunkim/PyTorchZeroToAll / loss

Function loss

03_auto_gradient.py:13–14  ·  view source on GitHub ↗
(y_pred, y_val)

Source from the content-addressed store, hash-verified

11
12# Loss function
13def loss(y_pred, y_val):
14 return (y_pred - y_val) ** 2
15
16# Before training
17print("Prediction (before training)", 4, forward(4).item())

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected