![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow2.0
tensorflow
无峥
这个作者很懒,什么都没留下…
展开
-
损失函数
TensorFlow以及Keras里面在处理多分类时有sparse_categorical_crossentropy和categorical_crossentropy。两者的区别在于训练的Label的形态: one-hot: categorical_crossentropy Integer number: sparse_categorical_crossentropy 另外tensorflow官方源码中列举了相关参数: Args: from_logits: Whether `y_pred`原创 2020-05-26 13:29:59 · 529 阅读 · 0 评论 -
PyPlot画图总结
综述 在可视化中需要考虑的基本元素是:画布! 单图 t = np.arange(0., 5., 0.2) """ figure用来定义画布的基本属性 """ plt.figure(1) """ 画折线图的函数(x,y,line_shape);如果要在一张图中画多条线直接在后面排就行。 """ plt.plot(t, t, 'r--',t, t**2, 'bs', t, t**3, 'g^') plt.show() line1,line2,line3 = plt.plot(t, t, ‘r–’,t, t2原创 2020-05-26 13:28:41 · 482 阅读 · 0 评论 -
关于那些axis
看过特别多的博客,都是在抽象的解释什么方向啊坐标轴啊啥的,估计作者后面自己也混淆了。特别当我看到这篇博客的时候恍然大悟啊。使用这个参数时一定要记得,自己操作的矩阵每个维度代表什么含义!! 例如: # 使用一张图片测试神经网络的性能 img = test_images[1] print(img.shape) -->(28, 28) # tensorflow中要求(batch_size,rows,cols)三元组的形式输入模型中,因此必须在第一个维度上拓展出新的来。则axis=0原创 2020-05-26 13:27:31 · 297 阅读 · 0 评论 -
TF练习——第一个完整项目
Copyright 2018 The TensorFlow Authors. Basic regression: Predict fuel efficiency Note: 我们的 TensorFlow 社区翻译了这些文档。因为社区翻译是尽力而为, 所以无法保证它们是最准确的,并且反映了最新的 官方英文文档。如果您有改进此翻译的建议, 请提交 pull request 到 tensorflow/docs GitHub 仓库。要志愿地撰写或者审核译文,请加入 docs-zh-cn@tensorflow.org原创 2020-05-26 13:26:43 · 777 阅读 · 0 评论