Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Add documentation to LogSumExp
Browse files Browse the repository at this point in the history
Added some documentation to LogSumExp noting that it should be used in
place of Gorgonia's LogSumExp, which calculates the values incorrectly
  • Loading branch information
samuelfneumann committed Sep 24, 2021
1 parent d8fb213 commit 3161ba8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/op/op.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ func AddFauxF32(n *G.Node) (retVal *G.Node, err error) {

// LogSumExp calculates the log of the summation of exponentials of
// all logits along the given axis.
//
// Use this in place of Gorgonia's LogSumExp, which has the final sum
// and log interchanged, which is incorrect.
func LogSumExp(logits *G.Node, along int) *G.Node {
max := G.Must(G.Max(logits, along))

Expand Down

0 comments on commit 3161ba8

Please sign in to comment.