def _validate(self, machine, n=10):
N = n * n
z = np.random.normal(0., 1., size=[n, self.arch['z_dim']])
z = np.concatenate([z] * n, axis=1)
z = np.reshape(z, [N, -1]).astype(np.float32) # consecutive rows
y = np.asarray(
[[5, 0, 0 ],
[9, 0, 0 ],
[12, 0, 0 ],
[17, 0, 0 ],
[19, 0, 0 ],
[161, 0, 0 ],
[170, 0, 0 ],
[170, 16, 0 ],
[161, 9, 4 ],
[19, 24, 50]],
dtype=np.int64)
y = np.concatenate([y] * n, axis=0)
Z = tf.constant(z)
Y = tf.constant(y)
Xh = machine.generate(Z, Y) # 100, 64, 64, 3
Xh = make_png_thumbnail(Xh, n)
return Xh
评论列表
文章目录