add 200epoch result
一个基于 Jittor 的简单条件 GAN(cGAN),将随机噪声和类别标签映射为 32x32 灰度 MNIST 数字,并在训练过程中与推理阶段保存生成结果到 sample_img/。
sample_img/
安装(示例,CUDA 请参考官方文档):
pip install jittor
直接运行:
python CGAN.py
常用参数(脚本内有默认值):
--n_epochs
--batch_size
--lr
--latent_dim
--n_classes
--img_size
--sample_interval
sample_img/<batches_done>.png
./result.png
在 CGAN.py 末尾修改 number 字符串为目标数字序列,然后运行:
CGAN.py
number
脚本会加载 generator_last.pkl、discriminator_last.pkl,并根据序列生成 result.png。
generator_last.pkl
discriminator_last.pkl
result.png
jt.flags.use_cuda = 1
A Jittor implementation of Conditional GAN (CGAN).
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Conditional GAN (Jittor) for MNIST
一个基于 Jittor 的简单条件 GAN(cGAN),将随机噪声和类别标签映射为 32x32 灰度 MNIST 数字,并在训练过程中与推理阶段保存生成结果到
sample_img/。特性
环境依赖
安装(示例,CUDA 请参考官方文档):
训练
直接运行:
常用参数(脚本内有默认值):
--n_epochs训练轮数(默认 100)--batch_sizebatch 大小(默认 64)--lrAdam 学习率(默认 0.0002)--latent_dim噪声维度(默认 100)--n_classes类别数(默认 10)--img_size输出尺寸(默认 32)--sample_interval采样保存间隔(按 batch,默认 1000)输出
sample_img/<batches_done>.png,10x10 网格展示 0–9。./result.png。自定义推理
在
CGAN.py末尾修改number字符串为目标数字序列,然后运行:脚本会加载
generator_last.pkl、discriminator_last.pkl,并根据序列生成result.png。额外说明
jt.flags.use_cuda = 1。