DeepRegNet / DeepReg

Medical image registration using deep learning
Apache License 2.0
560 stars 76 forks source link

739 refactor losses #740

Closed mathpluscode closed 3 years ago

mathpluscode commented 3 years ago

Description

Fixes #739

Type of change

What types of changes does your code introduce to DeepReg?

Please check the boxes that apply after submitting the pull request.

Checklist

Please check the boxes that apply after submitting the pull request.

If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

codecov[bot] commented 3 years ago

Codecov Report

Merging #740 (ed9a204) into main (de3728c) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #740   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           39        40    +1     
  Lines         2464      2468    +4     
=========================================
+ Hits          2464      2468    +4     
Impacted Files Coverage Δ
deepreg/dataset/preprocess.py 100.00% <ø> (ø)
deepreg/loss/__init__.py 100.00% <ø> (ø)
deepreg/model/network.py 100.00% <ø> (ø)
deepreg/loss/deform.py 100.00% <100.00%> (ø)
deepreg/loss/image.py 100.00% <100.00%> (ø)
deepreg/loss/kernel.py 100.00% <100.00%> (ø)
deepreg/loss/label.py 100.00% <100.00%> (ø)
deepreg/loss/util.py 100.00% <100.00%> (ø)
deepreg/registry.py 100.00% <100.00%> (ø)
deepreg/util.py 100.00% <100.00%> (ø)
... and 1 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 de3728c...ed9a204. Read the comment docs.

mathpluscode commented 3 years ago

@YipengHu @kate-sann5100 could you review this PR, I did some refactoring:

I've checked on the demo with 1 GPU or 2 GPUs, the losses range are good.