You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/02 06:24:55 UTC

[GitHub] kevinthesun commented on issue #8908: How to use an LSTM Layer in CNN?

kevinthesun commented on issue #8908: How to use an LSTM Layer in CNN?
URL: https://github.com/apache/incubator-mxnet/issues/8908#issuecomment-348672171
 
 
   You can try Gluon API, which is more flexible for such kind of complicate network.
   A simple sketch example for your network:
   ```python
   class CNNLSTM(HybridBlock):
       def __init__(self, ...):
           self.cnn_block = ...
           self.lstm_block = mxnet.gluon.rnn.LSTM(...)
           self.fc_block = ...
   
       def hybrid_forward(F, x):
           y1 = self.cnn_block(x)
           y2 = self.lstm_block(y1)
           y3 = F.concat(y1, y2)
           z = self.fc_block(y3)
           return z
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services