glitchgan.tf.model_components

TensorFlow/Keras model components for cDVGAN.

Architecture is identical to the original TF reference implementation. Lambda layers have been replaced with proper subclassed layers for compatibility with Keras 3 and correct model serialisation.

Module Contents

glitchgan.tf.model_components.NUM_CLASSES = 7[source]
class glitchgan.tf.model_components.ArgmaxLayer(*, activity_regularizer=None, trainable=True, dtype=None, autocast=True, name=None, **kwargs)[source]

Bases: keras.layers.Layer

Return the argmax along the last axis as int32.

call(x)[source]
class glitchgan.tf.model_components.ReduceSumDotLayer(*, activity_regularizer=None, trainable=True, dtype=None, autocast=True, name=None, **kwargs)[source]

Bases: keras.layers.Layer

Compute element-wise product and sum along axis 1 (keepdims).

call(inputs)[source]
glitchgan.tf.model_components.get_discriminator_model(in_shape=8192, num_classes=NUM_CLASSES, print_summary=False)[source]
glitchgan.tf.model_components.get_derivative_discriminator_model(in_shape=8191, num_classes=NUM_CLASSES, print_summary=False)[source]
glitchgan.tf.model_components.get_second_derivative_discriminator_model(in_shape=8190, num_classes=NUM_CLASSES, print_summary=False)[source]
glitchgan.tf.model_components.get_generator_model(noise_dim=100, num_classes=NUM_CLASSES, print_summary=False)[source]