{"id":16801039,"url":"https://github.com/connor-mccarthy/tf-ssgan","last_synced_at":"2026-05-13T23:37:09.675Z","repository":{"id":110337232,"uuid":"376681289","full_name":"connor-mccarthy/tf-ssgan","owner":"connor-mccarthy","description":"Implementing GANBERT model from recent deep learning research paper as an easy-to-use Tensorflow model.","archived":false,"fork":false,"pushed_at":"2021-07-14T04:21:23.000Z","size":22212,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T13:39:26.864Z","etag":null,"topics":["bert","deep-learning","generative-adversarial-network","semi-supervised-learning","tensorflow"],"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/connor-mccarthy.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":"2021-06-14T02:13:23.000Z","updated_at":"2023-03-08T21:44:40.000Z","dependencies_parsed_at":"2023-06-25T23:20:21.270Z","dependency_job_id":null,"html_url":"https://github.com/connor-mccarthy/tf-ssgan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/connor-mccarthy/tf-ssgan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-mccarthy%2Ftf-ssgan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-mccarthy%2Ftf-ssgan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-mccarthy%2Ftf-ssgan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-mccarthy%2Ftf-ssgan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connor-mccarthy","download_url":"https://codeload.github.com/connor-mccarthy/tf-ssgan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connor-mccarthy%2Ftf-ssgan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015353,"owners_count":26085684,"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-10-13T02:00:06.723Z","response_time":61,"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":["bert","deep-learning","generative-adversarial-network","semi-supervised-learning","tensorflow"],"created_at":"2024-10-13T09:35:44.629Z","updated_at":"2025-10-13T13:39:26.989Z","avatar_url":"https://github.com/connor-mccarthy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eSSGAN Implementation Tensorflow\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/connor-mccarthy/ganbert/workflows/build/badge.svg\"\u003e\n    \u003cimg src=\"https://github.com/connor-mccarthy/ganbert/workflows/build/badge.svg\" alt=\"Python Workflow\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://img.shields.io/badge/python-3.8.10-blue.svg\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/python-3.8.10-blue.svg\" alt=\"Python 3.8.10\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\" alt=\"Code style: black\" \u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\nA simple API for a complex idea in current deep learning research: semi-supervised classification using generative adversarial networks (SSGANs).\n\nThis particular flavor of SSGANs is motivated by and modeled after the 2020 [research paper](https://www.aclweb.org/anthology/2020.acl-main.191.pdf) on GANBERT (see [citation](#citation)). See [ganbert/](`./ganbert/) for an implementation of the GANBERT model descibred in the paper using the `tf-ssgan` library.\n\n## Getting Started\n\n### Installation\n\n```sh\npip install git+https://github.com/connor-mccarthy/tf-ssgan.git\n```\n\n### Code\n\nThis implementation uses the simple Keras [`Model`](https://www.tensorflow.org/api_docs/python/tf/keras/Model) API. This makes it easy to implement an SSGAN for diverse classification problems.\n\n```python\nfrom tf_ssgan import SSGAN\n\n# see ./ganbert/model_components.py for generator/discriminator details\ngenerator = make_generator(...)\ndiscriminator = make_discriminator(...)\n\nssgan = SSGAN(\n    generator=generator,\n    discriminator=discriminator,\n    name=\"my_ssgan\",\n)\n\nssgan.compile(\n    g_optimizer=tf.keras.optimizers.Adam(1e-4),\n    d_optimizer=tf.keras.optimizers.Adam(1e-4),\n)\n\nssgan.fit(\n  train_ds,\n  validation_data=val_ds,\n  epochs=1000,\n)\n```\n\n## Reproducing GANBERT\n\nWith Python 3.8.10:\n\n```python\npython -m venv .venv\nsource .venv/bin/activate\npip install -r ganbert/ganbert_requirements.txt\npython ganbert\n```\n\n## Citation\n\nGANBERT paper:\n\n```bibtex\n@inproceedings{croce-etal-2020-gan,\n    title = \"{GAN}-{BERT}: Generative Adversarial Learning for Robust Text Classification with a Bunch of Labeled Examples\",\n    author = \"Croce, Danilo  and\n      Castellucci, Giuseppe  and\n      Basili, Roberto\",\n    booktitle = \"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics\",\n    month = jul,\n    year = \"2020\",\n    address = \"Online\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://www.aclweb.org/anthology/2020.acl-main.191\",\n    pages = \"2114--2119\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnor-mccarthy%2Ftf-ssgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnor-mccarthy%2Ftf-ssgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnor-mccarthy%2Ftf-ssgan/lists"}