Skip to content

create a script to train autoencoderkl - #10605

Merged
sayakpaul merged 15 commits into
huggingface:mainfrom
lavinal712:main
Jan 27, 2025
Merged

create a script to train autoencoderkl#10605
sayakpaul merged 15 commits into
huggingface:mainfrom
lavinal712:main

Conversation

@lavinal712

Copy link
Copy Markdown
Contributor

Add AutoencoderKL Training Script

Description

This PR adds a complete training script for AutoencoderKL models. The script supports the following features:

  • Multiple loss functions (L1/L2 reconstruction loss, LPIPS perceptual loss, KL divergence)
  • Integrated adversarial training
  • Mixed precision training support
  • Comprehensive training logging and validation
  • Hugging Face Hub model upload
  • Detailed command-line parameter configuration

Key Features

Core Training Pipeline

  • Complete VAE training loop implementation
  • Multi-GPU distributed training support
  • Gradient accumulation and checkpoint saving

Loss Functions

  • Reconstruction loss (L1/L2)
  • LPIPS perceptual loss
  • KL divergence regularization
  • Adversarial loss

Optimization & Performance

  • 8-bit Adam optimizer support
  • Integrated xFormers memory optimization
  • TF32 acceleration support

Monitoring & Validation

  • TensorBoard and WandB logging
  • Periodic validation with sample image saving
  • Detailed training metrics monitoring

@sayakpaul

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants