Skip to content
GitLab
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
ca61c821
Commit
ca61c821
authored
Aug 14, 2020
by
Andrei Roibu
Browse files
added flag for tanh/sig/none change
parent
b79d46ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/modules.py
View file @
ca61c821
...
...
@@ -309,8 +309,12 @@ class ResNetClassifierBlock3D(nn.Module):
self
.
normalization
=
nn
.
InstanceNorm3d
(
num_features
=
parameters
[
'number_of_classes'
])
self
.
activation
=
nn
.
Sigmoid
()
# self.activation = nn.Tanh()
if
parameters
[
'final_activation'
]
==
'sigmoid'
:
self
.
activation
=
nn
.
Sigmoid
()
elif
parameters
[
'final_activation'
]
==
'tanh'
:
self
.
activation
=
nn
.
Tanh
()
else
:
self
.
activation
=
None
# TODO: Might be wworth looking at GANS for image generation, and adding padding
...
...
@@ -329,6 +333,7 @@ class ResNetClassifierBlock3D(nn.Module):
logits
=
self
.
normalization
(
self
.
convolutional_layer
(
X
))
logits
=
self
.
activation
(
logits
)
if
isinstance
(
self
.
activation
,
(
nn
.
Sigmoid
,
nn
.
Tanh
)):
logits
=
self
.
activation
(
logits
)
return
logits
return
logits
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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