-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Description
Hi,
there seem to be no activation functions in multilayer_perceptron.py This results in a poor performance of the network - after addition of additional ReLU at each layer (code change below), the cost almost immediately drops to ~2.3, contrary to slow convergence to ~21 for 15 batches in the current version.
current version:
def multilayer_perceptron(x):
# Hidden fully connected layer with 256 neurons
layer_1 = tf.add(tf.matmul(x, weights['h1']), biases['b1'])
# Hidden fully connected layer with 256 neurons
layer_2 = tf.add(tf.matmul(layer_1, weights['h2']), biases['b2'])
# Output fully connected layer with a neuron for each class
out_layer = tf.matmul(layer_2, weights['out']) + biases['out']
return out_layer
changed into:
def multilayer_perceptron(x):
# Hidden fully connected layer with 256 neurons
layer_1 = tf.maximum(0.,tf.add(tf.matmul(x, weights['h1']), biases['b1']))
# Hidden fully connected layer with 256 neurons
layer_2 = tf.maximum(0.,tf.add(tf.matmul(layer_1, weights['h2']), biases['b2']))
# Output fully connected layer with a neuron for each class
out_layer = tf.maximum(0.,tf.matmul(layer_2, weights['out']) + biases['out'])
return out_layer
jotachango, alexpantyukhin and maverik-akagami
Metadata
Metadata
Assignees
Labels
No labels