{"id":31227570,"url":"https://github.com/raphaelsenn/gan","last_synced_at":"2025-09-22T04:53:51.942Z","repository":{"id":315207255,"uuid":"1052673788","full_name":"raphaelsenn/GAN","owner":"raphaelsenn","description":"PyTorch reimplementation of \"Generative Adversarial Networks\" (Goodfellow et al., 2014).","archived":false,"fork":false,"pushed_at":"2025-09-17T08:02:53.000Z","size":2159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T10:12:32.811Z","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-08T11:45:34.000Z","updated_at":"2025-09-17T08:02:56.000Z","dependencies_parsed_at":"2025-09-17T10:12:35.110Z","dependency_job_id":"2800100f-a2cc-4ab1-b0a8-d35f75b388c1","html_url":"https://github.com/raphaelsenn/GAN","commit_stats":null,"previous_names":["raphaelsenn/gan"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/GAN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/GAN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2FGAN/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:51.161Z","updated_at":"2025-09-22T04:53:51.930Z","avatar_url":"https://github.com/raphaelsenn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generative Adversarial Networks (Goodfellow et al., 2014)\nThis code implements the fully connected generator and discriminator for the MNIST dataset as described in Goodfellow et al. (2014), [\"Generative Adversarial Networks\"](https://arxiv.org/abs/1406.2661).\nI extend the experiment by applying the architecture to the Fashion-MNIST dataset.\n\n![gan_objective](./assets/gan_objective.png)\n*Figure: The original GAN objective, where G denotes the generator and D the discriminator (Goodfellow et al., 2014).*\n\nOriginal code and hyperparameters from the paper can be found [here](https://github.com/goodfeli/adversarial).\n\n## MNIST (fully connected model)\n\n#### Model Architecture:\n\nGenerator:\n* Input layer: 100 units (Uniform[-1, 1] noise)\n* Dense layer: 1200 units, ReLU\n* Dense layer: 1200 units, ReLU\n* Output layer: 784 units, Sigmoid\n* Learnable parameters: 2503984\n\nDiscriminator:\n* Input layer: 784 units (flattend 28x28 gray-scale image)\n* Maxout layer: 240 units, 5 pieces\n* Maxout layer: 240 units, 5 pieces\n* Output layer: 1 unit, Linear\n* Learnable parameters: 1231441\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.002  \n* Discriminator learning rate: 0.002  \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\n## Fashion-MNIST (fully connected model)\n\n#### Model Architecture:\n\nGenerator:\n* Input layer: 100 units (Uniform[-1, 1] noise)\n* Dense layer: 1200 units, ReLU\n* Dense layer: 1200 units, ReLU\n* Output layer: 784 units, Sigmoid\n* Learnable parameters: 2503984\n\nDiscriminator:\n* Input layer: 784 units (flattend 28x28 gray-scale image)\n* Maxout layer: 240 units, 5 pieces\n* Maxout layer: 240 units, 5 pieces\n* Output layer: 1 unit, Linear\n* Learnable parameters: 1231441\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![Fashion_MNIST_Training_Data](./assets/fashion_mnist_train.png)\n\n#### GAN Training Losses:\n![Fashion_MNIST_Loss](./assets/fashion_mnist_loss.png)\n\n#### Fake Data:\n![Fashion_MNIST_Fake_Data](./assets/fashion_mnist_fake.png)\n\n## Citations\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```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fgan/lists"}