{"id":18892991,"url":"https://github.com/dongjunlee/gan-pytorch","last_synced_at":"2025-04-15T00:13:41.120Z","repository":{"id":236588780,"uuid":"129282239","full_name":"DongjunLee/gan-pytorch","owner":"DongjunLee","description":"PyTorch implementation of 'GAN (Generative Adversarial Networks)'","archived":false,"fork":false,"pushed_at":"2018-04-15T12:38:56.000Z","size":497,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T00:13:27.434Z","etag":null,"topics":["deep-learning","estimator","experiments","gan","generative-adversarial-network","generative-model","hb-experiment","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DongjunLee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-04-12T16:41:14.000Z","updated_at":"2023-09-08T17:39:13.000Z","dependencies_parsed_at":"2024-05-08T19:15:49.328Z","dependency_job_id":null,"html_url":"https://github.com/DongjunLee/gan-pytorch","commit_stats":null,"previous_names":["dongjunlee/gan-pytorch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fgan-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fgan-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fgan-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DongjunLee%2Fgan-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DongjunLee","download_url":"https://codeload.github.com/DongjunLee/gan-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981270,"owners_count":21193147,"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","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":["deep-learning","estimator","experiments","gan","generative-adversarial-network","generative-model","hb-experiment","pytorch"],"created_at":"2024-11-08T08:06:57.998Z","updated_at":"2025-04-15T00:13:41.103Z","avatar_url":"https://github.com/DongjunLee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Generative Adversarial Nets [![hb-research](https://img.shields.io/badge/hb--research-experiment-green.svg?style=flat\u0026colorA=448C57\u0026colorB=555555)](https://github.com/hb-research)\n\nPyTorch implementation of [Generative Adversarial Nets](https://arxiv.org/abs/1406.2661).\n\n![images](images/gan-architecture.jpeg)\n\n- [images source](http://www.kdnuggets.com/2017/01/generative-adversarial-networks-hot-topic-machine-learning.html)\n\n\n## Requirements\n\n- Python 3.6\n- PyTorch\n- [hb-config](https://github.com/hb-research/hb-config) (Singleton Config)\n- [Slack Incoming Webhook URL](https://my.slack.com/services/new/incoming-webhook/)\n\n\n## Project Structure\n\n    .\n    ├── config                  # Config files (.yml, .json) using with hb-config\n    ├── gan                     # Generative Adversarial Networks architecture \n        ├── __init__.py             # train, evaluate, predict logic\n        ├── module.py               # Discriminator, Generator module\n        └── utils.py                # Save and Load Model, TensorBoard\n    ├── data_loader.py          # make_data_loader (using DataLoader)\n    ├── main.py                 \n    ├── model.py                # define Model Spec\n    └── model.py                # utils\n    \nReference : [hb-config](https://github.com/hb-research/hb-config)\n\n- Manage experiments like [tf.Estimator](https://www.tensorflow.org/api_docs/python/tf/estimator/Estimator)\n\n\n## Config\n\nCan control all **Experimental environment**.\n\nexample: config.yml\n\n```yml\ndata:\n  path: \"data/\"\n\nmodel:\n  z_dim: 100     # Random noise dimension coming into generator, per output vector\n  real_dim: 784\n\n  g_h1: 256\n  g_h2: 512\n  g_h3: 1024\n\n  d_h1: 1024\n  d_h2: 512\n  d_h3: 256\n\n  dropout: 0.3\n\ntrain:\n  model_dir: \"logs/gan\"\n  batch_size: 64\n  train_steps: 50000\n\n  d_learning_rate: 0.0002  # 2e-4\n  g_learning_rate: 0.0002\n  optim_betas:\n    - 0.9\n    - 0.999\n\n  save_checkpoints_steps: 1000\n  verbose_step_count: 100\n\npredict:\n  batch_size: 64\n\nslack:\n  webhook_url: \"\"  # after training notify you using slack-webhook\n```\n\n\n## Usage\n\nInstall requirements.\n\n```pip install -r requirements.txt```\n\nThen, start training\n\n```python main.py --mode train```\n\nAfter training, generate images\n\n```python main.py --mode predict```\n\n- generated image example\n\n![images](images/generate_images.png)\n\n\n### Experiments modes\n\n:white_check_mark: : Working  \n:white_medium_small_square: : Not tested yet.\n\n- :white_medium_small_square: `evaluate` : Evaluate on the evaluation data.\n- :white_check_mark: `train` : Fit the estimator using the training data.\n- :white_medium_small_square: `train_and_evaluate` : Interleaves training and evaluation.\n- :white_check_mark: `predict` : Generate images.\n\n---\n\n### Tensorboar\n\n```tensorboard --logdir logs```\n\n- example\n\n![images](images/tensorboard-example.png)\n\n\n## Reference\n- [hb-research/notes - Generative Adversarial Nets](https://github.com/hb-research/notes/blob/master/notes/gan.md)\n- [Paper - Generative Adversarial Nets](https://arxiv.org/abs/1406.2661)\n- [pytorch-tutorial](https://github.com/yunjey/pytorch-tutorial)\n\n\n## Author\n\n[Dongjun Lee](https://github.com/DongjunLee) (humanbrain.djlee@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongjunlee%2Fgan-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongjunlee%2Fgan-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongjunlee%2Fgan-pytorch/lists"}