- DDPM: Denoising Diffusion Probabilistic Model
- basic sampler -> Stable Diffusion's basic sampler
- 1000 steps
- DDIM: Denoising Diffusion Implicit Model
- DDPM -> DDIM
- 10 ~ 50 steps
- Euler Discrete
- Ordinary Differential Equation (OED)
- simple & fast
- same of DDIM or more steps
- OLSS: Optimal Linear Subspace Search
- fast, but using the old model
- 5 ~ 10 steps
- CM: Consistency Model
- 1 step
- pixel space
- complex calculation
- limited high resolution image
- LCM: Latent Consistency Model
- 1 ~ 4 steps
- latent space
- low dimension calculation
- support high resolution image
- need LoRA or need re-training model (cannot use old model)
Saturday, October 25, 2025
Sampler - Stable Diffusion
Monday, October 20, 2025
Image quality metric (Generative AI)
- PSNR (Peak Signal to Noise Ratio)
- SSIM (Structural SIMilarity)
- Image quality assessment: from error visibility to structural similarity
- Understanding SSIM
- The SSIM Index for Image Quality Assessment
- FID (Frechet Inception Distance)
- LPIPS
Monday, June 2, 2025
Code Review - C++
- Papers
- Challenges of Refactoring C Programs
- https://refactoring.guru/design-patterns/cpp
- Discipline Matters: Refactoring of Preprocessor Directives in the #ifdef Hell
- Embracing the C preprocessor during refactoring
- Articles
- Why Google Stores Billions of Lines of Code in a single Repository
- Software Engineering at Google
- C to C++: 5 Tips for Refactoring C Code into C++
- Tips for C++ Refactoring
- Refactoring for C/C++ and C#: Let the Machine do the Work
- Refactoring in C++: Top Techniques and Best Practices
- Books
Saturday, January 18, 2025
LVM - DDPM, DDIM
- Evaluation
- Inception Score
- FID (Freche Inception Distance)
- LVM - Large Visual Model
- GAN
- DDPM: denoising diffusion probabilistic models (https://arxiv.org/abs/2006.11239)
- DDIM: denoising diffusion models (https://arxiv.org/abs/2010.02502)
Saturday, November 16, 2024
LLM - Sampling Temperature, Top K, and Top P, What & How?
In the LLM, using sampling
When we set the temperature, top K, and top P in the LLM, do you know what they are and what the order for applying them is?
- LLM Samplers Explained
- How to sample from the language model
- What is the actual order of execution when Top-K, Top-P, and Temperature are used together for NLP decoding?
- Token selection strategies: Top-K, Top-P, and Temperature
- Can someone explain what Top K and Top P are and what they do and how to use them?
- Mastering LLM Parameters: A Deep Dive into Temperature, Top-K, and Top-P
- The Curious Case of Neural Text Degeneration (Nucleus Sampling)
Thursday, October 10, 2024
PyTorch - get the total number of model parameter
- https://stackoverflow.com/questions/49201236/check-the-total-number-of-parameters-in-a-pytorch-model
- https://discuss.pytorch.org/t/how-do-i-check-the-number-of-parameters-of-a-model/4325
1. simple version
pytorch_total_params = sum(p.numel() for p in model.parameters())
2. listed version
str_name = "name"
str_parameter = "parameter"
print(f"{str_name:50s}: {str_parameter:10s}")
total_params = 0
for name, parameter in model.named_parameters():
if not parameter.requires_grad:
continue
params = parameter.numel()
print(f"{name:50s}: {params:10s}")
total_params += params
print(f"Total Trainable Params: {total_params}")
return total_params
Friday, September 13, 2024
PIL - image resize() from the basic code & idea
PIL: Python Image Library: https://github.com/python-pillow/
Written by Fredrik Lundh(https://groups.google.com/g/dev-python/c/fbv5gWgaGpM?pli=1)
image resize algorithm
- https://en.wikipedia.org/wiki/Image_scaling
- https://en.wikipedia.org/wiki/Affine_transformation#Examples
- affine transformation scaling
- Please refer to "scale about image" image
- https://en.wikipedia.org/wiki/Bicubic_interpolation
- Pillow(PIL) Image resize NEAREST behavior differs depending on the version
- Resizing Images With Bicubic Interpolation