Saturday, January 18, 2025

LVM - DDPM, DDIM

  1. Evaluation
    1. Inception Score
    2. FID (Freche Inception Distance)
  2. LVM - Large Visual Model
    1. GAN
    2. DDPM: denoising diffusion probabilistic models (https://arxiv.org/abs/2006.11239)
    3. DDIM: denoising diffusion models (https://arxiv.org/abs/2010.02502)



Thursday, October 10, 2024

PyTorch - get the total number of model parameter

Total number of model parameters


1. simple version

pytorch_total_params = sum(p.numel() for p in model.parameters())

2. listed version

def count_parameters(model):

  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