sherjilozair / char-rnn-tensorflow

Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
MIT License
2.64k stars 964 forks source link

Use most fequent character as prime instead of ' ' to not fail on mod… #98

Closed Jaspi10 closed 6 years ago

Jaspi10 commented 7 years ago

Fixes #97 by not using ' ' as default prime, which fails if its not in the vocabulary of the model and instead choosing the most frequently used character in the model.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.06%) to 92.776% when pulling 6636e1c8e60d21c8b8b3dd8def1e475040955c46 on Jaspi10:master into 5029173fc6ad527545082abcaf6c267061825484 on sherjilozair:master.

SRombauts commented 7 years ago

Looks good to me.

One other way would be to let "space" be the default (or something invisible like an end of line "\n") but to check if it is in the vocab before trying to use it (and switch on the most frequent one)