Comments (4)
Sorry for my late response. You can save the attention weights during testing
from asformer.
ok, thanks for the reply.
Just to be sure the attention weight are the 'attention' matrix of the following line of code, right?
output, attention = self.att_helper.scalar_dot_att(q, k, v, final_mask)
In my case I extracted them from the '_sliding_window_self_att(self, q, k, v, mask)' function.
Thanks
from asformer.
I am asking because I find that most of the time if an encoder find a strong attention to some frames inside his windows, the enoder of the next block will give 0 (red cross) attention for the same frames. As you can see from the image below. So maybe I am extract the attention weight in the wrong way. This is the code I use to extract them:
att_weight = attention.reshape([attention.shape[0] * attention.shape[2], attention.shape[1]])
save_dir_att = 'attention_weight'
torch.save(att_weight, save_dir_att + '/att_weigth_window_size_' + str("%03d" % (b.shape[1],)) + '.t')
the code is inside the '_sliding_window_self_att(self, q, k, v, mask)' function
from asformer.
Sorry to bother you again, but there is a reason behind it or is it just that I am extracting the attention weights in the wrong way? Thanks for your time
from asformer.
Related Issues (17)
- cross-self attention HOT 1
- about the randomness of code HOT 1
- Error in evaluation code HOT 2
- Feature Extraction HOT 3
- Enviroment issues HOT 1
- The provided models generate lower scores than the paper reported HOT 3
- How to understand stage images from result HOT 6
- Issue while trying to run the pretained models.
- attention实现的问题 HOT 5
- flops,GPU mem code HOT 4
- Long training time HOT 2
- Batch size constraint HOT 6
- Cannot download the model HOT 2
- pre-extracted feature HOT 1
- results on salads50 does not match table 5 HOT 3
- Increase the batchsize and the result is hurt HOT 2
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 asformer.