MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / g_forward

Method g_forward

unsupervised_class3/dcgan_tf.py:375–404  ·  view source on GitHub ↗
(self, Z, reuse=None, is_training=True)

Source from the content-addressed store, hash-verified

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):

Callers 2

__init__Method · 0.95
build_generatorMethod · 0.95

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected