Example #1
0
def gen(Z, w, w1, w2, w3):
    h0 = ReLU(batchnorm(T.dot(Z, w)))
    h1 = ReLU(batchnorm(T.dot(h0, w1)))
    h1_output = h1.reshape((h1.shape[0], nkerns[2], 7, 7))
    h2_input = repeat(repeat(h1_output, 2, 2), 2, 3)
    h2 = ReLU(batchnorm(conv2d(h2_input, w2, border_mode='half')))
    h3_input = repeat(repeat(h2, 2, 2), 2, 3)
    h3 = T.tanh(conv2d(h3_input, w3, border_mode='half'))
    return h3
Example #2
0
def gen(Z, w, w1, w2, w3, w4):
    h0 = ReLU(batchnorm(T.dot(Z, w)))
    h1_input = h0.reshape((h0.shape[0], nkerns[3], 4, 4))
    h1 = ReLU(batchnorm(conv2d(h1_input, w1, border_mode='half')))
    h2_input = repeat(repeat(h1, 2, 2), 2, 3)
    h2 = ReLU(batchnorm(conv2d(h2_input, w2, border_mode='half')))
    h3_input = repeat(repeat(h2, 2, 2), 2, 3)
    h3 = ReLU(batchnorm(conv2d(h3_input, w3, border_mode='half')))
    h4_input = repeat(repeat(h3, 2, 2), 2, 3)
    h4 = T.tanh(conv2d(h4_input, w4, border_mode='half'))
    return h4