Skip to content

Commit

Permalink
finish adding enter as word, fix checkpoint path
Browse files Browse the repository at this point in the history
Enrique Arriaga committed Jun 11, 2018
1 parent 3a6c7eb commit 7b83994
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lstm_train.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
SEQUENCE_LEN = 10
MIN_WORD_FREQUENCY = 10
STEP = 1
BATCH_SIZE = 128
BATCH_SIZE = 32
SIMPLE_MODEL = True


@@ -161,8 +161,8 @@ def on_epoch_end(epoch, logs):
corpus = sys.argv[1]
examples = sys.argv[2]

if not os.path.isdir('./checkpoints/s15/'):
os.makedirs('./checkpoints/s15/')
if not os.path.isdir('./checkpoints/'):
os.makedirs('./checkpoints/')

with io.open(corpus, encoding='utf-8') as f:
text = f.read().lower().replace('\n', ' \n ')
@@ -210,7 +210,7 @@ def on_epoch_end(epoch, logs):
model = get_model(SIMPLE_MODEL)
model.compile(loss='categorical_crossentropy', optimizer="adam", metrics=['accuracy'])

file_path = "./checkpoints/s15/LSTM_LYRICS_words%d_sequence%d_simple%r_minfreq%d_epoch{epoch:02d}_loss{loss:.4f}" % (
file_path = "./checkpoints/LSTM_LYRICS_words%d_sequence%d_simple%r_minfreq%d_epoch{epoch:02d}_loss{loss:.4f}" % (
len(words),
SEQUENCE_LEN,
SIMPLE_MODEL,

0 comments on commit 7b83994

Please sign in to comment.