CGAN_jittor
A Jittor implementation of Conditional GAN (CGAN).
简介
本项目使用 Jittor 机器学习框架,在数字图片数据集 MNIST 上训练一个将随机噪声和类别标签映射为数字图片的 Conditional GAN 模型,生成指定数字序列对应的图片。
相关链接:赛题说明 示例代码
使用方法
首先安装 Jittor,然后在 CGAN.py 第 198 行填入需要生成的数字序列(字符串),直接运行
python3 CGAN.py
即可。会在当前目录下生成中间文件、模型数据、结果。
运行参数如下:
CGAN.py [-h] [--n_epochs N_EPOCHS] [--batch_size BATCH_SIZE] [--lr LR] [--b1 B1]
[--b2 B2] [--n_cpu N_CPU] [--latent_dim LATENT_DIM] [--n_classes N_CLASSES]
[--img_size IMG_SIZE] [--channels CHANNELS]
[--sample_interval SAMPLE_INTERVAL]
optional arguments:
-h, --help show this help message and exit
--n_epochs N_EPOCHS number of epochs of training
--batch_size BATCH_SIZE
size of the batches
--lr LR adam: learning rate
--b1 B1 adam: decay of first order momentum of gradient
--b2 B2 adam: decay of first order momentum of gradient
--n_cpu N_CPU number of cpu threads to use during batch generation
--latent_dim LATENT_DIM
dimensionality of the latent space
--n_classes N_CLASSES
number of classes for dataset
--img_size IMG_SIZE size of each image dimension
--channels CHANNELS number of image channels
--sample_interval SAMPLE_INTERVAL
interval between image sampling
CGAN_jittor
A Jittor implementation of Conditional GAN (CGAN).
简介
本项目使用 Jittor 机器学习框架,在数字图片数据集 MNIST 上训练一个将随机噪声和类别标签映射为数字图片的 Conditional GAN 模型,生成指定数字序列对应的图片。
相关链接:赛题说明 示例代码
使用方法
首先安装 Jittor,然后在 CGAN.py 第 198 行填入需要生成的数字序列(字符串),直接运行
即可。会在当前目录下生成中间文件、模型数据、结果。
运行参数如下: