crnn icon indicating copy to clipboard operation
crnn copied to clipboard

Is there any possible to use cudnn.BLSTM to replace bidirectionalLSTM and use Baidu's warp_ctc to replace CtcCriterion?

Open ll36771 opened this issue 7 years ago • 6 comments

Is there any possible to use cudnn.BLSTM to replace bidirectionalLSTM and use Baidu's warp_ctc to replace CtcCriterion?Thus i can use cudnn to boost the system.

ll36771 avatar Sep 06 '16 03:09 ll36771

@bgshih

ll36771 avatar Sep 06 '16 03:09 ll36771

@ll36771 I haven't tested warp_ctc yet, but I guess they implement the same algorithm. cudnn.BLSTM should also be a better choice. Please let me know if you find them workable, thanks!

bgshih avatar Sep 06 '16 14:09 bgshih

Hello! I have a little question about the bidirectionalLSTM, where is this function defined? Is it existed in some other libs? Thank you!

shengyudingli avatar Sep 26 '16 12:09 shengyudingli

@shengyudingli you can get cudnn.BLSTM from https://github.com/soumith/cudnn.torch

ll36771 avatar Sep 26 '16 13:09 ll36771

@ll36771 : Could you use cudnn.BLSTM in CRNN successfully? I tried to use it sometime back but couldn't use it successfully. Will try it again soon so any pointer will be appreciated.

ravikantb avatar Oct 21 '16 08:10 ravikantb

@bgshih @ravikantb :I use the cudnn.BLSTM and CtcCriterion.But when i train the picture,the loss will stop at around 44 and accuracy is 0.

model:add(cudnn.BLSTM(512, nl/2, 2, true)) --nl is 38 model:add(nn.SplitTable(2, 3)) map = nn.MapTable() map:add(nn.LogSoftMax()) model:add(map) model:add(nn.JoinTable(2)) model:add(nn.View(nt,nl)) model:add(nn.Copy('torch.CudaTensor', 'torch.FloatTensor', false, true)) model:cuda()

When i try the cudnn.BRNN instead of cudnn.BLSTM,it works.But the accuracy is not very high.In theory,LSTM should works better than RNN.

ll36771 avatar Oct 21 '16 08:10 ll36771