摘要:
import tensorflow as tf def preporocess(x,y): x = tf.cast(x,dtype=tf.float32) / 255 x = tf.reshape(x,(-1,28 *28)) # 铺平 x = tf.squeeze(x,axis=0) # prin 阅读全文
posted @ 2020-08-16 18:45
山…隹
阅读(631)
评论(0)
推荐(0)
摘要:
import tensorflow as tf a = tf.losses.categorical_crossentropy([0,1,0,0],[0.25,0.25,0.25,0.25],from_logits=True) # 前一个参数为标记值,后一个参数为预测值,最后一个参数设为True,输出 阅读全文
posted @ 2020-08-16 11:20
山…隹
阅读(374)
评论(0)
推荐(0)