BiLSTM for sequence to sequence G2P conversion (DNN)

2 views (last 30 days)
Hello all,
I would like to input a sequence to a BiLSTM model and also output a sequence. But I am not able to find any document on how to input to a BiLSTM model on MATLAB. Please let me know on how to feed the network and how to set the parameters.
Regards and thanks in advance!

Answers (1)

Asvin Kumar
Asvin Kumar on 2 Aug 2019
You can use the sequenceInputLayer to input a sequence to the bilstmLayer. To output a sequence set the ‘OutputMode’ parameter to ‘sequence’.
The help page for the sequenceInputLayer is:
For an example on using the layer to input a sequence, have a look at:
For an example on having a sequence as an output, have a look at:
  2 Comments
mariam mughees
mariam mughees on 12 Oct 2021
If i dont have deep learning tool for matlab can i simulate LSTM on set up as i have 2017b version of MATLAB.Can any one please guide?
Cy 'kkm' K'Nelson
Cy 'kkm' K'Nelson on 5 Jul 2022
Edited: Cy 'kkm' K'Nelson on 5 Jul 2022
@mariam mughees, not a MATLAB answer, but yes, sure. Just use other tools, there are plenty open-source high-quality frameworks around. Arguably, the two most popular are TensorFlow and PyTorch. TF has subsumed another framework, Keras, that is as simple to use as MATLAB DNN toolbox (I never used one, but it looks similar from Asvin's links), so you can try it first. Google has a Web site https://colab.research.google.com/, with a Jupyter-like interface, where you can run experiments for free, even with a GPU (training time is generous but limited, tho), and TF is even preinstalled, so you just open it and start playing. Your Jupyter-compatible notebooks are stored at your Google Drive. https://www.tensorflow.org/ has very detailed tutorials on Keras, which I suggest for its simplicity and potential to port model back to MATLAB, if it comes to that, which also apparently expresses models as a stack of predefined layers. If you understand DNN, you'll Keras at a rocked speed in a day, it's very simple to use.
I think you did this, but just in case, google for "G2P DNN" (no quotes), and you'll find papers on existing implementations.
Beware that BLSTMs are a pig to train, and converge slowly. Transformers are naturally a good choice for G2P, as both words and prons have a known maximum length.
G'luck!

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!