question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ignore_index defined but not used

See original GitHub issue

ignore_indexis 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adrian-spatarucommented, Feb 26, 2021

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?

0reactions
afiaka87commented, Mar 9, 2021

Can probably close this one, right? Sorry, the issues are super scattered currently.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found