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
e0747470
Commit
e0747470
authored
May 27, 2020
by
Benjamin Thomas Graham
Browse files
integer division
parent
c8422eda
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
5 deletions
+5
-5
sparseconvnet/averagePooling.py
sparseconvnet/averagePooling.py
+1
-1
sparseconvnet/convolution.py
sparseconvnet/convolution.py
+1
-1
sparseconvnet/maxPooling.py
sparseconvnet/maxPooling.py
+1
-1
sparseconvnet/randomizedStrideConvolution.py
sparseconvnet/randomizedStrideConvolution.py
+1
-1
sparseconvnet/randomizedStrideMaxPooling.py
sparseconvnet/randomizedStrideMaxPooling.py
+1
-1
No files found.
sparseconvnet/averagePooling.py
View file @
e0747470
...
@@ -29,7 +29,7 @@ class AveragePooling(Module):
...
@@ -29,7 +29,7 @@ class AveragePooling(Module):
output
=
SparseConvNetTensor
()
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
.
metadata
output
.
metadata
=
input
.
metadata
output
.
spatial_size
=
(
output
.
spatial_size
=
(
input
.
spatial_size
-
self
.
pool_size
)
/
self
.
pool_stride
+
1
input
.
spatial_size
-
self
.
pool_size
)
/
/
self
.
pool_stride
+
1
assert
((
output
.
spatial_size
-
1
)
*
self
.
pool_stride
+
assert
((
output
.
spatial_size
-
1
)
*
self
.
pool_stride
+
self
.
pool_size
==
input
.
spatial_size
).
all
()
self
.
pool_size
==
input
.
spatial_size
).
all
()
output
.
features
=
AveragePoolingFunction
.
apply
(
output
.
features
=
AveragePoolingFunction
.
apply
(
...
...
sparseconvnet/convolution.py
View file @
e0747470
...
@@ -33,7 +33,7 @@ class Convolution(Module):
...
@@ -33,7 +33,7 @@ class Convolution(Module):
output
=
SparseConvNetTensor
()
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
.
metadata
output
.
metadata
=
input
.
metadata
output
.
spatial_size
=
\
output
.
spatial_size
=
\
(
input
.
spatial_size
-
self
.
filter_size
)
/
self
.
filter_stride
+
1
(
input
.
spatial_size
-
self
.
filter_size
)
/
/
self
.
filter_stride
+
1
assert
((
output
.
spatial_size
-
1
)
*
self
.
filter_stride
+
assert
((
output
.
spatial_size
-
1
)
*
self
.
filter_stride
+
self
.
filter_size
==
input
.
spatial_size
).
all
(),
(
input
.
spatial_size
,
output
.
spatial_size
,
self
.
filter_size
,
self
.
filter_stride
)
self
.
filter_size
==
input
.
spatial_size
).
all
(),
(
input
.
spatial_size
,
output
.
spatial_size
,
self
.
filter_size
,
self
.
filter_stride
)
output
.
features
=
ConvolutionFunction
.
apply
(
output
.
features
=
ConvolutionFunction
.
apply
(
...
...
sparseconvnet/maxPooling.py
View file @
e0747470
...
@@ -80,7 +80,7 @@ class MaxPooling(Module):
...
@@ -80,7 +80,7 @@ class MaxPooling(Module):
output
=
SparseConvNetTensor
()
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
.
metadata
output
.
metadata
=
input
.
metadata
output
.
spatial_size
=
(
output
.
spatial_size
=
(
input
.
spatial_size
-
self
.
pool_size
)
/
self
.
pool_stride
+
1
input
.
spatial_size
-
self
.
pool_size
)
/
/
self
.
pool_stride
+
1
assert
((
output
.
spatial_size
-
1
)
*
self
.
pool_stride
+
assert
((
output
.
spatial_size
-
1
)
*
self
.
pool_stride
+
self
.
pool_size
==
input
.
spatial_size
).
all
()
self
.
pool_size
==
input
.
spatial_size
).
all
()
output
.
features
=
MaxPoolingFunction
.
apply
(
output
.
features
=
MaxPoolingFunction
.
apply
(
...
...
sparseconvnet/randomizedStrideConvolution.py
View file @
e0747470
...
@@ -44,7 +44,7 @@ class RandomizedStrideConvolution(Module):
...
@@ -44,7 +44,7 @@ class RandomizedStrideConvolution(Module):
output
=
SparseConvNetTensor
()
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
.
metadata
output
.
metadata
=
input
.
metadata
output
.
spatial_size
=
\
output
.
spatial_size
=
\
(
input
.
spatial_size
-
self
.
filter_size
)
/
self
.
filter_stride
+
1
(
input
.
spatial_size
-
self
.
filter_size
)
/
/
self
.
filter_stride
+
1
assert
((
output
.
spatial_size
-
1
)
*
self
.
filter_stride
+
assert
((
output
.
spatial_size
-
1
)
*
self
.
filter_stride
+
self
.
filter_size
==
input
.
spatial_size
).
all
()
self
.
filter_size
==
input
.
spatial_size
).
all
()
output
.
features
=
(
RandomizedStrideConvolutionFunction
if
self
.
training
else
ConvolutionFunction
).
apply
(
output
.
features
=
(
RandomizedStrideConvolutionFunction
if
self
.
training
else
ConvolutionFunction
).
apply
(
...
...
sparseconvnet/randomizedStrideMaxPooling.py
View file @
e0747470
...
@@ -80,7 +80,7 @@ class RandomizedStrideMaxPooling(Module):
...
@@ -80,7 +80,7 @@ class RandomizedStrideMaxPooling(Module):
output
=
SparseConvNetTensor
()
output
=
SparseConvNetTensor
()
output
.
metadata
=
input
.
metadata
output
.
metadata
=
input
.
metadata
output
.
spatial_size
=
(
output
.
spatial_size
=
(
input
.
spatial_size
-
self
.
pool_size
)
/
self
.
pool_stride
+
1
input
.
spatial_size
-
self
.
pool_size
)
/
/
self
.
pool_stride
+
1
assert
((
output
.
spatial_size
-
1
)
*
self
.
pool_stride
+
assert
((
output
.
spatial_size
-
1
)
*
self
.
pool_stride
+
self
.
pool_size
==
input
.
spatial_size
).
all
()
self
.
pool_size
==
input
.
spatial_size
).
all
()
output
.
features
=
(
RandomizedStrideMaxPoolingFunction
if
self
.
training
else
MaxPoolingFunction
).
apply
(
output
.
features
=
(
RandomizedStrideMaxPoolingFunction
if
self
.
training
else
MaxPoolingFunction
).
apply
(
...
...
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