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

batch_norm效果异常求解答 #4

Open
Archimondecy opened this issue Nov 26, 2019 · 0 comments
Open

batch_norm效果异常求解答 #4

Archimondecy opened this issue Nov 26, 2019 · 0 comments

Comments

@Archimondecy
Copy link

实现了一个ranknet,网络是fc-bn-fc-bn-fc-bn-fc-bn-fc-bn-fc,fc神经元的数量除了最后一层是1,其他都是32. fc没有激活,bn用的relu。 输入是 样本label永远是1,左边是pos,右边是neg,左边永远大于右边;设计是希望pos和neg走同一个上面的网络,计算出最后一层结果,然后进入margin_rank_loss,所以永远是pos-neg,然后做sigmoid和二元交叉熵logloss,最后取均值作为loss。
逻辑是,希望网络能够根据特征计算相关性得分,然后pos-neg差值越大越好。

现在问题是,训练时loss迅速降为0.001,预测时效果很差。加载训练好的模型再进行训练,loss 0.001,但是一旦bn使用全局状态(use_global_stats设为True,不更新bn参数,模拟预测),立刻loss暴涨。 辛苦帮忙看下是bn层有异常么?
其中一层FC-bn
BaiduHi_2019-11-26_10-41-4

最后一层fc
2

loss的构成
3

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

1 participant