Discussion:
[theano-users] Grouped convolution not behaving as expected
Michael Oliver
2017-08-10 19:10:44 UTC
Permalink
with newest Theano, libgpuarray, cudnn 6, the following code produces
unexpected results:

x = np.random.randn(100,10,60,60)

k1 = np.random.randn(10,1,5,5)

k2 = np.concatenate([k,k], axis=0)

o1 = T.nnet.conv2d(x,k, num_groups=10)

o1 = o1.eval()

o2 = T.nnet.conv2d(x,k2, num_groups=10)

o2 = o2.eval()

o1[0,:,0,0]
array([ 3.22360683, -1.20146486, -0.47498998, 0.24816176, -5.08138128,
-6.36815384, -4.16210719, -9.07320647, 6.09663779, 4.29091563])

o2[0,:,0,0]
array([ 3.22360683, 2.03843043, -0.65284486, -3.08015858,
2.71291378, -5.86320533, 1.53297356, 3.75655768,
-1.23243404, 4.76971381, -2.61702975, 7.87672154,
-5.74371147, 8.65516924, 10.45707448, 0.67422908,
8.08504753, -0.83615408, -7.9871845 , 4.29091563])

Should not o2 be just o1 repeated twice? Given that the first and last
values match, but nothing else does, unless I'm misunderstanding something
it seems like some kind of bug. Thanks!
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Oliver
2017-08-10 20:56:02 UTC
Permalink
Sorry these places where its just k should be k1:

k2 = np.concatenate([k1,k1], axis=0)

o1 = T.nnet.conv2d(x,k1, num_groups=10)
Post by Michael Oliver
with newest Theano, libgpuarray, cudnn 6, the following code produces
x = np.random.randn(100,10,60,60)
k1 = np.random.randn(10,1,5,5)
k2 = np.concatenate([k,k], axis=0)
o1 = T.nnet.conv2d(x,k, num_groups=10)
o1 = o1.eval()
o2 = T.nnet.conv2d(x,k2, num_groups=10)
o2 = o2.eval()
o1[0,:,0,0]
array([ 3.22360683, -1.20146486, -0.47498998, 0.24816176, -5.08138128,
-6.36815384, -4.16210719, -9.07320647, 6.09663779, 4.29091563])
o2[0,:,0,0]
array([ 3.22360683, 2.03843043, -0.65284486, -3.08015858,
2.71291378, -5.86320533, 1.53297356, 3.75655768,
-1.23243404, 4.76971381, -2.61702975, 7.87672154,
-5.74371147, 8.65516924, 10.45707448, 0.67422908,
8.08504753, -0.83615408, -7.9871845 , 4.29091563])
Should not o2 be just o1 repeated twice? Given that the first and last
values match, but nothing else does, unless I'm misunderstanding something
it seems like some kind of bug. Thanks!
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Michael Oliver
2017-08-11 01:42:04 UTC
Permalink
Nevermind: https://github.com/Theano/Theano/issues/6297
Post by Michael Oliver
k2 = np.concatenate([k1,k1], axis=0)
o1 = T.nnet.conv2d(x,k1, num_groups=10)
Post by Michael Oliver
with newest Theano, libgpuarray, cudnn 6, the following code produces
x = np.random.randn(100,10,60,60)
k1 = np.random.randn(10,1,5,5)
k2 = np.concatenate([k,k], axis=0)
o1 = T.nnet.conv2d(x,k, num_groups=10)
o1 = o1.eval()
o2 = T.nnet.conv2d(x,k2, num_groups=10)
o2 = o2.eval()
o1[0,:,0,0]
array([ 3.22360683, -1.20146486, -0.47498998, 0.24816176, -5.08138128,
-6.36815384, -4.16210719, -9.07320647, 6.09663779, 4.29091563])
o2[0,:,0,0]
array([ 3.22360683, 2.03843043, -0.65284486, -3.08015858,
2.71291378, -5.86320533, 1.53297356, 3.75655768,
-1.23243404, 4.76971381, -2.61702975, 7.87672154,
-5.74371147, 8.65516924, 10.45707448, 0.67422908,
8.08504753, -0.83615408, -7.9871845 , 4.29091563])
Should not o2 be just o1 repeated twice? Given that the first and last
values match, but nothing else does, unless I'm misunderstanding something
it seems like some kind of bug. Thanks!
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...