MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / log_sum_exp

Function log_sum_exp

imperative/python/test/unit/functional/test_loss.py:133–135  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

131 return np.log(np.maximum(x, eps))
132
133 def log_sum_exp(x, y):
134 x, y = np.maximum(x, y), np.minimum(x, y)
135 return x + np.log1p(np.exp(y - x))
136
137 len_pred, alphabet_size = pred.shape
138 (len_label,) = label.shape

Callers 1

_ctc_npy_single_seqFunction · 0.85

Calls 2

log1pMethod · 0.45
expMethod · 0.45

Tested by

no test coverage detected