Created
November 6, 2018 05:13
-
-
Save hhefesto/4dfd573982b925596a99cc532a1ac796 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from keras.models import Sequential | |
| from keras.layers import Dense | |
| model = Sequential() | |
| model.add(Dense(units=64, activation='relu', input_dim=100)) | |
| model.add(Dense(units=10, activation='softmax')) | |
| model.compile(loss='categorical_crossentropy', | |
| optimizer='sgd', | |
| metrics=['accuracy']) | |
| model.compile(loss=keras.losses.categorical_crossentropy, | |
| optimizer=keras.optimizers.SGD(lr=0.01, momentum=0.9, nesterov=True)) | |
| # x_train and y_train are Numpy arrays --just like in the Scikit-Learn API. | |
| model.fit(x_train, y_train, epochs=5, batch_size=32) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment