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

Method Evaluate

include/singa/model/loss.h:52–55  ·  view source on GitHub ↗

Average loss values for all samples in the mini-batch It calls Forward() internally. The calling pattern should be [Evaluate|Forward] Backward.

Source from the content-addressed store, hash-verified

50 /// It calls Forward() internally. The calling pattern should be
51 /// [Evaluate|Forward] Backward.
52 float Evaluate(int flag, const Tensor &prediction, const Tensor &target) {
53 Tensor loss = Forward(flag, prediction, target);
54 return Sum<float>(loss) / (1.0f * loss.Size());
55 }
56
57 /// Compute the gradients of the loss values w.r.t. the prediction.
58 virtual Tensor Backward() = 0;

Callers

nothing calls this directly

Calls 1

SizeMethod · 0.45

Tested by

no test coverage detected