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
36f7d1db
Commit
36f7d1db
authored
Jul 19, 2018
by
Benjamin Thomas Graham
Browse files
fix NetworkInNetwork on CPU; tidy
parent
29c810b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
+19
-18
sparseconvnet/SCN/CPU/NetworkInNetwork.cpp
sparseconvnet/SCN/CPU/NetworkInNetwork.cpp
+1
-1
sparseconvnet/__init__.py
sparseconvnet/__init__.py
+1
-16
sparseconvnet/utils.py
sparseconvnet/utils.py
+17
-1
No files found.
sparseconvnet/SCN/CPU/NetworkInNetwork.cpp
View file @
36f7d1db
...
@@ -17,7 +17,7 @@ double cpu_NetworkInNetwork_updateOutput(/*float*/ at::Tensor input_features,
...
@@ -17,7 +17,7 @@ double cpu_NetworkInNetwork_updateOutput(/*float*/ at::Tensor input_features,
output_features
.
copy_
(
bias
);
output_features
.
copy_
(
bias
);
else
else
output_features
.
zero_
();
output_features
.
zero_
();
output_features
.
addmm
(
input_features
,
weight
);
output_features
.
addmm
_
(
input_features
,
weight
);
return
nActive
*
input_nPlanes
*
output_nPlanes
;
return
nActive
*
input_nPlanes
*
output_nPlanes
;
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
sparseconvnet/__init__.py
View file @
36f7d1db
...
@@ -32,19 +32,4 @@ from .spectral_norm import spectral_norm
...
@@ -32,19 +32,4 @@ from .spectral_norm import spectral_norm
from
.submanifoldConvolution
import
SubmanifoldConvolution
,
ValidConvolution
from
.submanifoldConvolution
import
SubmanifoldConvolution
,
ValidConvolution
from
.tables
import
*
from
.tables
import
*
from
.unPooling
import
UnPooling
from
.unPooling
import
UnPooling
from
.utils
import
appendSparseConvTensors
,
AddCoords
from
.utils
import
append_tensors
,
AddCoords
,
add_feature_planes
,
concatenate_feature_planes
def
concatenate_feature_planes
(
input
):
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
[
0
].
metadata
output
.
spatial_size
=
input
[
0
].
metadata
output
.
features
=
torch
.
cat
([
i
.
features
for
i
in
input
],
1
)
return
output
def
add_feature_planes
(
input
):
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
[
0
].
metadata
output
.
spatial_size
=
input
[
0
].
metadata
output
.
features
=
sum
([
i
.
features
for
i
in
input
])
return
output
sparseconvnet/utils.py
View file @
36f7d1db
...
@@ -49,7 +49,23 @@ def threadDatasetIterator(d):
...
@@ -49,7 +49,23 @@ def threadDatasetIterator(d):
return
iterator
return
iterator
def
appendSparseConvTensors
(
tensors
):
def
concatenate_feature_planes
(
input
):
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
[
0
].
metadata
output
.
spatial_size
=
input
[
0
].
spatial_size
output
.
features
=
torch
.
cat
([
i
.
features
for
i
in
input
],
1
)
return
output
def
add_feature_planes
(
input
):
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
[
0
].
metadata
output
.
spatial_size
=
input
[
0
].
spatial_size
output
.
features
=
sum
([
i
.
features
for
i
in
input
])
return
output
def
append_tensors
(
tensors
):
spatial_size
=
tensors
[
0
].
spatial_size
spatial_size
=
tensors
[
0
].
spatial_size
dimension
=
len
(
spatial_size
)
dimension
=
len
(
spatial_size
)
x
=
SparseConvNetTensor
(
x
=
SparseConvNetTensor
(
...
...
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