Created
October 16, 2019 08:42
-
-
Save irdanish11/bbf24746c41bdbba988bc5157aeb11ff to your computer and use it in GitHub Desktop.
call the method to build the graph. checkpoint is created to store the best weights after every epoch. Then model is trained using 500 epochs. Then we also save the tokenizer object for further use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| model = create_model(vocabulary_size+1,seq_len) | |
| path = './checkpoints/word_pred_Model4.h5' | |
| checkpoint = ModelCheckpoint(path, monitor='loss', verbose=1, save_best_only=True, mode='min') | |
| model.fit(train_inputs,train_targets,batch_size=128,epochs=500,verbose=1,callbacks=[checkpoint]) | |
| dump(tokenizer,open('tokenizer_Model4','wb')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment