truncated_normal、tf.zeros、tf.cast、mnist.train.next_batch

    **truncated_normal**(shape,mean,stddev):shap表示生成张量的维度,mean是均值,stddev是标准差,此函数 
                                           正态分布函数,均值和标准差由人为设定;
    **tf.zeros()**表示初始化函数,当零初始化一维数组单值时用x= tf.zeros([1])得[0]、零初始化一维数组双值时用x= 
                              tf.zeros([2])得[0,0]、零初始化x= tf.zeros([2,4])得到 [[0,0,0,0],[0,0,0,0]];
    **tf.cast()**表示数据类型转换tf.cast((correct_prediction,tf.float32))表示将correct_prediction之前的数据类型转换为tf.float32型(见4-2的第50行)
    **mnist.train.next_batch()**函数:用示例表明作用关系如下:

batch_xs,batch_ys=mnist.train.next_batch(batch_size)#batch_size表示获得100张图片(之前设定batch_size=100),然后保存在 batch_xs中,图片的标签保存在batch_ys。

你可能感兴趣的:(truncated_normal、tf.zeros、tf.cast、mnist.train.next_batch)