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

Method train_one_batch

examples/rnn/char_rnn.py:73–78  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

71 return self.dense(x)
72
73 def train_one_batch(self, x, y):
74 out = self.forward(x)
75 y = self.reshape2(y, (-1, 1))
76 loss = self.softmax_cross_entropy(out, y)
77 self.optimizer(loss)
78 return out, loss
79
80 def get_states(self):
81 ret = super().get_states()

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.95

Tested by

no test coverage detected