diff options
| author | gdamms <damguillotin@gmail.com> | 2026-02-05 15:33:20 +0100 |
|---|---|---|
| committer | gdamms <damguillotin@gmail.com> | 2026-02-05 15:33:20 +0100 |
| commit | a5d5f30fbd9c6c7c78834072401932c84bddaf14 (patch) | |
| tree | 577119fc2a538e0f8930cbe2c87ad80a5afe275d /src/config.py | |
| parent | 1efaa6cb2ef38cf5a77c3bb83fb7c62264ed466d (diff) | |
| download | diffusion-mnist-a5d5f30fbd9c6c7c78834072401932c84bddaf14.tar.gz diffusion-mnist-a5d5f30fbd9c6c7c78834072401932c84bddaf14.zip | |
trying to improve whole project
Diffstat (limited to 'src/config.py')
| -rw-r--r-- | src/config.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/config.py b/src/config.py new file mode 100644 index 0000000..4ac56c4 --- /dev/null +++ b/src/config.py @@ -0,0 +1,34 @@ +""" +Configuration file for MNIST Diffusion model. +Contains all hyperparameters and constants. +""" + +import torch + +# Device configuration +DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") + +# Image parameters (MNIST) +IMG_SIZE = 28 +NB_CHANNEL = 1 +NB_LABEL = 10 + +# Diffusion parameters +DIFFU_STEPS = 1000 + +# Noise schedule (linear beta schedule) +BETA = torch.linspace(1e-4, 2e-2, DIFFU_STEPS, device=DEVICE) +BETA = torch.cat((torch.tensor([0.0], device=DEVICE), BETA)) +ALPHA = 1 - BETA +ALPHA_BAR = torch.cumprod(ALPHA, dim=0) + +# Training parameters +EPOCHS = 10 +BATCH_SIZE = 64 +LEARNING_RATE = 2e-4 +NUM_WORKERS = 4 + +# Paths +DATA_DIR = "data" +CHECKPOINT_DIR = "checkpoints" +PLOTS_DIR = "plots" |
