Last active
November 21, 2017 03:20
-
-
Save rish-16/2d48bae2d6cfe645d23b9e7f0453dc31 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
| import tflearn | |
| from tflearn.layers.core import input_data, fully_connected | |
| from tflearn.layers.estimator import regression | |
| import tflearn.datasets.mnist as mnist | |
| X_train, y_train, X_test, y_test = mnist.load_data(one_hot=True) | |
| X_train = X_train.reshape([-1, 1]) | |
| X_test = X_test.reshape([-1, 1]) | |
| net = tflearn.input_data(shape=[None, 784]) | |
| net = tflearn.fully_connected(net, 500, activation='relu') | |
| net = tflearn.fully_connected(net, 500, activation='relu') | |
| net = tflearn.fully_connected(net, 10, activation='softmax') | |
| net = tflearn.regression(net, optimizer='adam', loss='categorical_crossentropy') | |
| model = tflearn.DNN(net) | |
| model.fit(X_train, y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment