MCPcopy Create free account
hub / github.com/Tencent/NeuralNLP-NeuralClassifier / get_posi_angle_vec

Method get_posi_angle_vec

model/embedding.py:234–235  ·  view source on GitHub ↗
(position)

Source from the content-addressed store, hash-verified

232 return position / np.power(10000, 2 * (hid_idx // 2) / d_hid)
233
234 def get_posi_angle_vec(position):
235 return [cal_angle(position, hid_j) for hid_j in range(d_hid)]
236
237 sinusoid_table = np.array(
238 [get_posi_angle_vec(pos_i) for pos_i in range(n_position)])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected