Back to Experiments

Exploratory experiment: GAN training with projection

What was run

A small GAN is trained on a 2D Gaussian mixture with 8 modes under four update rules: plain alternating gradient descent, cosine-scaled projection applied to the generator and discriminator gradients when they conflict, a learned \(2 \times 2\) interaction matrix between \(G\) and \(D\), and an added "skeptical desire" term on the generator loss that penalises low-entropy output. Oscillation amplitude, mode coverage and the convergence score \(S\) are recorded for each. These are exploratory runs; the tables are the outcomes and nothing further is claimed for them.

Method

  1. Standard GAN: Alternating gradient descent on \(G\) and \(D\), no projection. 2D Gaussian mixture target (8 modes).
  2. Projected GAN: Cosine-scaled projection applied to \(\nabla_G\) and \(\nabla_D\) when they conflict (cosine < 0).
  3. Learned interaction: Parameterise the \(G \leftrightarrow D\) interaction as a \(2 \times 2\) matrix \(\alpha\), initialise symmetric, learn from training dynamics.
  4. Skeptical desire GAN: Add a term to the \(G\) loss that penalises low-diversity outputs.
  5. Metrics: oscillation amplitude (std of loss over last 200 steps), mode coverage (fraction of 8 modes captured), \(S\) score.

Results

Training Stability

MethodG Loss (final)D Loss (final)Oscillation AmpSettled by step 1000?
Standard GAN2.31 ± 1.420.12 ± 0.891.83No
Projected GAN1.04 ± 0.210.68 ± 0.150.34Yes
Learned interaction0.91 ± 0.140.72 ± 0.110.22Yes
Skeptical desire0.87 ± 0.090.74 ± 0.080.15Yes

Learned Interaction Matrix

EntryInitialLearnedReading
\(\alpha_{G \to D}\)0.500.71D responds strongly to G changes
\(\alpha_{D \to G}\)0.500.38G responds less to D feedback
\(\alpha_{G \to G}\)1.000.92G self-influence slightly damped
\(\alpha_{D \to D}\)1.001.04D self-influence slightly raised

The learned matrix is asymmetric in this run: \(\alpha_{G \to D} = 0.71\), \(\alpha_{D \to G} = 0.38\).

Mode Coverage

MethodModes Covered (of 8)Mode Quality (avg KL)
Standard GAN3.2 ± 1.80.89
Projected GAN6.4 ± 0.90.31
Learned interaction7.1 ± 0.60.22
Skeptical desire7.6 ± 0.50.14

S Score along training

Method\(S\) at step 100\(S\) at step 500\(S\) at step 1000
Standard GAN0.120.080.11 (oscillating)
Projected GAN0.340.710.89
Learned interaction0.410.780.93
Skeptical desire0.450.820.96

In these runs \(S\) is above 0.8 at step 1000 for the three settled variants and around 0.1 for the oscillating one.

Observations

  • The plain GAN oscillates; \(\nabla_G\) and \(\nabla_D\) are anti-correlated. With cosine projection the oscillation amplitude falls from 1.83 to 0.34 in this run.
  • The learned interaction matrix ends asymmetric, with \(D\) more responsive to \(G\) than the reverse.
  • With the added entropy penalty on the generator, mode coverage in this run is 7.6 of 8 against 3.2 of 8 for the plain GAN.
  • \(S\) is low throughout the oscillating run and rises in the settled runs.

Reproducibility

../simplex/build/sxc exp_gan_convergence.sx -o build/exp_gan_convergence.ll

OPENSSL_PREFIX=$(brew --prefix openssl)
clang -O2 build/exp_gan_convergence.ll \
  ../simplex/runtime/standalone_runtime.c \
  -o build/exp_gan_convergence \
  -lm -lssl -lcrypto -L${OPENSSL_PREFIX}/lib

./build/exp_gan_convergence

Related