def deepnnwithrelu(images):
    with tf.name_scope('hiddenlayer1'):
        weights = tf.Variable(tf.truncated_normal([MNIST_IMAGE_PIXELS, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(MNIST_IMAGE_PIXELS)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden1 = tf.nn.relu((tf.matmul(images, weights) + biases))
    with tf.name_scope('hiddenlayer2'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden2 = tf.nn.relu((tf.matmul(hidden1, weights) + biases))
    with tf.name_scope('hiddenlayer3'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden3 = tf.nn.relu((tf.matmul(hidden2, weights) + biases))
    with tf.name_scope('hiddenlayer4'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden4 = tf.nn.relu((tf.matmul(hidden3, weights) + biases))
    with tf.name_scope('hiddenlayer5'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden5 = tf.nn.relu((tf.matmul(hidden4, weights) + biases))
    with tf.name_scope('hiddenlayer6'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden6 = tf.nn.relu((tf.matmul(hidden5, weights) + biases))
    with tf.name_scope('finallayer'):
        W_fc2 = weight_variable([hiddenlayer_units, 10])
        b_fc2 = bias_variable([10])
        y_output = (tf.matmul(hidden6, W_fc2) + b_fc2)
    return y_output
def deepnnwithrelu(images):
    with tf.name_scope('hiddenlayer1'):
        weights = tf.Variable(tf.truncated_normal([MNIST_IMAGE_PIXELS, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(MNIST_IMAGE_PIXELS)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden1 = tf.nn.relu((tf.matmul(images, weights) + biases))
    with tf.name_scope('hiddenlayer2'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden2 = tf.nn.relu((tf.matmul(hidden1, weights) + biases))
    with tf.name_scope('hiddenlayer3'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden3 = tf.nn.relu((tf.matmul(hidden2, weights) + biases))
    with tf.name_scope('hiddenlayer4'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden4 = tf.nn.relu((tf.matmul(hidden3, weights) + biases))
    with tf.name_scope('hiddenlayer5'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden5 = tf.nn.relu((tf.matmul(hidden4, weights) + biases))
    with tf.name_scope('hiddenlayer6'):
        weights = tf.Variable(tf.truncated_normal([hiddenlayer_units, hiddenlayer_units], stddev=(1.0 / math.sqrt(float(hiddenlayer_units)))), name='weights')
        biases = tf.Variable(tf.zeros([hiddenlayer_units]), name='biases')
        hidden6 = tf.nn.relu((tf.matmul(hidden5, weights) + biases))
    with tf.name_scope('finallayer'):
        W_fc2 = weight_variable([hiddenlayer_units, 10])
        b_fc2 = bias_variable([10])
        y_output = (tf.matmul(hidden6, W_fc2) + b_fc2)
    return y_output