Skip to content

Instantly share code, notes, and snippets.

@ugik
Last active April 29, 2018 14:14
Show Gist options
  • Save ugik/352defca6bcd4226d1cd6f9c74a6b7a7 to your computer and use it in GitHub Desktop.
Save ugik/352defca6bcd4226d1cd6f9c74a6b7a7 to your computer and use it in GitHub Desktop.
2-layer perceptron code from tflearn example
# Build neural network
net = tflearn.input_data(shape=[None, 5])
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 2, activation='softmax')
net = tflearn.regression(net)
# Define model and setup tensorboard
model = tflearn.DNN(net, tensorboard_dir='tflearn_logs')
# Start training (apply gradient descent algorithm)
model.fit(train_x, train_y, n_epoch=500, batch_size=16, show_metric=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment