Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
13
def
loss(y_pred, y_val):
14
return
(y_pred - y_val) ** 2
15
16
# Before training
17
print(
"Prediction (before training)"
, 4, forward(4).item())
Callers
1
03_auto_gradient.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected