def neural_network_model(data):
#Define weights and biases with their dimensions
hidden_1_layer = {'weights' : tf.Variable(tf.random_normal([784,n_nodes_hl1])),
'biases' : tf.Variable(tf.random_normal([n_nodes_hl1]))}
#bias is used to make some neurons fire even if all inputs is 0
hidden_2_layer = {'weights' : tf.Variable(tf.random_normal([n_nodes_hl1,n_nodes_hl2])),
'biases' : tf.Variable(tf.random_normal([n_nodes_hl2]))}
hidden_3_layer = {'weights' : tf.Variable(tf.random_normal([n_nodes_hl2,n_nodes_hl3])),
'biases' : tf.Variable(tf.random_normal([n_nodes_hl3]))}
output_layer = {'weights' : tf.Variable(tf.random_normal([n_nodes_hl3,n_classes])),
'biases' : tf.Variable(tf.random_normal([n_classes]))}
# Layer values =(input_data*weights) + biases
l1 = tf.add(tf.matmul(data,hidden_1_layer['weights']),hidden_1_layer['biases'])
l1 = tf.nn.relu(l1)
l2 = tf.add(tf.matmul(l1,hidden_2_layer['weights']),hidden_2_layer['biases'])
l2 = tf.nn.relu(l2)
l3 = tf.add(tf.matmul(l2,hidden_3_layer['weights']),hidden_3_layer['biases'])
l3 = tf.nn.relu(l3)
output = tf.matmul(l3,output_layer['weights'])+ output_layer['biases']
return output