Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
SparseConvNet
Commits
9f6ebfe7
Commit
9f6ebfe7
authored
Jul 24, 2023
by
Benjamin Thomas Graham
Browse files
SparseGroupNorm
parent
875a43fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
sparseconvnet/__init__.py
sparseconvnet/__init__.py
+1
-1
sparseconvnet/batchNormalization.py
sparseconvnet/batchNormalization.py
+8
-0
sparseconvnet/utils.py
sparseconvnet/utils.py
+7
-0
No files found.
sparseconvnet/__init__.py
View file @
9f6ebfe7
...
...
@@ -8,7 +8,7 @@ forward_pass_multiplyAdd_count = 0
forward_pass_hidden_states
=
0
from
.activations
import
Tanh
,
Sigmoid
,
ReLU
,
LeakyReLU
,
ELU
,
SELU
,
BatchNormELU
from
.averagePooling
import
AveragePooling
from
.batchNormalization
import
BatchNormalization
,
BatchNormReLU
,
BatchNormLeakyReLU
,
MeanOnlyBNLeakyReLU
from
.batchNormalization
import
BatchNormalization
,
BatchNormReLU
,
BatchNormLeakyReLU
,
MeanOnlyBNLeakyReLU
,
SparseGroupNorm
from
.classificationTrainValidate
import
ClassificationTrainValidate
from
.convolution
import
Convolution
from
.deconvolution
import
Deconvolution
...
...
sparseconvnet/batchNormalization.py
View file @
9f6ebfe7
...
...
@@ -208,3 +208,11 @@ class MeanOnlyBNLeakyReLU(Module):
def
__repr__
(
self
):
s
=
'MeanOnlyBatchNorm('
+
str
(
self
.
nPlanes
)
+
',momentum='
+
str
(
self
.
momentum
)
+
',leakiness='
+
str
(
self
.
leakiness
)
+
')'
return
s
class
SparseGroupNorm
(
torch
.
nn
.
GroupNorm
):
def
forward
(
self
,
x
):
return
scn
.
SparseConvNetTensor
(
super
().
forward
(
x
.
features
),
x
.
metadata
,
x
.
spatial_size
)
sparseconvnet/utils.py
View file @
9f6ebfe7
...
...
@@ -335,3 +335,10 @@ class VerboseIdentity(torch.nn.Module):
def
forward
(
self
,
x
):
print
(
x
)
return
x
class
SparseGroupNorm
(
torch
.
nn
.
GroupNorm
):
def
forward
(
self
,
x
):
return
scn
.
SparseConvNetTensor
(
super
().
forward
(
x
.
features
),
x
.
metadata
,
x
.
spatial_size
)
Write
Preview
Markdown
is supported
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