Skip to content

Commit 1584f86

Browse files
authored
Update softmax.jl
1 parent c514d05 commit 1584f86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/softmax.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ end
5959
logsoftmax(xs) = log.(exp.(xs) ./ sum(exp.(xs)))
6060
6161
`logsoftmax(xs)` computes the log of `softmax(xs)`, but in a more numerically stable
62-
way than directly taking the log of the the softmax function, which is commonly used in
62+
way than directly taking the log of the softmax function, which is commonly used in
6363
computing cross entropy loss.
6464
"""
6565
logsoftmax(xs) = logsoftmax!(similar(xs), xs)
@@ -82,4 +82,4 @@ function logsoftmax!(out::AbstractVecOrMat, xs::AbstractVecOrMat)
8282
return out
8383
end
8484
∇logsoftmax(Δ, xs) = ∇softmax./ max.(eps(eltype(xs)),softmax(xs)), xs)
85-
∇logsoftmax!(Δ, xs) = ∇softmax!(Δ, Δ, xs)
85+
∇logsoftmax!(Δ, xs) = ∇softmax!(Δ, Δ, xs)

0 commit comments

Comments
 (0)