Skip to content

Commit a4ccaad

Browse files
authored
Update lstm_genre_classifier_keras.py
1 parent 5f235f6 commit a4ccaad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lstm_genre_classifier_keras.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585

8686
model.add(LSTM(units=128, dropout=0.05, recurrent_dropout=0.35, return_sequences=True, input_shape=input_shape))
8787
model.add(LSTM(units=32, dropout=0.05, recurrent_dropout=0.35, return_sequences=False))
88+
model.add(Dense(units=128, activation="relu"))
8889
model.add(Dense(units=genre_features.train_Y.shape[1], activation="softmax"))
8990

9091
print("Compiling ...")
@@ -124,4 +125,8 @@
124125
# Creates a HDF5 file 'lstm_genre_classifier.h5'
125126
model_filename = "lstm_genre_classifier_lstm.h5"
126127
print("\nSaving model: " + model_filename)
127-
model.save(model_filename)
128+
model.save(model_filename)
129+
print("creating .json file....")
130+
model_json = model.to_json()
131+
f = Path("ch.json")
132+
f.write_text(model_json)

0 commit comments

Comments
 (0)