ignore_index defined but not used
See original GitHub issueignore_index
is defined but not used.
I assume the purpose is to ignore the padding from the text. If that’s the case, then instead of using:
F.cross_entropy(rearrange(logits, 'b n c -> b c n'), labels)
We have to define a nn.Module Cross_entropy
self.loss = nn.CrossEntropyLoss(reduction='none', ignore_index=self.ignore_index)
and then
self.loss(rearrange(logits, 'b n c -> b c n'), labels)
Finally the default value of ignore_index should be 0. Since thats the pad_id of the default tokenizer.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Function defined but not used warning in C
"Function defined but not used" warning is only issued for functions with internal linkage, i.e. functions that are declared as static .
Read more >IGNORE INDEX - MariaDB Knowledge Base
The benefit of using IGNORE_INDEX instead of USE_INDEX is that it will not disable a new index which you may add later. Also...
Read more >MySQL 8.0 Reference Manual :: 8.9.4 Index Hints
The alternative syntax IGNORE INDEX ( index_list ) tells MySQL to not use some particular index or indexes. These hints are useful if...
Read more >Create and use an index to improve performance
Index one or more table fields in Access by using the table designer. Also covers automatic index creation, viewing, and deleting.
Read more >Documentation: 15: 11.8. Partial Indexes
Another possible use for a partial index is to exclude values from the index that the typical query workload is not interested in;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just realized. We would ignore also the VQVAE codebook with id of 0. Should we just change the padding in the tokenizer to a negative value?
Can probably close this one, right? Sorry, the issues are super scattered currently.