def encoder(X, w1, g1, b1, w2, g2, b2, w3, g3, b3, w4, g4, b4, wz):
filter_shape = (Channel[1] , Channel[0], kernal[0], kernal[0], kernal[0])
Dl1 = lrelu(batchnorm(conv(X,w1,filter_shape = filter_shape),g = g1, b = b1))
filter_shape = (Channel[2] , Channel[1], kernal[1], kernal[1], kernal[1])
Dl2 = lrelu(batchnorm(conv(Dl1, w2,filter_shape = filter_shape), g = g2, b= b2))
filter_shape = (Channel[3] , Channel[2], kernal[2], kernal[2], kernal[2])
Dl3 = lrelu(batchnorm(conv(Dl2,w3,filter_shape = filter_shape), g = g3, b= b3))
filter_shape = (Channel[4] , Channel[3], kernal[3], kernal[3], kernal[3])
Dl4 = lrelu(batchnorm(conv(Dl3,w4,filter_shape = filter_shape), g = g4, b = b4))
Dl4 = T.flatten(Dl4,2)
DlZ = sigmoid(T.dot(Dl4,wz))
return DlZ
# def gen_Z(dist):
# mu = dist[:Nz]
# sigma = dist[Nz:]
评论列表
文章目录