MCPcopy
hub / github.com/junyanz/iGAN / deconv

Function deconv

lib/ops.py:91–102  ·  view source on GitHub ↗

sets up dummy convolutional forward pass and uses its grad as deconv currently only tested/working with same padding

(X, w, subsample=(1, 1), border_mode=(0, 0), conv_mode='conv')

Source from the content-addressed store, hash-verified

89
90
91def deconv(X, w, subsample=(1, 1), border_mode=(0, 0), conv_mode='conv'):
92 """
93 sets up dummy convolutional forward pass and uses its grad as deconv
94 currently only tested/working with same padding
95 """
96 img = gpu_contiguous(X)
97 kerns = gpu_contiguous(w)
98 desc = GpuDnnConvDesc(border_mode=border_mode, subsample=subsample,
99 conv_mode=conv_mode)(gpu_alloc_empty(img.shape[0], kerns.shape[1], img.shape[2] * subsample[0], img.shape[3] * subsample[1]).shape, kerns.shape)
100 out = gpu_alloc_empty(img.shape[0], kerns.shape[1], img.shape[2] * subsample[0], img.shape[3] * subsample[1])
101 d_img = GpuDnnConvGradI()(kerns, img, out, desc)
102 return d_img

Callers 4

genFunction · 0.90
gen_batchnormFunction · 0.90
gen_testFunction · 0.90
gen_testFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected