def _validate(self, machine, n=10): N = n * n z = np.random.uniform(-np.pi, np.pi, size=[n, self.arch['z_dim']]) z = np.cos(z) z = np.concatenate([z] * n, axis=1) z = np.reshape(z, [N, -1]).astype(np.float32) # consecutive rows # y = np.random.randint(1, arch['y_dim'], size=[N, 2]) y = np.asarray( [ [5, 0, 0], # 5 [9, 0, 0], # 9 [12, 0, 0], # 2 [17, 0, 0], # 7 [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
def _validate(self, machine, n=10): N = n * n z = np.random.uniform(-np.pi, np.pi, size=[n, self.arch['z_dim']]) z = np.cos(z) z = np.concatenate([z] * n, axis=1) z = np.reshape(z, [N, -1]).astype(np.float32) # consecutive rows # y = np.random.randint(1, arch['y_dim'], size=[N, 2]) y = np.asarray( [[5, 0, 0 ], # 5 [9, 0, 0 ], # 9 [12, 0, 0 ], # 2 [17, 0, 0 ], # 7 [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
def _validate(self, machine, n=10): N = n * n # same row same z z = tf.random_normal(shape=[n, self.arch['z_dim']]) z = tf.tile(z, [1, n]) z = tf.reshape(z, [N, -1]) z = tf.Variable(z, trainable=False, dtype=tf.float32) # same column same y y = tf.range(0, 10, 1, dtype=tf.int64) y = tf.reshape(y, [-1,]) y = tf.tile(y, [n,]) Xh = machine.generate(z, y) # 100, 64, 64, 3 Xh = make_png_thumbnail(Xh, n) return Xh
def _validate(self, machine, n=10): N = n * n # same row same z z = tf.random_normal(shape=[n, self.arch['z_dim']]) z = tf.tile(z, [1, n]) z = tf.reshape(z, [N, -1]) z = tf.Variable(z, trainable=False, dtype=tf.float32) # same column same y y = tf.range(0, 10, 1, dtype=tf.int64) y = tf.reshape(y, [ -1, ]) y = tf.tile(y, [ n, ]) Xh = machine.generate(z, y) # 100, 64, 64, 3 Xh = make_png_thumbnail(Xh, n) return Xh