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] Add Transferal Perceptual Loss #372

Merged
merged 3 commits into from
Jun 21, 2021
Merged

Conversation

Yshuo-Li
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #372 (545c6a7) into master (82a964d) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #372      +/-   ##
==========================================
+ Coverage   80.43%   80.50%   +0.06%     
==========================================
  Files         186      186              
  Lines        9911     9936      +25     
  Branches     1444     1450       +6     
==========================================
+ Hits         7972     7999      +27     
+ Misses       1745     1744       -1     
+ Partials      194      193       -1     
Flag Coverage Δ
unittests 80.48% <100.00%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
mmedit/models/losses/__init__.py 100.00% <100.00%> (ø)
mmedit/models/losses/perceptual_loss.py 67.67% <100.00%> (+10.92%) ⬆️
...ls/components/stylegan2/generator_discriminator.py 86.14% <0.00%> (+1.20%) ⬆️

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 82a964d...545c6a7. Read the comment docs.



@LOSSES.register_module()
class TPerceptualLoss(nn.Module):
Copy link
Contributor

Choose a reason for hiding this comment

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

A single T is hard to guess. Use the full name is ok


Args:
loss_weight (float): Loss weight. Default: 1.0.
use_s (bool): If True, use soft-attention tensor in TPerceptualLoss.
Default: True.
use_s (bool): If True, use soft-attention tensor. Default: True.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. s is very cryptic.

@innerlee
Copy link
Contributor

On names. They should be accessible both for beginners who don't know what they are and for experts who knows a lot similar concepts. It is not for the author him/herself who knows exactly what a letter "s" or "T" stands for.



@LOSSES.register_module()
class TransferalPerceptualLoss(nn.Module):
Copy link
Contributor

Choose a reason for hiding this comment

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

Double check Texture vs Transferal. If the latter, pls modify the pr title accordingly

@Yshuo-Li Yshuo-Li changed the title [Feature] Add Texture Perceptual Loss [Feature] Add Transferal Perceptual Loss Jun 17, 2021
@innerlee innerlee merged commit 7f71f74 into open-mmlab:master Jun 21, 2021
@Yshuo-Li Yshuo-Li deleted the tp branch July 9, 2021 11:43
Yshuo-Li added a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 2022
* [Feature] Add Texture Perceptual Loss

* Rename

* Rename

Co-authored-by: liyinshuo <liyinshuo@sensetime.com>
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.

None yet

2 participants