-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to infer the output shape for Deconvolution2D layer #4
base: master
Are you sure you want to change the base?
Changes from all commits
c797487
111060f
ab29be6
b654a2a
fcc1908
af03021
26b9c44
01fda37
c117361
4818bff
463a550
9ffce28
5d00fb7
5a606c6
810ca65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1052,7 +1052,19 @@ def deconv2d(x, kernel, output_shape, strides=(1, 1), | |
kernel = kernel.dimshuffle((1, 0, 2, 3)) | ||
th_border_mode = _preprocess_border_mode(border_mode) | ||
np_kernel = kernel.eval() | ||
filter_shape = _preprocess_filter_shape(dim_ordering, filter_shape) | ||
filter_shape = _preprocess_filter_shape(dim_ordering, shape(kernel)) | ||
|
||
_t = () | ||
for v in output_shape: | ||
try: | ||
_v = v.eval() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I stuck probably the same issue that @yaringal mentioned - if we infer output_shape, it becomes the tuple of Theano variables/expressions, which Theano couldn't accept as an input due to some reasons.
I'm not an expert in Theano, so have no idea how to fix it quick. |
||
except AttributeError as e: | ||
_v = v | ||
print(e.__str__()) | ||
_t = _t + (v, ) | ||
output_shape = _t | ||
|
||
print("imshp {} kshp {} subsample {} border_mode {} output_shape {}".format(output_shape, filter_shape, strides, th_border_mode, output_shape[2:])) | ||
|
||
op = T.nnet.abstract_conv.AbstractConv2d_gradInputs(imshp=output_shape, | ||
kshp=filter_shape, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dummy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was a kind of inconsistency here - we receive the filter_shape as a parameter, after that we reshape the kernel itself (shape should change) but leave filter_shape intact and pass it to the AbstractConv2d_gradInputs then.
Probably we could totally remove filter_shape from the parameters, if there are no other reasons to use it.