@application
    def apply(self, X):

        print "MultiScaleConvolution apply"

        nsamp = X.shape[0].astype('int16')

        Z = 0
        overshoot = (self.filter_size - 1)/2
        imgs_accum = 0 # accumulate the output image
        for scale in range(self.num_scales-1, -1, -1):
            # downsample image to appropriate scale
            imgs_down = self.downsample(X, scale)
            # do a convolutional transformation on it
            conv_layer = self.children[scale]
            # NOTE this is different than described in the paper, since each conv_layer
            # includes a nonlinearity -- it's not just one nonlinearity at the end
            imgs_down_conv = conv_layer.apply(imgs_down)

            # crop the edge so it's the same size as the input at that scale
            imgs_down_conv_croppoed = imgs_down_conv[:,:,overshoot:-overshoot,overshoot:-overshoot]
            imgs_accum += imgs_down_conv_croppoed

            if scale > 0:
                # scale up by factor of 2
                layer_width = self.spatial_width/2**scale
                imgs_accum = imgs_accum.reshape((nsamp, self.num_filters, layer_width, 1, layer_width, 1))
                imgs_accum = T.concatenate((imgs_accum, imgs_accum), axis=5)
                imgs_accum = T.concatenate((imgs_accum, imgs_accum), axis=3)
                imgs_accum = imgs_accum.reshape((nsamp, self.num_filters, layer_width*2, layer_width*2))

        return imgs_accum/self.num_scales
dataset/ETHPy150Open Sohl-Dickstein/Diffusion-Probabilistic-Models/regression.py/MultiScaleConvolution.apply/original