MCPcopy Create free account
hub / github.com/deepbrainai-research/float / get_posi_angle_vec

Function get_posi_angle_vec

models/float/FMT.py:29–30  ·  view source on GitHub ↗
(position)

Source from the content-addressed store, hash-verified

27 return position / (10000 ** (2 * (hid_idx // 2) / d_hid))
28
29 def get_posi_angle_vec(position):
30 return [cal_angle(position, hid_j) for hid_j in range(d_hid)]
31
32 sinusoid_table = torch.Tensor([get_posi_angle_vec(pos_i) for pos_i in range(n_position)])
33 sinusoid_table[:, 0::2] = torch.sin(sinusoid_table[:, 0::2]) # dim 2i

Callers 1

Calls 1

cal_angleFunction · 0.85

Tested by

no test coverage detected