| 112 | return output_tensor |
| 113 | |
| 114 | def generator_simple(self, z_var): |
| 115 | output_tensor =\ |
| 116 | (pt.wrap(z_var). |
| 117 | flatten(). |
| 118 | custom_fully_connected(self.s16 * self.s16 * self.gf_dim * 8). |
| 119 | reshape([-1, self.s16, self.s16, self.gf_dim * 8]). |
| 120 | conv_batch_norm(). |
| 121 | apply(tf.nn.relu). |
| 122 | custom_deconv2d([0, self.s8, self.s8, self.gf_dim * 4], k_h=4, k_w=4). |
| 123 | # apply(tf.image.resize_nearest_neighbor, [self.s8, self.s8]). |
| 124 | # custom_conv2d(self.gf_dim * 4, k_h=3, k_w=3, d_h=1, d_w=1). |
| 125 | conv_batch_norm(). |
| 126 | apply(tf.nn.relu). |
| 127 | custom_deconv2d([0, self.s4, self.s4, self.gf_dim * 2], k_h=4, k_w=4). |
| 128 | # apply(tf.image.resize_nearest_neighbor, [self.s4, self.s4]). |
| 129 | # custom_conv2d(self.gf_dim * 2, k_h=3, k_w=3, d_h=1, d_w=1). |
| 130 | conv_batch_norm(). |
| 131 | apply(tf.nn.relu). |
| 132 | custom_deconv2d([0, self.s2, self.s2, self.gf_dim], k_h=4, k_w=4). |
| 133 | # apply(tf.image.resize_nearest_neighbor, [self.s2, self.s2]). |
| 134 | # custom_conv2d(self.gf_dim, k_h=3, k_w=3, d_h=1, d_w=1). |
| 135 | conv_batch_norm(). |
| 136 | apply(tf.nn.relu). |
| 137 | custom_deconv2d([0] + list(self.image_shape), k_h=4, k_w=4). |
| 138 | # apply(tf.image.resize_nearest_neighbor, [self.s, self.s]). |
| 139 | # custom_conv2d(3, k_h=3, k_w=3, d_h=1, d_w=1). |
| 140 | apply(tf.nn.tanh)) |
| 141 | return output_tensor |
| 142 | |
| 143 | def get_generator(self, z_var): |
| 144 | if cfg.GAN.NETWORK_TYPE == "default": |