(self, Z, reuse=None, is_training=True)
| 373 | |
| 374 | |
| 375 | def g_forward(self, Z, reuse=None, is_training=True): |
| 376 | # dense layers |
| 377 | output = Z |
| 378 | for layer in self.g_denselayers: |
| 379 | output = layer.forward(output, reuse, is_training) |
| 380 | |
| 381 | # project and reshape |
| 382 | output = tf.reshape( |
| 383 | output, |
| 384 | [-1, self.g_dims[0], self.g_dims[0], self.g_sizes['projection']], |
| 385 | ) |
| 386 | |
| 387 | # apply batch norm |
| 388 | if self.g_sizes['bn_after_project']: |
| 389 | output = tf.contrib.layers.batch_norm( |
| 390 | output, |
| 391 | decay=0.9, |
| 392 | updates_collections=None, |
| 393 | epsilon=1e-5, |
| 394 | scale=True, |
| 395 | is_training=is_training, |
| 396 | reuse=reuse, |
| 397 | scope='bn_after_project' |
| 398 | ) |
| 399 | |
| 400 | # pass through fs-conv layers |
| 401 | for layer in self.g_convlayers: |
| 402 | output = layer.forward(output, reuse, is_training) |
| 403 | |
| 404 | return output |
| 405 | |
| 406 | |
| 407 | def fit(self, X): |
no test coverage detected