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

[Refactoring] Revise function of layers and override keys in init_cfg #893

Merged
merged 5 commits into from
Mar 26, 2021

Conversation

MeowZheng
Copy link
Collaborator

Hi,

As developers would like to only initialize parameters with attribute names, I just revise the initialization mechanism. If we don't define layer key or override key, it will not initialize anything; if we define override but don't define layer, it will initialize parameters with the attribute name in override; if we only define layer, it just initialize the layer in layer key; if we define override and layer, override has higher priority and will override initialization mechanism.

Moreover, for ease of use, if we only define override, and override without type key, the type key and other kwargs will merge in override.

@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #893 (877c152) into master (73bff4e) will decrease coverage by 0.12%.
The diff coverage is 80.00%.

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

@@            Coverage Diff             @@
##           master     #893      +/-   ##
==========================================
- Coverage   66.58%   66.45%   -0.13%     
==========================================
  Files         145      145              
  Lines        8828     8845      +17     
  Branches     1605     1603       -2     
==========================================
  Hits         5878     5878              
- Misses       2633     2641       +8     
- Partials      317      326       +9     
Flag Coverage Δ
unittests 66.45% <80.00%> (-0.13%) ⬇️

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

Impacted Files Coverage Δ
mmcv/runner/base_module.py 79.41% <71.42%> (-6.31%) ⬇️
mmcv/cnn/utils/weight_init.py 91.27% <84.00%> (-7.54%) ⬇️
mmcv/runner/__init__.py 100.00% <100.00%> (ø)

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 967d9d5...d4eef56. Read the comment docs.

@MeowZheng MeowZheng changed the title [Refactoring]Approve init_cfg [Refactoring]Revise function of layers and override keys in init_cfg Mar 17, 2021
@MeowZheng MeowZheng changed the title [Refactoring]Revise function of layers and override keys in init_cfg [Refactoring] Revise function of layers and override keys in init_cfg Mar 17, 2021
mmcv/cnn/utils/weight_init.py Outdated Show resolved Hide resolved
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