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

[Feature] Implement ACRN and Focal Loss #891

Merged
merged 13 commits into from
May 31, 2021

Conversation

kennymckormick
Copy link
Member

@kennymckormick kennymckormick commented May 30, 2021

No description provided.

@codecov
Copy link

codecov bot commented May 30, 2021

Codecov Report

Merging #891 (7e1d8ea) into master (e9b7009) will increase coverage by 0.00%.
The diff coverage is 88.88%.

❗ Current head 7e1d8ea differs from pull request most recent head ac9cf82. Consider uploading reports for the commit ac9cf82 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #891   +/-   ##
=======================================
  Coverage   83.71%   83.71%           
=======================================
  Files         131      132    +1     
  Lines        9870     9932   +62     
  Branches     1699     1710   +11     
=======================================
+ Hits         8263     8315   +52     
- Misses       1197     1203    +6     
- Partials      410      414    +4     
Flag Coverage Δ
unittests 83.71% <88.88%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmaction/datasets/ava_dataset.py 90.60% <ø> (ø)
mmaction/models/heads/roi_head.py 75.00% <50.00%> (ø)
...maction/models/roi_extractors/single_straight3d.py 74.24% <66.66%> (-3.35%) ⬇️
mmaction/models/heads/misc_head.py 93.75% <93.75%> (ø)
mmaction/models/__init__.py 100.00% <100.00%> (ø)
mmaction/models/heads/__init__.py 100.00% <100.00%> (ø)
mmaction/models/heads/bbox_head.py 91.47% <100.00%> (+0.34%) ⬆️
mmaction/models/heads/fbo_head.py 78.49% <100.00%> (ø)
mmaction/models/heads/lfb_infer_head.py 45.00% <100.00%> (ø)
mmaction/core/evaluation/accuracy.py 92.27% <0.00%> (-0.91%) ⬇️
... and 2 more

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 e9b7009...ac9cf82. Read the comment docs.

@dreamerlin
Copy link
Collaborator

Sth in all config files should be removed.

@congee524
Copy link
Contributor

Why we put acrn_head in misc_head.py

loss = bce_loss(cls_score, labels, reduction='none')
pt = torch.exp(-loss)
F_loss = self.focal_alpha * (1 - pt)**self.focal_gamma * loss
losses['loss_action_cls'] = torch.mean(F_loss)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about moving this part as class FocalLoss and using it by build_loss(xxx)?

Copy link
Contributor

Choose a reason for hiding this comment

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

like BaseHead

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can make FocalLoss a separate module when there is evidence that it can lead to performance gain on other tasks. For now, it is only used in the training of AVA.

@kennymckormick
Copy link
Member Author

Why we put acrn_head in misc_head.py

I will add a series of shared_heads for feature fusion. Currently, I only committed ACRNHead since it's the most successful one.

@dreamerlin
Copy link
Collaborator

Why we put acrn_head in misc_head.py

I will add a series of shared_heads for feature fusion. Currently, I only committed ACRNHead since it's the most successful one.

I guess what he means is that why not name it as acrn_head

@kennymckormick
Copy link
Member Author

Why we put acrn_head in misc_head.py

I will add a series of shared_heads for feature fusion. Currently, I only committed ACRNHead since it's the most successful one.

I guess what he means is that why not name it as acrn_head

I know. Since I will add a series of heads in the future, I plan to put all of them in the misc_head.py to avoid creating a new file for each individual.

@dreamerlin dreamerlin merged commit 7ea0e01 into open-mmlab:master May 31, 2021
@kennymckormick kennymckormick deleted the acrn branch June 1, 2021 13:47
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