-2

while finding a square-root, we perform number**0.5, but what is the meaning of - sign before 0.5.

I was looking at a code (I was specificially looking at ViT Code, and here for scaling, they have added:

self.scale = self.head_dim ** -0.5

Please help me understanding it meaning. I did few experiments on my terminal but did not understand what's happening:

>>> a = 4
>>> a**0.5
2.0
>>>
>>> a**-0.5
0.5
M Z
  • 4,571
  • 2
  • 13
  • 27

1 Answers1

2

Reciprocal. x**-n == 1/(x**n).......

Ry-
  • 218,210
  • 55
  • 464
  • 476
Mark Adler
  • 101,978
  • 13
  • 118
  • 158