import tensorflow as tf

            gradient_penalty = tf.reduce_mean((slopes - 1.) ** 2)
            self.loss_d_rot += lam * gradient_penalty

            train_vars = tf.trainable_variables()
            d_params = [v for v in train_vars if v.name.startswith(name + '/discriminator/')]
            g_params = [v for v in train_vars if v.name.startswith(name + '/generator/')]
