r"""Log-sum-exp reduction compatible with autograd (no numpy implementation)
(M, axis)
| 54 | |
| 55 | |
| 56 | def logsumexp(M, axis): |
| 57 | r"""Log-sum-exp reduction compatible with autograd (no numpy implementation)""" |
| 58 | amax = np.amax(M, axis=axis, keepdims=True) |
| 59 | return np.log(np.sum(np.exp(M - amax), axis=axis)) + np.squeeze(amax, axis=axis) |
| 60 | |
| 61 | |
| 62 | def sinkhorn_log(w1, w2, M, reg, k): |
no test coverage detected