Skip to content
プロジェクト

tyfeld/drifting-model

GitHubで見る

tyfeld/drifting-model has 250 GitHub stars and 27 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-24 12:20 UTC. Last push 2026-02-06.

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
履歴を収集中
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

概要

Personal PyTorch implementation of "Generative Modeling via Drifting" with Claude

機械学習

Drifting Models

Unofficial PyTorch implementation of "Generative Modeling via Drifting".

Just for fun and learning. Feel free to test and pull request~

One-step generation - no iterative sampling required (1-NFE).

Method

Drifting Models train a generator by computing a drifting field V that points generated samples toward real data and away from other generated samples. The loss is simply ||V||^2, which reaches zero when generated samples are indistinguishable from real data.

Key components:

  • DiT-style generator with adaLN-Zero conditioning
  • Drifting field V computed via soft assignment matrices (Algorithm 2)
  • Multi-temperature V computation for multi-scale structure
  • Classifier-free guidance (CFG) support

Requirements

pip install torch torchvision einops

TODO

  • Support MNIST and CIFAR-10
  • Support ImageNet

Usage

Training

# MNIST (pixel space, ~20 min on GPU)
python train.py --dataset mnist

# CIFAR-10 (with feature encoder)
python train.py --dataset cifar10

Sampling

python sample.py --checkpoint outputs/mnist/checkpoint_final.pt --dataset mnist

Results

MNIST samples after ~8000 steps:

MNIST Samples

CIFAR-10 samples after ~8500 steps:

CIFAR-10 Samples

Project Structure

├── model.py            # DiT-style generator
├── drifting.py         # Drifting field V computation
├── feature_encoder.py  # CNN feature encoder (for CIFAR)
├── train.py            # Training loop
├── sample.py           # Sampling script
└── utils.py            # EMA, utilities

Key Hyperparameters

Parameter MNIST CIFAR-10
Model DriftDiT-Tiny (9M) DriftDiT-Small (27M)
Epochs 100 200
LR 2e-4 2e-4
Temperatures [0.02, 0.05, 0.2] [0.02, 0.05, 0.2]
Feature space Pixel (L2 norm) CNN encoder

関連プロジェクトを探す

読み込み中…