{"id":23864370,"url":"https://github.com/shaform/scratchgan-prep","last_synced_at":"2026-06-12T23:32:58.452Z","repository":{"id":147255487,"uuid":"281428776","full_name":"shaform/scratchgan-prep","owner":"shaform","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-25T14:18:57.000Z","size":52,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T08:22:36.091Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaform.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":"2020-07-21T15:02:23.000Z","updated_at":"2024-04-18T06:19:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d28d5b6-a780-4737-8ee6-b98f0a870f38","html_url":"https://github.com/shaform/scratchgan-prep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaform%2Fscratchgan-prep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaform%2Fscratchgan-prep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaform%2Fscratchgan-prep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaform%2Fscratchgan-prep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaform","download_url":"https://codeload.github.com/shaform/scratchgan-prep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240177048,"owners_count":19760308,"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":[],"created_at":"2025-01-03T08:21:06.558Z","updated_at":"2026-06-04T17:30:14.583Z","avatar_url":"https://github.com/shaform.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScratchGAN\n\nThis is the example code for the following NeurIPS 2019 paper. If you use the\ncode here please cite this paper:\n\n    @article{DBLP:journals/corr/abs-1905-09922,\n      author    = {Cyprien de Masson d'Autume and\n                   Mihaela Rosca and\n                   Jack W. Rae and\n                   Shakir Mohamed},\n      title     = {Training language GANs from Scratch},\n      journal   = {CoRR},\n      volume    = {abs/1905.09922},\n      year      = {2019},\n      url       = {http://arxiv.org/abs/1905.09922},\n      archivePrefix = {arXiv},\n      eprint    = {1905.09922},\n      timestamp = {Wed, 29 May 2019 11:27:50 +0200},\n      biburl    = {https://dblp.org/rec/bib/journals/corr/abs-1905-09922},\n      bibsource = {dblp computer science bibliography, https://dblp.org}\n    }\n\n\n## Contents\n\nThe code contains:\n\n  * `generators.py`: implementation of the generator.\n  * `discriminator_nets.py`: implementation of the discriminator.\n  * `eval_metrics.py`: implementation of the FED metric.\n  * `losses.py`: implementation of the RL loss for the generator.\n  * `reader.py`: data reader / tokenizer.\n  * `experiment.py`: main training script.\n\nThe data contains:\n\n  * `{train,valid,test}.json`: the EMNLP2017 News dataset.\n  * `glove_emnlp2017.txt`: the relevant subset of GloVe embeddings.\n\n## Running\n\nDownload the data and place it in the directory specified by `data_dir` flag:\n\n    mkdir -p /tmp/emnlp2017\n    curl https://storage.googleapis.com/deepmind-scratchgan-data/train.json --output /tmp/emnlp2017/train.json\n    curl https://storage.googleapis.com/deepmind-scratchgan-data/valid.json --output /tmp/emnlp2017/valid.json\n    curl https://storage.googleapis.com/deepmind-scratchgan-data/test.json --output /tmp/emnlp2017/test.json\n    curl https://storage.googleapis.com/deepmind-scratchgan-data/glove_emnlp2017.txt --output /tmp/emnlp2017/glove_emnlp2017.txt\n\nCreate and activate a virtual environment if needed:\n\n    virtualenv scratchgan-venv\n    source scratchgan-venv/bin/activate\n\nInstall requirements:\n\n    pip install -r scratchgan/requirements.txt\n\nRun training and evaluation jobs:\n\n    python3 -m scratchgan.experiment --mode=\"train\" \u0026\n    python3 -m scratchgan.experiment --mode=\"evaluate_pair\" \u0026\n\nThe evaluation code is designed to run in parallel with the training.\n\nThe training code saves checkpoints periodically, the evaluation code\nlooks for new checkpoints and evaluate them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaform%2Fscratchgan-prep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaform%2Fscratchgan-prep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaform%2Fscratchgan-prep/lists"}