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

Function sparsemax

dynet/expr.cc:126–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124Expression log_softmax(const Expression& x, const vector<unsigned>& d) { return Expression(x.pg, x.pg->add_function<RestrictedLogSoftmax>({x.i}, d)); }
125Expression logsumexp_dim(const Expression& x, unsigned d) { return Expression(x.pg, x.pg->add_function<LogSumExpDimension>({x.i}, d)); }
126Expression sparsemax(const Expression& x) { return Expression(x.pg, x.pg->add_function<Sparsemax>({x.i})); }
127Expression sparsemax_loss(const Expression& x, const vector<unsigned>& target_support) { return Expression(x.pg, x.pg->add_function<SparsemaxLoss>({x.i}, target_support)); }
128Expression sparsemax_loss(const Expression& x, const vector<unsigned>* ptarget_support) { return Expression(x.pg, x.pg->add_function<SparsemaxLoss>({x.i}, ptarget_support)); }
129Expression softmax(const Expression& x, unsigned d) { return Expression(x.pg, x.pg->add_function<Softmax>({x.i}, d)); }

Callers 2

dynet.cppFile · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 1

ExpressionClass · 0.70

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68