Skip to content

Commit

Permalink
reimplemented the Cross_Pseudo_Supervision for medical image application
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiangde authored and luoxiangde committed Jul 16, 2021
1 parent ba4c557 commit b2edda0
Show file tree
Hide file tree
Showing 9 changed files with 681 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/SSL4MIS.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion code/networks/unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,25 @@
import torch.nn as nn
from torch.distributions.uniform import Uniform


def kaiming_normal_init_weight(model):
for m in model.modules():
if isinstance(m, nn.Conv3d):
torch.nn.init.kaiming_normal_(m.weight)
elif isinstance(m, nn.BatchNorm3d):
m.weight.data.fill_(1)
m.bias.data.zero_()
return model

def sparse_init_weight(model):
for m in model.modules():
if isinstance(m, nn.Conv3d):
torch.nn.init.sparse_(m.weight, sparsity=0.1)
elif isinstance(m, nn.BatchNorm3d):
m.weight.data.fill_(1)
m.bias.data.zero_()
return model


class ConvBlock(nn.Module):
"""two convolution layers with batch norm and leaky relu"""

Expand Down
Loading

0 comments on commit b2edda0

Please sign in to comment.