Commit d77687a6 authored by Benjamin Graham's avatar Benjamin Graham Committed by Benjamin Thomas Graham
Browse files

Rename ValidConvolutions to SubmanifoldConvolutions, update for PyTorch 0.4 Tensor/Variable merge

parent 297e04c0
......@@ -14,7 +14,7 @@ local denseModel = nn.Sequential()
local model = nn.Sequential():add(sparseModel):add(denseModel)
sparseModel
:add(sparseconvnet.ValidConvolution(2,3,16,3,false))
:add(sparseconvnet.SubmanifoldConvolution(2,3,16,3,false))
:add(sparseconvnet.SparseResNet(
2,16,{
{'b', 16, 2, 1},
......
......@@ -12,15 +12,15 @@ use_gpu = torch.cuda.is_available()
model = scn.Sequential().add(
scn.SparseVggNet(2, 1,
[['C', 8], ['C', 8], ['MP', 3, 2],
[['C', 8], ['C', 8], ['MP', 3, 2],
['C', 16], ['C', 16], ['MP', 3, 2],
['C', 24], ['C', 24], ['MP', 3, 2]])
).add(
scn.ValidConvolution(2, 24, 32, 3, False)
scn.SubmanifoldConvolution(2, 24, 32, 3, False)
).add(
scn.BatchNormReLU(32)
).add(
scn.SparseToDense(2,32)
scn.SparseToDense(2, 32)
)
if use_gpu:
model.cuda()
......@@ -36,7 +36,7 @@ msg = [
" X X X X X X X X X X X X X X X X X X ",
" X X XXX XXX XXX XX X X XX X X XXX XXX "]
#Add a sample using setLocation
# Add a sample using setLocation
input.addSample()
for y, line in enumerate(msg):
for x, c in enumerate(line):
......@@ -45,7 +45,7 @@ for y, line in enumerate(msg):
featureVector = torch.FloatTensor([1])
input.setLocation(location, featureVector, 0)
#Add a sample using setLocations
# Add a sample using setLocations
input.addSample()
locations = []
features = []
......@@ -73,4 +73,4 @@ output = model.forward(input)
# Output is 2x32x10x10: our minibatch has 2 samples, the network has 32 output
# feature planes, and 10x10 is the spatial size of the output.
print(output.size(), output.data.type())
print(output.shape, output.type())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment