@staticmethod
def get_deconv_filter(f_shape, trainable):
    width = f_shape[0]
    height = f_shape[1]
    f = math.ceil((width / 2.0))
    c = ((((2 * f) - 1) - (f % 2)) / (2.0 * f))
    bilinear = np.zeros([f_shape[0], f_shape[1]])
    for x in range(width):
        for y in range(height):
            value = ((1 - abs(((x / f) - c))) * (1 - abs(((y / f) - c))))
            bilinear[(x, y)] = value
    weights = np.zeros(f_shape)
    for i in range(f_shape[2]):
        weights[:, :, i, i] = bilinear
    init = tf.constant_initializer(value=weights, dtype=tf.float32)
    return tf.get_variable(name='weights', initializer=init, shape=weights.shape, trainable=trainable, collections=['wd', 'variables', 'filters'])
@staticmethod
def get_deconv_filter(f_shape, trainable):
    width = f_shape[0]
    height = f_shape[1]
    f = math.ceil((width / 2.0))
    c = ((((2 * f) - 1) - (f % 2)) / (2.0 * f))
    bilinear = np.zeros([f_shape[0], f_shape[1]])
    for x in range(width):
        for y in range(height):
            value = ((1 - abs(((x / f) - c))) * (1 - abs(((y / f) - c))))
            bilinear[(x, y)] = value
    weights = np.zeros(f_shape)
    for i in range(f_shape[2]):
        weights[:, :, i, i] = bilinear
    init = tf.constant_initializer(value=weights, dtype=tf.float32)
    return tf.get_variable(name='weights', initializer=init, shape=weights.shape, trainable=trainable, collections=['wd', 'variables', 'filters'])