Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

评价指标计算时的输入问题 #20

Closed
arbalest339 opened this issue Apr 14, 2019 · 2 comments
Closed

评价指标计算时的输入问题 #20

arbalest339 opened this issue Apr 14, 2019 · 2 comments

Comments

@arbalest339
Copy link

    仔细阅读了阁下的代码,有一个问题。
    模型最后产生的参数是:(total_loss,  per_example_loss,logits,predicts),predicts保存的是预测值,而logits应该是没有进行softmax归一化的矩阵。
    为何在验证阶段使用predictions = tf.argmax(logits, axis=-1, output_type=tf.int32)作为和label_id比较的矩阵进行三项指标的计算,而不是使用模型产生的predicts矩阵来比较。
    这点十分令人困扰,如果这是bug的话那为什么得到的几项指标的数值与实际情况还是比较符合的;如果这不是bug的话那为什么没有进行归一化的矩阵也能反映出正确的预测值呢。
   最后感谢阁下提供的代码和数据。
@arbalest339
Copy link
Author

补充一下,将评价阶段的预测值输入改成模型产生的 predicts之后得到的数据与之前完全一致,这样来看softmax仅仅只是把原来分散的数值缩减到0到1,原本的绝对值相对大小也不改变。可能这就是softmax的性质吧

@xiao2mo
Copy link

xiao2mo commented Apr 15, 2019

你的理解没问题啊,这里知道怎么回事就可以,可以直接用 predicts。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants