wzlxjtu / positionalencoding2d Goto Github PK
View Code? Open in Web Editor NEWA PyTorch implementation of the 1d and 2d Sinusoidal positional encoding/embedding.
A PyTorch implementation of the 1d and 2d Sinusoidal positional encoding/embedding.
Hi, I think this work for 2D positional encoding is beautiful and helpful for when dealing with image data. I wonder if the 2D positional encoding is your original work or from a published paper? Thanks a lot!
https://github.com/wzlxjtu/PositionalEncoding2D/blob/master/positionalembedding2d.py#L16
dim_term = 1 / np.power(10000, (2 * (i//2)) / np.float32(d_model))
why not use the above code is clearer
can u clarify in a example of when we are tryin to train a model with 3 different attribute of length 10 with 8head attention which one is which?
I know this is kind of a dumb question as original positional encoding was designed to be only applicable for even number of tokens. But still is there absolutely no way to solve this?
The layout of 2d is interleaving in the matrix.
However, I would like to ask whether 3D is applicable?
Thanks,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.