Skip to content

Instantly share code, notes, and snippets.


amankharwal/Title Generator Secret

Created Oct 5, 2020
What would you like to do?
def create_model(max_sequence_len, total_words):
input_len = max_sequence_len — 1
model = Sequential()
# Add Input Embedding Layer
model.add(Embedding(total_words, 10, input_length=input_len))
# Add Hidden Layer 1 — LSTM Layer
# Add Output Layer
model.add(Dense(total_words, activation=’softmax’))
model.compile(loss=’categorical_crossentropy’, optimizer=’adam’)
return model
model = create_model(max_sequence_len, total_words), label, epochs=20, verbose=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment