Skip to content

Conversation

@zhunzhong07
Copy link
Contributor

@zhunzhong07 zhunzhong07 commented Jul 5, 2019

This PR optimizes the RandomErasing:

  1. Avoid forever loop for getting parameters of erase RandomErasing is buggy #1094 . Also add testing when there is no erased region selected.
  2. replace img_b by img_c, because it indicates the channel.
  3. replace v = torch.rand([img_c, h, w])
    by v = torch.empty([img_c, h, w], dtype=torch.float32).normal_(). Because normally distributed achieves better performance.

1. Avoid forever loop for getting parameters of erase.
2. replace' img_b' by 'img_c', because it indicates the channel.
3. replace v = torch.rand([img_c, h, w]) by v = torch.empty([img_c, h, w], dtype=torch.float32).normal_(). Normally distributed achieves better performance.
@zhunzhong07 zhunzhong07 marked this pull request as ready for review July 5, 2019 12:12
@codecov-io
Copy link

codecov-io commented Jul 5, 2019

Codecov Report

Merging #1095 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1095      +/-   ##
=========================================
- Coverage   64.65%   64.6%   -0.05%     
=========================================
  Files          68      68              
  Lines        5410    5411       +1     
  Branches      830     831       +1     
=========================================
- Hits         3498    3496       -2     
- Misses       1662    1664       +2     
- Partials      250     251       +1
Impacted Files Coverage Δ
torchvision/transforms/functional.py 71.38% <ø> (ø) ⬆️
torchvision/transforms/transforms.py 80.94% <100%> (-0.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f91b8f...5751953. Read the comment docs.

@zhunzhong07 zhunzhong07 changed the title Fix bug to Random Erasing Fix bug to RandomErasing Jul 5, 2019
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Thanks!

@fmassa fmassa merged commit 3483342 into pytorch:master Jul 6, 2019
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

Successfully merging this pull request may close these issues.

3 participants