CNN 卷积神经网络 1
定义卷积层的 weight bias
mnist=input_data.read_data_sets('MNIST_data',one_hot=true)def weight_variable(shape):
inital=tf.truncted_normal(shape,stddev=0.1)
return tf.Variable(initial)def bias_variable(shape):
initial=tf.constant(0.1,shape=shape)
return tf.Variable(initial)def conv2d(x,W):
return tf.nn.conv2d(x,W,strides=[1,1,1,1],padding='SAME')定义 pooling
Last updated