Comments (4)
@sentialx if everything in the second segment batch were the ignore index (zero in your case), it would be nan
, but because there is [1, 2, 0, 0]
you are still ok
from recurrent-memory-transformer-pytorch.
@sentialx hey Eryk! that should be handled if you pad your sequences with the ignore_index
, which i have set to -1
but is configurable
from recurrent-memory-transformer-pytorch.
@lucidrains Thanks for your response, but what happens if a text has 4 segments and the second text in a batch has 2 segments? This means that the two remaining segments in the second batch slot are just filled with paddings to match the longest text, and there will be no predicted tokens, right?
To visualize this, here we have a tensor of shape (batch_size=2, segments=2, seq_len=5) and items are token ids:
[
[
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 0]
],
[
[1, 2, 0, 0]
[0, 0, 0, 0] <- loss should be nan I think?
]
]
from recurrent-memory-transformer-pytorch.
@lucidrains one more question, did you have a chance to compare it with block recurrent?
from recurrent-memory-transformer-pytorch.
Related Issues (19)
- causal mask assert hit HOT 25
- Question: configuring scaled_dot_product_attention
- Attend : check mask isn't already 4D HOT 1
- Question: how does memory replay backprogagation work with multiple models in series HOT 8
- Question: why do we need read_memory_emb HOT 6
- Question: masks HOT 3
- Feature request: make JIT and ONNX export work HOT 4
- Question: Global write tokens or recurrent HOT 7
- Bug: resiDual implementation HOT 3
- Question: first read memories HOT 12
- flash attention, and a potentially better improvement HOT 5
- What is the reasoning for no dropout? HOT 2
- Implement RMT-R (New Paper feature to RMTs)
- token_shift HOT 4
- bptt depth implementation? HOT 3
- have you had a chance to train it yet? HOT 2
- Question: How to set seq_len ? HOT 1
- Question: how to adapt this for CTC loss 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 recurrent-memory-transformer-pytorch.