MCPcopy Create free account
hub / github.com/apache/singa / cross_entropy

Function cross_entropy

python/singa/autograd.py:1257–1263  ·  view source on GitHub ↗
(x, t)

Source from the content-addressed store, hash-verified

1255
1256
1257def cross_entropy(x, t):
1258 assert x.ndim() == 2, "1st arg required 2d tensor. got shape: " + str(
1259 x.shape)
1260 assert t.ndim() <= 2, "2nd arg required <=2d tensor. got shape: " + str(
1261 t.shape)
1262 # x is the logits and t is the ground truth.
1263 return CrossEntropy(t)(x)[0]
1264
1265
1266class RankingLoss(Operator):

Callers

nothing calls this directly

Calls 2

CrossEntropyClass · 0.70
ndimMethod · 0.45

Tested by

no test coverage detected