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

关于loss计算的疑问 #21

Open
Julius-ZCJ opened this issue Mar 12, 2021 · 1 comment
Open

关于loss计算的疑问 #21

Julius-ZCJ opened this issue Mar 12, 2021 · 1 comment

Comments

@Julius-ZCJ
Copy link

博主你好:
我看你在代码里用的是计算loss的时候用的是rpn_class_logits, 和rcnn_class_logits为什么不用rpn_probs和rcnn_probs来计算呢?
按我的理解,既然使用的交叉熵作为损失,并且label也是one_hot之后的,应该使用归一化的概率来计算啊,是有什么特殊情况么?

@Viredery
Copy link
Owner

因为Tensorflow提供一些函数,可以直接传入logits和label这两个参数去计算损失和梯度值。本质上,probs的在logits基础上多了exp计算,然后算梯度的时候再求导,相当于在prob上算log,即又变回了logits。所以TF提供了一些函数,在函数的内部实现里简化了计算量。

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

2 participants