Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.68 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.68 KB

Basic LSTM on regular expression languages

Create a regular expression language and run the LSTM.

This project is made in order to test LSTM capabilities.

Usage example

  1. Generate train and dev sets.
    gen_examples.py is an example on how to create a language.

    The script gen_examples.py will create regular expression samples for the language:
    [0-9]+a+[0-9]+b+[0-9]+c+[0-9]+d+[0-9]+

    Parameters:
    samples_file – the file which the samples will be writen to.
    num_samples – number of samples to generate.
    seq_max – maximum length of each contiguous sequence, for example a+ will be a sequence of random number of a
    in range [1, seq_max].

    example:
    python gen_examples.py data/train 1000 50
  2. Train the LSTM model on the language.
    Run basicLSTM.py on the data you created and check the results.

    Parameters:
    train_samples – train samples file.
    dev_samples – dev samples file.

    example:
    python basicLSTM.py data/train data/dev

Build With

  • PyTorch – the deep learning platform used

Author

Bar Katz – bar-katz on github[email protected]

Contributing

  1. Fork it (https://github.com/bar-katz/Basic_RNN/fork)
  2. Create your feature branch (git checkout -b feature)
  3. Commit your changes (git commit -am 'add feature')
  4. Push to the branch (git push origin feature)
  5. Create a new Pull Request

    Share your results!
    Found a language LSTM can not learn try to understand why and add your language description to languages directory.