teapoly / ctc-optimizedloss Goto Github PK
View Code? Open in Web Editor NEWComputes the MWER (minimum WER) Loss with CTC beam search. Knowledge distillation for CTC loss.
Computes the MWER (minimum WER) Loss with CTC beam search. Knowledge distillation for CTC loss.
why mwer use stop gradient? just a regularization?
Thanks for sharing the codes. Could you provide an example of the o1 loss?
I've combined it with the CTC loss as shown in the following code, but it seems the performance has not improved.
log_probs = nn.functional.log_softmax(logits, dim=-1, dtype=torch.float32).transpose(0, 1)
with torch.backends.cudnn.flags(enabled=False):
loss = nn.functional.ctc_loss(
log_probs,
flattened_targets,
input_lengths,
target_lengths,
blank=self.config.pad_token_id,
reduction=self.config.ctc_loss_reduction, # default: sum, use_focal_loss=none
zero_infinity=self.config.ctc_zero_infinity, # default: false
)
o1_loss = self.o1_loss(log_probs.transpose(0,1),
input_lengths,
labels,
target_lengths,
)
if self.use_o1_loss:
o1_loss /= batch_size
loss = 0.01 * loss + 1. * o1_loss
Thank you very much for share the code.
Is there a pytorch version of mwer loss?
Thankyou very much for share the code, but when I training a model using the CTCMWER loss, it may be negative, sometime? So what's the reason could be?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.