mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 14:42:29 -05:00
[GH-ISSUE #1154] [Module 2] GELU function hint typo #1710
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @oscarf189 on GitHub (Feb 4, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1154
1a80e57fa0/tinytorch/src/02_activations/02_activations.py (L618C1-L619C1)This hint here says "The 1.702 constant comes from √(2/π) approximation", but √(2/π) = 0.79...
I believe that the 1.702 comes from the tanh used in the GELU paper, which approximates the function to be 0.5x(1 + tanh[√(2/π)(x + 0.044715x^3)... then the next line of the paper does mention the sigmoid approximation, but the number doesn't come from this?
In other words, maybe drop the hint? Or change the module to use tanh instead?