tmbdev / clstm

A small C++ implementation of LSTM networks, focused on OCR.
Apache License 2.0
821 stars 224 forks source link

How to use CNN feature sequence as training data? #33

Closed stevefly closed 9 years ago

stevefly commented 9 years ago

@tmbdev I have a question about is this clstm suitable for Scene Text Recongnition. I extract feature sequence from raw images(use CNN), Now, I want use the CNN feature sequence to train the blstm+ctcRNN,but I don't know how to create the .h5 file for training(use the CNN feature sequence). Can you provide an example? ss2

tmbdev commented 9 years ago

You don't really have to use the HDF5 format (in fact, it's not being built by default anymore). If you want to see how the HDF5 files are being written, look in lstm-uw3-py.ipynb (an iPython Notebook).

It's probably easier for you just to use the C++ interface. If your CNN is already trained, you can just put the data into a Sequence object; the indexes are sequence[timestep][feature,batch]

If you want to train the CNN and the CLSTM simultaneously, the CLSTM will backpropagate deltas for you that you can connect to your CNN library; after backward(), the deltas are in net->d_inputs.

ericustc commented 8 years ago

"if you want to train the CNN and the CLSTM simultaneously, the CLSTM will backpropagate deltas for you that you can connect to your CNN library; after backward(), the deltas are in net->d_inputs", where are the deltas in the new code?

jbaiter commented 8 years ago

I think they're in Batch::d (see e.g. the usage in ocropus::share_deltas)