MCPcopy Create free account
hub / github.com/Anoise/WTFlib / get_position_angle_vec

Method get_position_angle_vec

LDPS_Graph/models/Mvstgn.py:582–583  ·  view source on GitHub ↗
(position)

Source from the content-addressed store, hash-verified

580
581 def _get_sinusoid_encoding_table(self, n_position, d_hid):
582 def get_position_angle_vec(position):
583 return [position / np.power(10000, 2 * (hid_j // 2) / d_hid) for hid_j in range(d_hid)]
584
585 sinusoid_table = np.array([get_position_angle_vec(pos_i) for pos_i in range(n_position)])
586 sinusoid_table[:, 0::2] = np.sin(sinusoid_table[:, 0::2])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected