-
-
Save amankharwal/ab6fcf6a129ba8d50e47d7f2716b6bd6 to your computer and use it in GitHub Desktop.
This file contains 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 = Sequential() | |
model.add(Embedding(vocab_size, embedding_dim, input_length=max_len)) | |
model.add(GlobalAveragePooling1D()) | |
model.add(Dense(16, activation='relu')) | |
model.add(Dense(16, activation='relu')) | |
model.add(Dense(num_classes, activation='softmax')) | |
model.compile(loss='sparse_categorical_crossentropy', | |
optimizer='adam', metrics=['accuracy']) | |
model.summary() | |
epochs = 500 | |
history = model.fit(padded_sequences, np.array(training_labels), epochs=epochs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment