{"id":31227572,"url":"https://github.com/raphaelsenn/cgan","last_synced_at":"2025-09-22T04:53:57.258Z","repository":{"id":315211691,"uuid":"1058522178","full_name":"raphaelsenn/CGAN","owner":"raphaelsenn","description":"PyTorch reimplementation of \"Conditional Generative Adversarial Nets\" (Mirza and Osindero, 2014).","archived":false,"fork":false,"pushed_at":"2025-09-17T09:49:09.000Z","size":412,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T10:31:38.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphaelsenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T07:47:59.000Z","updated_at":"2025-09-17T09:49:12.000Z","dependencies_parsed_at":"2025-09-17T10:31:39.702Z","dependency_job_id":"34b6bfa3-d633-4858-b80d-ae6393eba967","html_url":"https://github.com/raphaelsenn/CGAN","commit_stats":null,"previous_names":["raphaelsenn/cgan"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/CGAN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FCGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FCGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FCGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FCGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/CGAN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FCGAN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276348316,"owners_count":25626605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-22T04:53:56.621Z","updated_at":"2025-09-22T04:53:57.234Z","avatar_url":"https://github.com/raphaelsenn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conditional Generative Adversarial Networks (Goodfellow et al., 2014)\nThis code implements the fully connected generator and discriminator for the MNIST dataset as described in Mirza and Osindero (2014), [\"Conditional Generative Adversarial Networks\"](https://arxiv.org/abs/1406.2661).\n\n![gan_objective](./assets/gan_objective.png)\n\n*Equation 1: The original GAN objective, where G denotes the generator and D the discriminator (Goodfellow et al., 2014).*\n\n![cgan_objective](./assets/cgan_objective.png)\n\n*Equation 2: The CGAN objective, where G denotes the generator and D the discriminator (Mirza and Osindero, 2014).*\n\n![cgan_architecture](./assets/cgan_architecture.png)\n\n*Figure 1: Illustrating the CGAN structure (Mirza and Osindero, 2014).*\n\n## MNIST (fully-connected model)\n\n#### Model Architecture:\n\nGenerator:\n* Architecture in `./src/cgan_fc.py`\n* Learnable parameters: 2413984\n\nDiscriminator:\n* Architecture in `./src/cgan_fc.py`\n* Learnable parameters: 1224351\n\n#### Hyperparameters/Settings:\n* Epochs: 100  \n* Batch size: 128\n* Objective: Binary Cross-Entropy Loss with Logits\n* Generator optimizer: Adam\n* Discriminator optimizer: Adam\n* Generator learning rate: 0.0002  \n* Discriminator learning rate: 0.0002  \n* Generator betas: (0.5, 0.999)  \n* Discriminator betas: (0.5, 0.999)  \n\n#### Training Data:\n![MNIST_Training_Data](./assets/mnist_train.png)\n\n#### GAN Training Losses:\n![MNIST_Loss](./assets/mnist_loss.png)\n\n\n#### Fake Data:\n![MNIST_Fake_Data](./assets/mnist_fake.png)\n\n## Citations\n\n```bibtex\n@misc{mirza2014conditionalgenerativeadversarialnets,\n      title={Conditional Generative Adversarial Nets}, \n      author={Mehdi Mirza and Simon Osindero},\n      year={2014},\n      eprint={1411.1784},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG},\n      url={https://arxiv.org/abs/1411.1784}, \n}\n```\n\n```bibtex\n@misc{goodfellow2014generativeadversarialnetworks,\n      title={Generative Adversarial Networks}, \n      author={Ian J. Goodfellow and Jean Pouget-Abadie and Mehdi Mirza and Bing Xu and David Warde-Farley and Sherjil Ozair and Aaron Courville and Yoshua Bengio},\n      year={2014},\n      eprint={1406.2661},\n      archivePrefix={arXiv},\n      primaryClass={stat.ML},\n      url={https://arxiv.org/abs/1406.2661}, \n}\n```\n\n```bibtex\n@misc{goodfellow2013maxoutnetworks,\n      title={Maxout Networks}, \n      author={Ian J. Goodfellow and David Warde-Farley and Mehdi Mirza and Aaron Courville and Yoshua Bengio},\n      year={2013},\n      eprint={1302.4389},\n      archivePrefix={arXiv},\n      primaryClass={stat.ML},\n      url={https://arxiv.org/abs/1302.4389}, \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fcgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fcgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fcgan/lists"}