Please enable JavaScript.
Coggle requires JavaScript to display documents.
Deeplearning with Tensorflow (Multi-Layer Perceptron (FUNCTION (Settings…
Deeplearning with Tensorflow
import tensorflow as tf
Contrib Learn
train_test_split the data
import tensorflow.contrib.learn as learn
classifier = learn.DNNClassifier(hidden_units = [10, 20, 10], n_classes = 3)
classifier.fit(X_train, y_train)
classifier.predict(X_test)
Multi-Layer Perceptron
learning_rate -> how quickly to adjust the cost function
training_epochs -> how many training cycles to go through
batch_size -> size of the 'batches' of training data
n_hidden_1; n_hidden_2; n_input; n_classes; n_samples
x, y
FUNCTION
layer_1, layer_2, out_layer
Settings
weights = {'h1':...}
biases = {'b1':...}
COST AND OPTIMIZATION
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits = pred, labels = y))
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
RUNNING THE SESSION
for epoch in range(training_epochs)
batch_x, batch_y = mnist.train.next_batch(batch_size)