MCPcopy Create free account
hub / github.com/clab/dynet / predict

Method predict

examples/document-classification/train_imdb.cc:85–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 }
84
85 unsigned predict(ComputationGraph & cg, Instance & inst) {
86 Expression logits = classify(cg, inst);
87 std::vector<float> pred = dynet::as_vector(cg.get_value(logits));
88 return std::max_element(pred.begin(), pred.end()) - pred.begin();
89 }
90
91 unsigned get_max_steps(const Instance & inst) {
92 unsigned max_steps = 0;

Callers 1

mainFunction · 0.45

Calls 1

as_vectorFunction · 0.85

Tested by

no test coverage detected