Comments (5)
Hi,
Recently, I write a greedy decoding for transducer:
def greedy_decode(self, batch):
x, y, x_lens, y_lens = self.collate(*batch)
x = self.encode(x)[0]
vy = autograd.Variable(torch.LongTensor([0]), volatile=True).view(1,1) # vector preserve for embedding
y, h = self.dec_rnn(autograd.Variable(torch.zeros((1, 1, 256)), volatile=True)) # decode first zero
y_seq = []; logp = 0
for i in x:
out = self.fc1(i) + self.fc1(y[0][0])
out = nn.functional.relu(out)
out = self.fc2(out)
out = F.log_softmax(out, dim=0)
p, pred = torch.max(out, dim=0)
pred = int(pred); logp += float(p)
if pred != self.blank:
y_seq.append(pred)
vy.data[0][0] = pred # change pm state
y = self.embedding(vy)
y, h = self.dec_rnn(y, h)
return [y_seq]
This code can be placed in your transducer_model.py
file. Here just support one sequence per batch.
After decoding, PER is 24.4% in your training model ( maybe not converged).
It seems that the training PER calculated in the CTC way doesn't make sense.
Beam search would be much better.
from speech.
It seems that the training PER calculated in the CTC way doesn't make sense.
@HawkAaron what do you mean?
from speech.
@smolendawid what you said is exactly what I mean.
Since the CTC transition topology is almost the same with HMM, the greedy search can be treated as viterbi decode. But the transition of RNN Transducer is two dimensional, decode any one of them doesn't make any sense.
from speech.
@HawkAaron your greed decode implement is wrong. this will not find the best path
Here is my implement
you may need some change for your decoder.
from speech.
@Duum That is based on the assumption that one acoustic feature frame has at most one corresponding label.
To find more comparable paths, you can refer to my beam search implementation.
from speech.
Related Issues (20)
- torch type mismatch error HOT 9
- ctc decoder with language model
- Pytest FAILURES
- Word Level LM at Line 96
- WARNING: Forward backward likelihood mismatch 0.000050 HOT 1
- make error from torch.utils.ffi import create_extension HOT 1
- your paper link
- Error in seq2seq.py of Method collate HOT 3
- Sample generation
- Make error HOT 1
- 请问有成功训练出中文汉语模型的么 HOT 1
- make error : system cannot find the path specified
- Out of memory Error HOT 1
- Multi Gpu Training support
- Loss is decrease but SER is increase
- Transducer: zip object is not subscriptable HOT 1
- Could you share your WER on librispeech?
- Make Requires Cuda
- TIMIT PER HOT 2
- Can this model convert Chinese audio to text?
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 speech.