returnn icon indicating copy to clipboard operation
returnn copied to clipboard

MDLSTM in TensorFlow backend

Open selcouthlyBlue opened this issue 7 years ago • 7 comments

I want to use tensorflow as the backend in training the models. How do I switch from Theano to Tensorflow?

selcouthlyBlue avatar Apr 07 '17 01:04 selcouthlyBlue

Basically, you just need to put use_tensorflow = True in your config.

Note that not all layers are implemented currently in the TF backend. So far, the linear/forward layer and the rec layer with LSTM should work. Other layers are limited and also might have slightly different options, e.g. the conv layer. Maybe post your config here so I can have a quick look.

albertz avatar Apr 07 '17 06:04 albertz

I'm using the config_real in the MDLSTM demo for IAM

selcouthlyBlue avatar Apr 07 '17 11:04 selcouthlyBlue

So that config file I guess. Most of the layers are not yet available in TF, i.e. there is no 1Dto2D, conv2, mdlstm. 1Dto2D and conv2 should be easy to replace with the existing TF layers, I think (or it would not require much work otherwise). mdlstm is not so simple to adapt to TF and would require some work. This is planned but no-one currently works on it.

albertz avatar Apr 07 '17 11:04 albertz

It's a pity that this functionality is not available yet, it would be very interesting having MDLSTM supported by TF. I look forward to this new feature.

wellescastro avatar May 03 '17 02:05 wellescastro

I want to use tensorflow backend, but i only see config for 'train' . how to build config file, eval data for 'forward'?

lannp avatar May 29 '17 08:05 lannp

@lannp Where are you looking at? Here are configs for training (config_real) as well as forwarding (config_fwd). Anyway, TensorFlow is not supported at all right now for MDLSTM. Feel free to contribute!

albertz avatar May 30 '17 12:05 albertz

This is not about any or the official pure TF implementation. This is about our own CUDA kernel, which should be much faster.

albertz avatar Dec 07 '17 07:12 albertz