Manipulating vectors with logsumexp

logsumexp takes an iterator as its argument, so this works

f(d) = logsumexp(d) .- ( logsumexp( (d[i] for i in eachindex(d) if i!=j) ) for j in eachindex(d) )
2 Likes