import tensorflow as tf

import tensorflow as tf


#add_layer 函数里面所有的with都是为了tensorboard添加上去的
def add_layer(inputs, in_size, out_size, activation_function=None,nameScope="layer"):
    # add one more layer and return the output of this layer
    with tf.name_scope(nameScope):

        with tf.name_scope('weights'):

            Weights = tf.Variable(tf.random_normal([in_size, out_size]), name='W')

        with tf.name_scope('biases'):
            biases = tf.Variable(tf.zeros([1, out_size]) + 0.1, name='b')

        with tf.name_scope('Wx_plus_b'):
            Wx_plus_b = tf.add(tf.matmul(inputs, Weights), biases)

        if activation_function is None:
            outputs = Wx_plus_b
