Skip to content

Commit

Permalink
convert .ml.tanh to a composition to match .ml.sigmoid
Browse files Browse the repository at this point in the history
  • Loading branch information
psaris committed Jul 14, 2020
1 parent ba8c621 commit f3e17ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ml.q
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ linear:(::) / linear
dlinear:{1f+0f*$[99h=type x;x`z;x]} / linear gradient
sigmoid:1f%1f+exp neg:: / sigmoid
dsigmoid:{x*1f-x:$[99h=type x;x`a;sigmoid x]} / sigmoid gradient
tanh:{1f-2f%1f+exp 2f*x} / hyperbolic tangent
tanh:1f-2f%1f+exp 2f* / hyperbolic tangent
dtanh:{1f-x*x:$[99h=type x;x`a;tanh x]} / hyperbolic tangent gradient
relu:0f| / rectified linear unit
drelu:{"f"$0f<=$[99h=type x;x`z;x]} / rectified linear unit gradient
Expand Down

0 comments on commit f3e17ac

Please sign in to comment.