MCPcopy Index your code
hub / github.com/ChangyuanWang17/APQ-DM

github.com/ChangyuanWang17/APQ-DM @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
239 symbols 584 edges 28 files 44 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

APQ-DM

​ This is the official pytorch implementation for the paper: Towards Accurate Post-training Quantization for Diffusion Models. (CVPR24 Poster Highlight)

Quick Start

Prerequisites

  • python>=3.8
  • pytorch>=1.12.1
  • torchvision>=0.13.0
  • other packages like numpy, tqdm and math

Pretrained Models

You can get full-precision pretrained models from DDIM and DDPM.

Training and Testing

The following experiments were performed in GeForce RTX 3090 with 24GB memory.

Generate CIFAR-10 Images

You can run the following command to generate 50000 CIFAR-10 32*32 images in low bitwidths with differentiable group-wise quantization and active timestep selection.

sh sample_cifar.sh

Calculate FID

After generation, you can run the following command to evaluate IS and FID.

python -m pytorch_fid <dataset path> <image path>

Acknowledgements

We thank the authors of following works for opening source their excellent codes.

Core symbols most depended-on inside this repo

Shape

Method 128
Function 82
Class 29

Languages

Python100%

Modules by API surface

utils/quant_util.py41 symbols
util.py27 symbols
models/diffusion.py18 symbols
runners/diffusion.py17 symbols
pytorch-fid-master/src/pytorch_fid/inception.py17 symbols
pytorch-fid-master/src/pytorch_fid/fid_score.py12 symbols
datasets/vision.py12 symbols
datasets/utils.py10 symbols
datasets/lsun.py10 symbols
utils/quantization_utils/quant_utils.py9 symbols
models/ema.py8 symbols
datasets/__init__.py8 symbols

For agents

$ claude mcp add APQ-DM \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page