This project is an implementation of a Conditional Generative Adversarial Network (CGAN) in Python using the Jittor deep learning framework. The model is trained on the MNIST dataset to generate images of handwritten digits based on the input class labels.
Installation
To install the necessary dependencies for this project, you need to have Python and pip installed on your system. If you have these, you can install the dependencies by running the following command in your terminal:
pip install -r requirements.txt
The requirements.txt file includes the following Python packages:
jittor
numpy
pillow
Running the Project
To run the project, simply execute the CGAN.py script with Python:
python sample.py
Optional arguments:
--n_epochs: Number of epochs to train the model (default: 100)
--batch_size: Batch size for training (default: 256)
--lr: Learning rate for the optimizer (default: 0.0002)
--b1: Adam optimizer’s beta1 parameter (default: 0.5)
--b2: Adam optimizer’s beta2 parameter (default: 0.999)
--n_cpu: Number of CPU threads to use during batch generation (default: 8)
--latent_dim: Dimensionality of the latent space (default: 100)
--n_classes: Number of classes for the dataset (default: 10)
--img_size: Size of each image dimension (default: 32)
--channels: Number of image channels (default: 1)
--sample_interval: Interval between image sampling (default: 1000)
How to Use
The project is designed to generate images based on the number field in the main script CGAN.py. The generated images are saved in the same directory with the name result.png.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
Contributions to this project are welcome. Please feel free to fork the project, make your changes, and submit a pull request.
Contact
If you have any questions or issues, please open an issue in the GitHub repository.
Acknowledgements
This project is based on the Conditional Generative Adversarial Network (CGAN) model. We would like to acknowledge the original authors of the CGAN paper for their contributions to the field of deep learning.
关于
A Jittor implementation of Conditional GAN (CGAN).
Conditional GAN Project with Jittor
Project Description
This project is an implementation of a Conditional Generative Adversarial Network (CGAN) in Python using the Jittor deep learning framework. The model is trained on the MNIST dataset to generate images of handwritten digits based on the input class labels.
Installation
To install the necessary dependencies for this project, you need to have Python and pip installed on your system. If you have these, you can install the dependencies by running the following command in your terminal:
The
requirements.txt
file includes the following Python packages:Running the Project
To run the project, simply execute the
CGAN.py
script with Python:Optional arguments:
--n_epochs
: Number of epochs to train the model (default: 100)--batch_size
: Batch size for training (default: 256)--lr
: Learning rate for the optimizer (default: 0.0002)--b1
: Adam optimizer’s beta1 parameter (default: 0.5)--b2
: Adam optimizer’s beta2 parameter (default: 0.999)--n_cpu
: Number of CPU threads to use during batch generation (default: 8)--latent_dim
: Dimensionality of the latent space (default: 100)--n_classes
: Number of classes for the dataset (default: 10)--img_size
: Size of each image dimension (default: 32)--channels
: Number of image channels (default: 1)--sample_interval
: Interval between image sampling (default: 1000)How to Use
The project is designed to generate images based on the
number
field in the main scriptCGAN.py
. The generated images are saved in the same directory with the nameresult.png
.License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
Contributions to this project are welcome. Please feel free to fork the project, make your changes, and submit a pull request.
Contact
If you have any questions or issues, please open an issue in the GitHub repository.
Acknowledgements
This project is based on the Conditional Generative Adversarial Network (CGAN) model. We would like to acknowledge the original authors of the CGAN paper for their contributions to the field of deep learning.