Update cross_entropy_loss.py
This commit is contained in:
parent
9f926ced28
commit
30cdf652d3
1 changed files with 1 additions and 1 deletions
|
|
@ -232,7 +232,7 @@ def _cross_entropy_backward(
|
|||
pass
|
||||
|
||||
# Do logit softcapping for Gemma 2: t * tanh(1/t * x)
|
||||
partial = 0.0
|
||||
partial = x
|
||||
if DO_SOFTCAPPING:
|
||||
# d/dx [t * tanh(1/t * x)] = 1 - tanh^2(1/t * x)
|
||||
partial = triton_tanh(x / SOFTCAP)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue