r/MachineLearning • • 6h ago

Project I finally assembled a U-Net for my DDPM from scratch. This thing took way more brainpower than I expected.[P]

I've been building a diffusion model from scratch in PyTorch, and I've finally reached Phase 3: assembling the full U-Net.

Until now, I was basically learning and implementing individual components:

Residual blocks

Time embeddings and timestep conditioning

GroupNorm

Self-attention

Downsampling and upsampling

But putting everything together is a completely different experience.

Suddenly you're dealing with feature map dimensions, channel transitions, skip connections, timestep embeddings flowing through residual blocks, and making sure the decoder can actually reconstruct the spatial dimensions correctly.

Honestly, understanding each component individually was easier than getting the entire architecture to work together without messing up tensor shapes somewhere.

The most satisfying part was finally seeing the complete architecture come together and understanding why information is moving through the network the way it does, instead of just copying a U-Net implementation from somewhere.

The model is now assembled. Next comes the part I'm both excited and slightly terrified about:

Training it on CelebA and finding out whether it can actually learn to generate faces.

8GB VRAM. A laptop GPU. A lot of patience.

Let's see how this goes. 💀

Anyone here who has trained a diffusion model on limited hardware — what was the biggest mistake you made during your first training run?

0 Upvotes

0 comments sorted by