Skip to content

Instantly share code, notes, and snippets.

@Libardo1
Forked from ugik/lstm tflearn example
Created April 3, 2017 21:09
Show Gist options
  • Select an option

  • Save Libardo1/7e4bd0ee807034b3b43040b01f3e7366 to your computer and use it in GitHub Desktop.

Select an option

Save Libardo1/7e4bd0ee807034b3b43040b01f3e7366 to your computer and use it in GitHub Desktop.
LSTM RNN tflearn example
# Network building
net = tflearn.input_data([None, 100])
net = tflearn.embedding(net, input_dim=10000, output_dim=128)
net = tflearn.lstm(net, 128, dropout=0.8)
net = tflearn.fully_connected(net, 2, activation='softmax')
net = tflearn.regression(net, optimizer='adam', learning_rate=0.001,
loss='categorical_crossentropy')
# Training
model = tflearn.DNN(net)
model.fit(trainX, trainY, validation_set=(testX, testY), show_metric=True,
batch_size=32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment