Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ ref
Function
ref
imperative/python/test/unit/functional/test_loss.py:29–30 ·
view source on GitHub ↗
(x, y)
Source
from the content-addressed store, hash-verified
27
return
x
28
29
def
ref(x, y):
30
return
np.mean([-np.log(x[i, y[i]])
for
i in range(len(y))])
31
32
x = (np.random.rand(5, 10) - 0.5) * 4
33
y = np.random.randint(10, size=(5,))
Callers
7
test_cross_entropy
Function · 0.70
__call__
Method · 0.50
__call__
Method · 0.50
cb
Function · 0.50
test_attach_temporary
Function · 0.50
parse_number
Method · 0.50
TEST
Function · 0.50
Calls
2
mean
Method · 0.45
log
Method · 0.45
Tested by
no test coverage detected