You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the code. It gives me a base for mine.
I just tested the following implementation for the position embedding in custom/layers. It works faster so I offer you my solution. The difference in results due to numerical approx is < e^-12.
pos_emb = np.zeros((max_seq, embedding_dim))
for index in range(0, d_emb,2):
pos_emb[:, index] = np.array([m.sin(pos/10000**(index/embedding_dim))
for pos in range(max_seq)])
pos_emb[:, index+1] = np.array([m.cos(pos/10000**(index/embedding_dim))
for pos in range(max_seq)])
return pos_emb
The text was updated successfully, but these errors were encountered:
Hi,
Thanks for the code. It gives me a base for mine.
I just tested the following implementation for the position embedding in custom/layers. It works faster so I offer you my solution. The difference in results due to numerical approx is < e^-12.
The text was updated successfully, but these errors were encountered: