home/ atoms/ rave-two-phase-training

RAVE trains in two sequential phases: reconstruction first, adversarial refinement second

Phase 1 trains encoder and decoder jointly using spectral distance losses only, with no discriminator. This establishes a stable latent representation. Phase 2 (‘warmed up’) introduces a GAN discriminator: the generator optimizes adversarial loss and feature-matching loss in addition to distance losses, which improves audio quality at the cost of harder-to-read metrics. The two-phase structure is deliberate: running adversarial training from scratch is unstable, so the reconstruction phase provides a foundation. The transition is triggered by a step counter (the model’s phase_1_duration argument, stored internally as self.warmup), not by a quality metric.

Examples

In the code, pl_module.warmed_up gates whether discrimination runs; the WarmupCallback flips it to True once training_steps >= pl_module.warmup (= phase_1_duration). Monitor spectral distance in phase 1; when phase 2 kicks in those distance values increase, which is normal.

Assessment

Given a TensorBoard log where loss_dis and pred_true first appear at a specific step, explain what changed and why the earlier reconstruction losses went back up slightly at that point.

“if self.state['training_steps'] >= pl_module.warmup: pl_module.warmed_up”
corpus · rave-realtime-audio-variational-autoencoder-train-your-own-n · chunk 20