Last active
April 24, 2017 15:48
-
-
Save LastZactionHero/3bff1ae1f65e6b9b566bd0d2f97849a8 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
# Split the data into training and test sets | |
X_train, X_test, y_train, y_test = train_test_split( | |
data_words, data_plant_types, test_size=0.33, random_state=42) | |
# Build a neural network | |
network = input_data(shape=[None, len(data_words[0])]) | |
network = fully_connected(network, 2048, activation='relu') | |
network = fully_connected( | |
network, len(data_plant_types[0]), activation='softmax') | |
network = regression(network, optimizer='adam', | |
loss='categorical_crossentropy', | |
learning_rate=0.0003) | |
model = tflearn.DNN(network, tensorboard_verbose=0) | |
# Train the network | |
model.fit(X_train, y_train, n_epoch=10, shuffle=True, | |
validation_set=(X_test, y_test), | |
show_metric=True, batch_size=25, run_id='specific_cnn') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment