Created
August 17, 2020 01:28
-
-
Save ahmadmustafaanis/9589fe42183ab37ef5167c6497978fcd 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
model2 = Sequential([ | |
Dense(512, activation='tanh', input_shape = X_train[0].shape, kernel_regularizer='l1'), #Only change is here where we add kernel_regularizer | |
Dense(512//2, activation='tanh'), | |
Dense(512//4, activation='tanh'), | |
Dense(512//8, activation='tanh'), | |
Dense(32, activation='relu'), | |
Dense(3, activation='softmax') | |
]) | |
model2.compile(optimizer='sgd',loss='categorical_crossentropy', metrics=['acc', 'mse']) | |
hist2 = model2.fit(X_train, y_train, epochs=350, batch_size=128, validation_data=(X_test,y_test)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment