File tree 1 file changed +1
-8
lines changed 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,7 @@ def generate_square_subsequent_mask(sz: int) -> Tensor:
112
112
# The ``math.log(10000.0)`` term in the exponent represents the maximum effective
113
113
# input length (in this case, ``10000``). Dividing this term by ``d_model`` scales
114
114
# the values to be within a reasonable range for the exponential function.
115
- # The negative sign in front of the logarithm ensures that the values decrease exponentially.
116
- # The reason for writing ``math.log(10000.0)`` instead of ``4`` in the code is to make it clear
117
- # that this value represents the logarithm of the maximum effective input length
118
- # (in this case, ``10000``). This makes the code more readable and easier to understand.
119
- # Using ``math.log(10000.0)`` instead of ``4`` also makes it easier to change the maximum effective
120
- # input length if needed. If you want to use a different value for the maximum effective
121
- # input length, you can simply change the argument of the ``math.log``
122
- # function instead of recalculating the logarithm manually.
115
+ #
123
116
124
117
class PositionalEncoding (nn .Module ):
125
118
You can’t perform that action at this time.
0 commit comments