Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2018 07:24
What would you like to do?
# shuffle our features and turn into np.array as tensorflow takes in numpy array
training = np.array(training)
# trainX contains the Bag of words and train_y contains the label/ category
train_x = list(training[:, 0])
train_y = list(training[:, 1])
# reset underlying graph data
# Build neural network
net = tflearn.input_data(shape=[None, len(train_x[0])])
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, len(train_y[0]), 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), train_y, n_epoch=1000, batch_size=8, show_metric=True)'model.tflearn')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment