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

请问train.py里168行partial_index的作用? #4

Open
zhishao opened this issue Nov 29, 2023 · 6 comments
Open

请问train.py里168行partial_index的作用? #4

zhishao opened this issue Nov 29, 2023 · 6 comments

Comments

@zhishao
Copy link

zhishao commented Nov 29, 2023

按照代码中的逻辑,partial_index应该每次都为从0到num_classes的列表,我不明白这有何作用?

@zhishao
Copy link
Author

zhishao commented Nov 30, 2023

感觉代码不像是最终代码,尤其是损失函数那块

@Jason-Zhou-JC
Copy link
Collaborator

Jason-Zhou-JC commented Dec 2, 2023

partial_index 是为了超参数 r 而使用的,你可以在不同 r 的配置下打印出来看看就知道区别了。代码也是完整的,按照说明执行操作就可以训练得到跟论文里相似的结果。

@zhishao
Copy link
Author

zhishao commented Dec 4, 2023

非常感谢您的回复,看这段代码时感觉很像partial FC,故有此问。您工程中的示例代码我看到是单个GPU运行的,请问后续有多GPU运行,或者结合partial FC的示例代码放出吗?

@zhishao
Copy link
Author

zhishao commented Dec 10, 2023

代码中Normalized_BCE_Loss和Unified_Cross_Entropy_Loss是一样的,请问是为什么?并且我在其他任务上训练发现效果不如arcface,请问您有什么改进建议呢?@Jason-Zhou-JC

@Jason-Zhou-JC
Copy link
Collaborator

Jason-Zhou-JC commented Dec 12, 2023

暂时没有多GPU的计划,可能得晚一点。单GPU除了训练时间久点,没有什么问题,通过超参 bs_mul 的设置也可以模拟更大 batch size 的情况。Normalized_BCE_Loss和Unified_Cross_Entropy_Loss你看仔细点还是不一样的,bias的数量不一样。其他任务上的训练具体什么情况我不清楚,可能你换个超参数调一下就好了,也可能它根本就不适用。

@Jason-Zhou-JC
Copy link
Collaborator

已更新DataParallel代码。

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