-
-
Save Wapiti08/2b888a2a1e7514e9656b31c5bd35c529 to your computer and use it in GitHub Desktop.
multi-classification
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(layers.Dense(32, input_dim = np.array(X).shape[1], activation='relu')) | |
model.add(layers.Dense(32, activation='relu')) | |
model.add(layers.Dense(train_y.shape[1], activation='softmax')) | |
model.compile(loss='categorical_crossentropy',optimizer='adam', metrics='accuracy') | |
print("Training for attack classification model:") | |
model.fit(train_x, train_y, verbose=2, batch_size=15, epochs=50, validation_data=(test_x, test_y), | |
callbacks=[EarlyStopping(monitor='loss', patience=3)], class_weight= class_weights_dict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment