This is a PyTorch/GPU implementation of the paper: Representation Fréchet Loss for Visual Generation.
@article{yang2026fdloss,
title={Representation Fréchet Loss for Visual Generation},
author={Yang, Jiawei and Geng, Zhengyang and Ju, Xuan and Tian, Yonglong and Wang, Yue},
journal={arXiv:2604.28190},
url={https://arxiv.org/abs/2604.28190},
year={2026}
}FD-Loss post-trains visual generators by matching generated-image feature distributions to real-image feature distributions in frozen representation spaces. This repository includes training, released-checkpoint evaluation, reference statistics utilities, and scripts for the ImageNet experiments.
Download ImageNet and place it in your DATA_ROOT using the standard
ImageFolder layout:
export DATA_ROOT=/path/to/imagenetDownload the code:
git clone https://github.com/Jiawei-Yang/FD-Loss.git
cd FD-LossCreate and activate a conda environment:
conda create -n fdloss python=3.11 -y
conda activate fdloss
pip install --upgrade pip
pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt
pip install -U huggingface_hubReleased checkpoints and data files are hosted on Hugging Face.
hf download jjiaweiyang/FD-Loss \
--local-dir . \
--include "checkpoints/**/*.pth" \
--include "data/**"
python scripts/extract_paper_ref_stats.pySee scripts/README.md for the asset layout and lighter download options.
Evaluate the released FD-SIM models:
PRESET=pMF_H_256 \
CKPT_PATH=checkpoints/post-trained/pMF-H_FD-SIM.pth \
GPUS_PER_NODE=8 \
bash scripts/evaluate_released_ckpt.sh
PRESET=JiT_H \
CKPT_PATH=checkpoints/post-trained/JiT-H_FD-SIM.pth \
GPUS_PER_NODE=8 \
bash scripts/evaluate_released_ckpt.sh
PRESET=iMF_XL \
CKPT_PATH=checkpoints/post-trained/iMF-XL_FD-SIM.pth \
GPUS_PER_NODE=8 \
bash scripts/evaluate_released_ckpt.shAdditional presets and smoke-test settings are documented in scripts/README.md.
Training starts from the released base checkpoints:
export CKPT_ROOT=./checkpoints/baseThe experiment scripts under scripts/ reproduce the Table 1 ablations, Table 2 JiT repurposing, and Table 3 scalability runs. For example:
bash scripts/table_1a_queue_size.sh
bash scripts/table_2_repurpose_jit_L.sh
MODEL_SIZE=L RES=256 bash scripts/table_3_pMF.sh
MODEL_SIZE=XL bash scripts/table_3_iMF.sh
MODEL_SIZE=H bash scripts/table_3_JiT.shThis project is released under the MIT license. See LICENSE for details.
If you have any questions, feel free to contact me through email (yangjiaw@usc.edu).
