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

Method train_one_batch

test/python/test_model.py:67–71  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

65 return y
66
67 def train_one_batch(self, x, y):
68 y_ = self.forward(x)
69 l = self.loss(y_, y)
70 self.optim(l)
71 return y_, l
72
73 def loss(self, out, ty):
74 return autograd.softmax_cross_entropy(out, ty)

Callers 1

Calls 3

forwardMethod · 0.95
lossMethod · 0.95
optimMethod · 0.95

Tested by

no test coverage detected