Comments (6)
Just read this. That's what I have!
Okay, so maybe I was not able to understand the implementation... You're saying that if the user passes both an input and a key parameter to the model like decoder(yi, keys = enc_keys)
then your implementation will apply masked self-attention to yi
, then apply non-masked regular attention over enc_keys
?
If that's so, it's really awesome, and then this issue makes no sense and you could close it.
Again, thanks for your awesome work!! I am currently using your library for a couple of projects and it definitely works like a charm.
from reformer-pytorch.
Oh, seems like a clever approach 😮 thank you!
from reformer-pytorch.
@pabloppp Good observations! In the past, for simplicity's sake, I have combined the self-attention and "regular" attention, into one layer, which has worked for me for a number of tasks, although I have not done a head to head comparison with the original architecture. To keep the readme concise, and to make the reversible architecture work (it only accepts two functions F and G), I kept it the simplified way. However, I wouldn't oppose trying to be more faithful to the original architecture, but it would require some decisions on the reversible net, and which 2 of the now 3 components to be slotted into F and G.
from reformer-pytorch.
(The most faithful reproduction would be to do self-attention + feedforward and then regular-attention + feedforward, alternating in that manner.)
from reformer-pytorch.
Would it make sense to allow the choice to combine self-attention (k == v == q), where the mask should be applied if we want it to be causal, with regular attention(q != k == v) using the passed keys, where causality no longer makes a lot of sense because we might want to be able to focus on a word at the end of the sentence if the language has a different word ordering?
Just read this. That's what I have!
from reformer-pytorch.
@pabloppp yes, exactly, except they are done in one layer in the same attention matrix. each token attends to all tokens of the past as well as the enc_keys
from reformer-pytorch.
Related Issues (20)
- TOKEN_SELF_ATTN_VALUE and QK attention
- Music Reformer results (some problems) HOT 1
- The exact English pretraining data and Chinese pretraining data that are exact same to the BERT paper's pretraining data.
- Image as input
- why lucidrains use reformerlm as pre train model?
- Class token implementation HOT 1
- Error while testing Code in Readme HOT 2
- Is the argument max_seq_len in Reformer() used? HOT 1
- Reversible layers increase memory usage HOT 1
- self-supervised.py Training Script is it worthwhile pretokenizing ?
- fp16 support
- About sequence length
- Default embeddings are rotary Embeddings not Axialpositional Embeddings as stated by the documentation HOT 1
- error in eval loss & ppl
- half precision on long sequence doesn't work HOT 3
- FLOPs calculation for LSHSelfAttention in LSH mode and Full attention mode
- not find axial_positional_embedding.py HOT 2
- ImportError: cannot import name 'amp' from 'apex' HOT 1
- how to get the dataset of enwik8.gz ?
- Is the unsort logits necessary?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reformer-pytorch.