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
6406ec01
Commit
6406ec01
authored
Apr 07, 2020
by
Andrei-Claudiu Roibu
🖥
Browse files
fixed bug - float network parameter rather than int/tuple
parent
2119e409
Changes
2
Show whitespace changes
Inline
Side-by-side
BrainMapperUNet.py
View file @
6406ec01
...
...
@@ -204,7 +204,7 @@ class BrainMapperUNet3D(nn.Module):
self
.
bottleneck
=
modules
.
ConvolutionalBlock3D
(
parameters
)
parameters
[
'input_channels'
]
=
parameters
[
'output_channels'
]
*
2
.0
parameters
[
'input_channels'
]
=
parameters
[
'output_channels'
]
*
2
self
.
decoderBlock1
=
modules
.
DecoderBlock3D
(
parameters
)
self
.
decoderBlock2
=
modules
.
DecoderBlock3D
(
parameters
)
self
.
decoderBlock3
=
modules
.
DecoderBlock3D
(
parameters
)
...
...
@@ -311,21 +311,23 @@ class BrainMapperUNet3D(nn.Module):
return
prediction
# if __name__ == '__main__':
# # For debugging - To be deleted later! TODO
# parameters = {
# 'kernel_heigth': 5,
# 'kernel_width': 5,
# 'kernel_classification': 1,
# 'input_channels': 1,
# 'output_channels': 64,
# 'convolution_stride': 1,
# 'dropout': 0.2,
# 'pool_kernel_size': 2,
# 'pool_stride': 2,
# 'up_mode': 'upconv',
# 'number_of_classes': 1
# }
# network = BrainMapperUNet(parameters)
if
__name__
==
'__main__'
:
# For debugging - To be deleted later! TODO
parameters
=
{
'kernel_heigth'
:
5
,
'kernel_width'
:
5
,
'kernel_depth'
:
5
,
'kernel_classification'
:
1
,
'input_channels'
:
1
,
'output_channels'
:
64
,
'convolution_stride'
:
1
,
'dropout'
:
0.2
,
'pool_kernel_size'
:
2
,
'pool_stride'
:
2
,
'up_mode'
:
'upconv'
,
'number_of_classes'
:
1
}
network
=
BrainMapperUNet3D
(
parameters
)
utils/modules.py
View file @
6406ec01
...
...
@@ -293,6 +293,7 @@ class ClassifierBlock(nn.Module):
return
logits
class
ConvolutionalBlock3D
(
nn
.
Module
):
"""Parent class for a 3D convolutional block.
...
...
@@ -324,7 +325,7 @@ class ConvolutionalBlock3D(nn.Module):
padding_depth
=
int
((
parameters
[
'kernel_depth'
]
-
1
)
/
2
)
self
.
output_channels
=
parameters
[
'output_channels'
]
self
.
convolutional_layer
=
nn
.
Conv
2
d
(
self
.
convolutional_layer
=
nn
.
Conv
3
d
(
in_channels
=
parameters
[
'input_channels'
],
out_channels
=
parameters
[
'output_channels'
],
kernel_size
=
(
parameters
[
'kernel_depth'
],
...
...
@@ -333,6 +334,7 @@ class ConvolutionalBlock3D(nn.Module):
stride
=
parameters
[
'convolution_stride'
],
padding
=
(
padding_depth
,
padding_heigth
,
padding_width
)
)
self
.
activation
=
nn
.
PReLU
()
# Other activation functions which might be interesting to test:
...
...
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