MCPcopy Create free account
hub / github.com/Newmu/dcgan_code / deconv

Function deconv

lib/ops.py:85–96  ·  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

83 return X
84
85def deconv(X, w, subsample=(1, 1), border_mode=(0, 0), conv_mode='conv'):
86 """
87 sets up dummy convolutional forward pass and uses its grad as deconv
88 currently only tested/working with same padding
89 """
90 img = gpu_contiguous(X)
91 kerns = gpu_contiguous(w)
92 desc = GpuDnnConvDesc(border_mode=border_mode, subsample=subsample,
93 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)
94 out = gpu_alloc_empty(img.shape[0], kerns.shape[1], img.shape[2]*subsample[0], img.shape[3]*subsample[1])
95 d_img = GpuDnnConvGradI()(kerns, img, out, desc)
96 return d_img

Callers 3

genFunction · 0.90
genFunction · 0.90
genFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected