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

Method EvaluateOnBatch

src/model/feed_forward_net.cc:269–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269std::pair<Tensor, Tensor> FeedForwardNet::EvaluateOnBatch(const Tensor& x,
270 const Tensor& y) {
271 int flag = kEval;
272 const Tensor fea = Forward(flag, x);
273 const Tensor l = loss_->Forward(flag, fea, y);
274 const Tensor m = metric_->Forward(fea, y);
275 return std::make_pair(l, m);
276}
277
278const Tensor FeedForwardNet::Predict(const Tensor& x, size_t batchsize) {
279 CHECK_GE(x.shape(0), batchsize);

Callers 1

TestOneEpochFunction · 0.80

Calls 1

ForwardMethod · 0.45

Tested by 1

TestOneEpochFunction · 0.64