All Projects → ml5js → training-charRNN

ml5js / training-charRNN

Licence: other
Training charRNN model for ml5js

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to training-charRNN

Pytorch Seq2seq
Tutorials on implementing a few sequence-to-sequence (seq2seq) models with PyTorch and TorchText.
Stars: ✭ 3,418 (+3828.74%)
Mutual labels:  rnn
danifojo-2018-repeatrnn
Comparing Fixed and Adaptive Computation Time for Recurrent Neural Networks
Stars: ✭ 32 (-63.22%)
Mutual labels:  rnn
STAR Network
[PAMI 2021] Gating Revisited: Deep Multi-layer RNNs That Can Be Trained
Stars: ✭ 16 (-81.61%)
Mutual labels:  rnn
Har Stacked Residual Bidir Lstms
Using deep stacked residual bidirectional LSTM cells (RNN) with TensorFlow, we do Human Activity Recognition (HAR). Classifying the type of movement amongst 6 categories or 18 categories on 2 different datasets.
Stars: ✭ 250 (+187.36%)
Mutual labels:  rnn
deeplearning.ai notes
📓 Notes for Andrew Ng's courses on deep learning
Stars: ✭ 73 (-16.09%)
Mutual labels:  rnn
machine learning
机器学习、深度学习、NLP实战项目
Stars: ✭ 123 (+41.38%)
Mutual labels:  rnn
Lightnet
Efficient, transparent deep learning in hundreds of lines of code.
Stars: ✭ 243 (+179.31%)
Mutual labels:  rnn
Predicting-Next-Character-using-RNN
Uses RNN on the Nietzsche dataset
Stars: ✭ 15 (-82.76%)
Mutual labels:  rnn
Online-Signature-Verification
Online Handwriting Signature Verification using CNN + RNN.
Stars: ✭ 16 (-81.61%)
Mutual labels:  rnn
rnn-theano
RNN(LSTM, GRU) in Theano with mini-batch training; character-level language models in Theano
Stars: ✭ 68 (-21.84%)
Mutual labels:  rnn
Deepjazz
Deep learning driven jazz generation using Keras & Theano!
Stars: ✭ 2,766 (+3079.31%)
Mutual labels:  rnn
deep-learning-notes
🧠👨‍💻Deep Learning Specialization • Lecture Notes • Lab Assignments
Stars: ✭ 20 (-77.01%)
Mutual labels:  rnn
presidential-rnn
Project 4 for Metis bootcamp. Objective was generation of character-level RNN trained on Donald Trump's statements using Keras. Also generated Markov chains, and quick pyTorch RNN as baseline. Attempted semi-supervised GAN, but was unable to test in time.
Stars: ✭ 26 (-70.11%)
Mutual labels:  rnn
Crnn Pytorch
Pytorch implementation of CRNN (CNN + RNN + CTCLoss) for all language OCR.
Stars: ✭ 248 (+185.06%)
Mutual labels:  rnn
Motor-Imagery-Tasks-Classification-using-EEG-data
Implementation of Deep Neural Networks in Keras and Tensorflow to classify motor imagery tasks using EEG data
Stars: ✭ 67 (-22.99%)
Mutual labels:  rnn
Nlstm
Nested LSTM Cell
Stars: ✭ 246 (+182.76%)
Mutual labels:  rnn
Selected Stories
An experimental web text editor that runs a LSTM model while you write to suggest new lines
Stars: ✭ 39 (-55.17%)
Mutual labels:  rnn
nemesyst
Generalised and highly customisable, hybrid-parallelism, database based, deep learning framework.
Stars: ✭ 17 (-80.46%)
Mutual labels:  rnn
TCN-TF
TensorFlow Implementation of TCN (Temporal Convolutional Networks)
Stars: ✭ 107 (+22.99%)
Mutual labels:  rnn
Market-Trend-Prediction
This is a project of build knowledge graph course. The project leverages historical stock price, and integrates social media listening from customers to predict market Trend On Dow Jones Industrial Average (DJIA).
Stars: ✭ 57 (-34.48%)
Mutual labels:  rnn

Training a charRNN and using the model in ml5js

Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow and modified to work with tensorflow.js and ml5js

Based on char-rnn-tensorflow.

Requirements

Usage

Collect data

RNNs work well when you want predict sequences or patterns from your inputs. Try to gather as much input text data as you can. The more the better. Compile all of the text data into a single text file and make note of where the file is stored (path) on your computer.

(A quick tip to concatenate many small disparate .txt files into one large training file: ls *.txt | xargs -L 1 cat >> input.txt)

Set-up Python Environment

This first step of using a python "virtual environment" (venv video tutorial) is recommended but not required.

$ python3 -m venv your_venv_name
$ source your_venv_name/bin/activate

Train model

Note you can also download this repo as an alternative to git clone.

$ git clone https://github.com/ml5js/training-charRNN
$ cd training-charRNN
$ pip install -r requirements.txt
$ python train.py --data_path /path/to/data/file.txt

Optionally, you can specify the hyperparameters you want depending on the training set, size of your data, etc:

python train.py --data_path ./data \
--rnn_size 128 \
--num_layers 2 \
--seq_length 50 \
--batch_size 50 \
--num_epochs 50 \
--save_checkpoints ./checkpoints \
--save_model ./models

When training is complete a JavaScript version of your model will be available in a folder called ./models (unless you specify a different path.)

Once the model is ready, you'll just need to point to it in your ml5 sketch, for more visit the charRNN() documentation.

const charRNN = new ml5.charRNN('./models/your_new_model');

That's it!

Hyperparameters

Given the size of the training dataset, here are some hyperparameters that might work:

  • 2 MB:
    • rnn_size 256 (or 128)
    • num_layers 2
    • seq_length 64
    • batch_size 32
    • output_keep_prob 0.75
  • 5-8 MB:
    • rnn_size 512
    • num_layers 2 (or 3)
    • seq_length 128
    • batch_size 64
    • dropout 0.25
  • 10-20 MB:
    • rnn_size 1024
    • num_layers 2 (or 3)
    • seq_length 128 (or 256)
    • batch_size 128
    • output_keep_prob 0.75
  • 25+ MB:
    • rnn_size 2048
    • num_layers 2 (or 3)
    • seq_length 256 (or 128)
    • batch_size 128
    • output_keep_prob 0.75

Note: output_keep_prob 0.75 is equivalent to dropout probability of 0.25.

Additional resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].