chunml / text-generator Goto Github PK
View Code? Open in Web Editor NEWHaving fun with LSTMs by creating a simple text generator.
License: MIT License
Having fun with LSTMs by creating a simple text generator.
License: MIT License
Hi Trung, I am trying to implement your code, but there is one line I couldn't understand. In the RNN_utils.py, Line 38 and Line 45. I think "X[i] = input_sequence" should be executed after the whole loop of βfor j in range(seq_length)β is finished. In other words, "X[i] = input_sequence" should not be included inside the "for" loop. So does y[i] in Line 45. Is my understanding right? Thanks.
I'm trying to implement the recurrent neural network using Keras but with Tensorflow as the back-end instead of Theano. Is this possible? Any gotchas or tips/tricks are appreciated. Thank you!
Tried to load the model and continue training, it seems like it starts with high loss and the model seems to be totally untrained (start over at epoch 0). The previous trained work seems to be all gone. No error message from loading. Any clue? I upgraded to Keras 2.0.8 from .6, verified the setup of the network (using the same setup code) but no help.
Thanks for sharing.
Are the default parameters in the code the same as those used in your post?
And how large is your training data (Harry Potter series)?
Traceback (most recent call last):
],,NNVEEE,EKKkkkEKkkkqqqqqqqssqsq---rrrr!!!zKKrrrPkkzzKKkkrrKkkkrkKkkqqqqqqqssqsq---rrrr!!!zKKrrrPkk File "C:/Users/username/AppData/Local/Programs/Python/Python36/text-generator-master/text-generator-master/recurrent_keras.py", line 54, in <module>
model.load_weights('')
File "C:\Users\usernameAppData\Local\Programs\Python\Python36\lib\site-packages\keras\models.py", line 721, in load_weights
f = h5py.File(filepath, mode='r')
File "C:\Users\username\AppData\Local\Programs\Python\Python36\lib\site-packages\h5py\_hl\files.py", line 269, in __init__
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "C:\Users\username\AppData\Local\Programs\Python\Python36\lib\site-packages\h5py\_hl\files.py", line 99, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5f.pyx", line 78, in h5py.h5f.open
ValueError: Invalid file name (invalid file name)
Having this error when trying to force the program to load weights. Otherwise, it defaults to epoch 0 and learning progress is lost. The program is still able to create the HDF5 files as intended, it just doesn't load them.
Running the code gives me the following error:
Data length: 3204677 characters
Vocabulary size: 94 characters
Traceback (most recent call last):
File "recurrent_keras.py", line 36, in
X, y, VOCAB_SIZE, ix_to_char = load_data(DATA_DIR, SEQ_LENGTH)
File "/home/boris/text-generator/RNN_utils.py", line 30, in load_data
X = np.zeros((len(data)/seq_length, seq_length, VOCAB_SIZE))
MemoryError
If I make the training data file smaller (e.g. 200kb) it works fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.