MNIST自学
各个函数的参数含义:
t f . t r u n c a t e d _ n o r m a l ( s h a p e , m e a n = 0.0 , s t d d e v = 1.0 , d t y p e = t f . f l o a t 32 , s e e d = N o n e , n a m e = N o n e ) {tf.truncated\_normal(shape, mean=0.0, stddev=1.0,dtype=tf.float32,seed=None,name=None)} tf.truncated_normal(shape,mean=0.0,stddev=1.0,dtype=tf.float32,seed=None,name=None)
s h a p e shape shape表示生成张量的维度, m e a n mean mean是均值, s t d d e v stddev stddev是标准差。这个函数产生正态分布,均值和标准差自己设定。产生截断正态分布随机数,取值范围为 [ m e a n − 2 ∗ s t d d e v , m e a n + 2 ∗ s t d d e v ] {[mean -2*stddev,mean+2*stddev]} [mean−2∗stddev,mean+2∗stddev]
卷积: t f . n n . c o n v 2 d ( i n p u t , f i l t e r , s t r i d e s , p a d d i n g , u s e _ c u d n n _ o n _ g p u = N o n e , n a m e = N o n e ) {tf.nn.conv2d(input, filter, strides, padding, use\_cudnn\_on\_gpu=None, name=None)} tf.nn.conv2d(input,filter,strides,padding,use_cudnn_on_gpu=None,name=None)
i n p u t input