Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrei-Claudiu Roibu
BrainMapper
Commits
397a0fc0
Commit
397a0fc0
authored
Mar 25, 2020
by
Andrei-Claudiu Roibu
🖥
Browse files
wrote the forward function for U-net
parent
74c4b384
Changes
1
Hide whitespace changes
Inline
Side-by-side
BrainMapperUNet.py
View file @
397a0fc0
...
...
@@ -70,10 +70,37 @@ class BrainMapperUNet(nn.Module):
self
.
classifier
=
modules
.
ClassifierBlock
(
parameters
)
def
forward
(
self
,
X
):
"""Forward pass for U-net
Function computing the forward pass through the U-Net
The input to the function is the dMRI map
Args:
X (torch.tensor): Input dMRI map, shape = (N x C x H x W)
Returns:
probability_map (torch.tensor): Output forward passed tensor through the U-net block
Raises:
None
"""
Description
"""
return
None
Y_encoder_1
,
Y_np1
,
pool_indices1
=
self
.
encoderBlock1
.
forward
(
X
)
Y_encoder_2
,
Y_np2
,
pool_indices2
=
self
.
encoderBlock2
.
forward
(
Y_encoder_1
)
Y_encoder_3
,
Y_np3
,
pool_indices3
=
self
.
encoderBlock3
.
forward
(
Y_encoder_2
)
Y_encoder_4
,
Y_np4
,
pool_indices4
=
self
.
encoderBlock4
.
forward
(
Y_encoder_3
)
Y_bottleNeck
=
self
.
bottleneck
.
forward
(
Y_encoder_4
)
Y_decoder_1
=
self
.
decoderBlock1
.
forward
(
Y_bottleNeck
,
Y_np4
,
pool_indices4
)
Y_decoder_2
=
self
.
decoderBlock2
.
forward
(
Y_decoder_1
,
Y_np3
,
pool_indices3
)
Y_decoder_3
=
self
.
decoderBlock3
.
forward
(
Y_decoder_2
,
Y_np2
,
pool_indices2
)
Y_decoder_4
=
self
.
decoderBlock4
.
forwrad
(
Y_decoder_3
,
Y_np1
,
pool_indices1
)
probability_map
=
self
.
classifier
.
forward
(
Y_decoder_4
)
return
probability_map
def
enable_test_dropout
(
self
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment