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

Fix one_hot api limit #5927

Merged
merged 11 commits into from
Aug 17, 2021
Merged

Fix one_hot api limit #5927

merged 11 commits into from
Aug 17, 2021

Conversation

leaves-zwx
Copy link
Contributor

No description provided.

@yuanms2
Copy link
Contributor

yuanms2 commented Aug 17, 2021

这个是修复谢暄说的wide and deep 不收敛的问题吗?

@leaves-zwx
Copy link
Contributor Author

这个是修复谢暄说的wide and deep 不收敛的问题吗?

不是的,这个是在 nn.Graph 里面不能调用 one_hot 的问题。

@MARD1NO
Copy link
Contributor

MARD1NO commented Aug 17, 2021

这个是修复谢暄说的wide and deep 不收敛的问题吗?

修复的是nn.Graph下使用one_hot的问题

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 17, 2021 10:08
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 17, 2021 10:37
if num_classes == -1:
num_classes = (flow.max(input) + 1).numpy()

if num_classes is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是if num_classes == -1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最好别用 -1 代表参数 optional 的语义

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看了 torch.nn.functional.one_hot,它这就是 -1 代表需要从 input 求值,改为与它对齐

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 17, 2021 11:32
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 17, 2021 12:27
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 17, 2021 13:27
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 17, 2021 14:28
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 17, 2021 15:40
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 17, 2021 16:13
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 17, 2021 20:50
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 142.2ms (= 7108.1ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.4ms (= 6420.5ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 142.2ms / 128.4ms)

PyTorch resnet50 time: 81.3ms (= 4065.1ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.5ms (= 3723.4ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.09 (= 81.3ms / 74.5ms)

PyTorch resnet50 time: 59.1ms (= 2955.8ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 47.8ms (= 2389.1ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.24 (= 59.1ms / 47.8ms)

PyTorch resnet50 time: 50.2ms (= 2510.8ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 40.4ms (= 2018.5ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.24 (= 50.2ms / 40.4ms)

PyTorch resnet50 time: 44.4ms (= 2219.9ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 42.2ms (= 2109.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 1.05 (= 44.4ms / 42.2ms)

@oneflow-ci-bot oneflow-ci-bot merged commit 8bc8b77 into master Aug 17, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the fix_one_hot branch August 17, 2021 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants