geektutu / blog

极客兔兔的博客,Coding Coding 创建有趣的开源项目。
https://geektutu.com
Apache License 2.0
168 stars 21 forks source link

tensorflow入门-mnist手写数字识别(一,网络搭建) | 极客兔兔 #4

Open geektutu opened 5 years ago

geektutu commented 5 years ago

https://geektutu.com/post/tensorflow-mnist-simplest.html

tensorflow入门系列文章,mnist手写数字识别(一,网络搭建)。

qiuChengleiy commented 5 years ago

mark 一下

sauryniu commented 4 years ago

计算交叉熵的时候,-log(0.6)如果是默认底数为10的话,不是应该等于0.22吗

geektutu commented 4 years ago

@SauryNiu 编程语言里,一般默认以e为底数。

sauryniu commented 4 years ago

@geektutu @SauryNiu 编程语言里,一般默认以e为底数。

好的,谢谢

ghost commented 4 years ago

请问激活函数主要有什么作用呀?

geektutu commented 4 years ago

@jinge1001 空间映射,引入非线性因素,弥补线性模型不能解决的问题。映射后保证数据可求偏导,且保留了原始数据的特征。

ghost commented 4 years ago

@geektutu @jinge1001 空间映射,引入非线性因素,弥补线性模型不能解决的问题。映射后保证数据可求偏导,且保留了原始数据的特征。

好的,那选哪种激活函数主要依据什么呀?

ZENOTME commented 4 years ago

你好 我使用的是2.0.0版本 为什么model里面tf.train.GradientDescentOptimizer显示不存在还有log也显示不存在

ZENOTME commented 4 years ago

我将tf.train改为tf.keras.train好像就可以了 这是为什么

King-Key commented 4 years ago

star

Vladimir-Chan commented 4 years ago

博主,这是tensorflow 2.0的教程吗,2.0版本应该已经没有placeholder这些函数了啊

geektutu commented 4 years ago

@Vladimir-Chan,前四篇是1.x 版本的时候写的,第五篇开始是2.0开始写的。

heat3wade commented 4 years ago

楼主您好,非常感谢您的分享,请问一下,这个结果大概运行之后多久能跑出来?我运行之后pycharm输出框里面就少都没有。。。python是3.6.4的,tensorflow是1.2.1的

wangzaistone commented 4 years ago

in mac runs it ,which reports error, add as follows import os os.environ['KMP_DUPLICATE_LIB_OK']='True'

it works refers:https://github.com/dmlc/xgboost/issues/1715

hyuan-kamuda commented 2 years ago

交叉熵损失函数不需要自己定义吧,tf都提供了。

  1. tf.nn.softmax_cross_entropy_with_logits(logits, labels)) logits是神经网络预测值(未经softmax),labels是真实Y的概率值(一般为one-hot编码)

  2. tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels)) logits是神经网络预测值(未经softmax),labels是真实Y的位置码