(x, t)
| 1255 | |
| 1256 | |
| 1257 | def 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 | |
| 1266 | class RankingLoss(Operator): |
nothing calls this directly
no test coverage detected