{"id":20247095,"url":"https://github.com/shreyansh26/sentence-vae","last_synced_at":"2026-02-20T17:02:19.174Z","repository":{"id":83435178,"uuid":"540076924","full_name":"shreyansh26/Sentence-VAE","owner":"shreyansh26","description":"A re-implementation of the Sentence VAE paper, Generating Sentences from a Continuous Space","archived":false,"fork":false,"pushed_at":"2022-09-22T16:43:39.000Z","size":36732,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T00:49:01.596Z","etag":null,"topics":["gru","rnn","text-generation","text-generation-using-rnn","vae","vae-implementation","vae-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/shreyansh26.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":"2022-09-22T16:43:26.000Z","updated_at":"2024-09-22T14:00:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"2737baa1-cc6d-447e-a3f7-e71131a46815","html_url":"https://github.com/shreyansh26/Sentence-VAE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shreyansh26/Sentence-VAE","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyansh26%2FSentence-VAE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyansh26%2FSentence-VAE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyansh26%2FSentence-VAE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyansh26%2FSentence-VAE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shreyansh26","download_url":"https://codeload.github.com/shreyansh26/Sentence-VAE/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shreyansh26%2FSentence-VAE/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29658167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["gru","rnn","text-generation","text-generation-using-rnn","vae","vae-implementation","vae-pytorch"],"created_at":"2024-11-14T09:35:29.699Z","updated_at":"2026-02-20T17:02:19.158Z","avatar_url":"https://github.com/shreyansh26.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentence VAE Implementation\n\nA re-implementation of the Sentence VAE paper, [Generating Sentences from a Continuous Space](https://arxiv.org/abs/1511.06349). The paper talks about modelling sentences to latent space representations and allowing deterministic decoding of these latent vectors to produce well-formed sentences. This also allows interpolation between two vectors to produce coherent sentences.\n\n*The inspiration for this implementation is from [Tim Baumgärtner's repository](https://github.com/timbmg/Sentence-VAE). The data processing code and some helper functions have been taken from there. The main purpose of this project was to enhance my understanding of VAEs and implement this paper for learning purposes*\n\n## Results\n\n### Performance\n\n#### ELBO\n![](plots/train_elbo.png)\n\n#### Epoch-averaged ELBO\n![](plots/train_epoch_elbo.png)\n\n#### KL Divergence loss\n![](plots/train_kl_loss.png)\n\n#### Negative Log-likelihood Loss\n![](plots/train_nll_loss.png)\n\n#### KL Weight\n![](plots/train_kl_weight.png)\n\n### Samples\n\nSentences have been obtained after sampling from z ~ N(0, I).\n```\n\u003csos\u003e there ' s a great difference between the yeast and the cuban drug \u003ceos\u003e\n\u003csos\u003e but the company has n't yet been able to pinpoint a license \u003ceos\u003e\n\u003csos\u003e he said the committee appointed the president ' s motion - year-old civil rights plan to meet with the bush administration ' s request \u003ceos\u003e\n\u003csos\u003e caltrans said the galileo worm had a good luck to the late 1970s \u003ceos\u003e\n\u003csos\u003e some people are facing the variations in the area that they are n't aware of their ignorance says mr . newhouse \u003ceos\u003e\n\u003csos\u003e the u . s . is the only n years of the krasnoyarsk of the krasnoyarsk regime of the krasnoyarsk regime of the krasnoyarsk regime of pravda \u003ceos\u003e\n\u003csos\u003e but we do n't think that the rest of the gun is n't entirely \u003ceos\u003e\n\u003csos\u003e william c . brown president of the prentice hall foundation and construction concern \u003ceos\u003e\n\u003csos\u003e they are inevitably inclined to lure the same circumstances that would be settled \u003ceos\u003e\n\u003csos\u003e and the difficulties are facing difficulties \u003ceos\u003e\n```\n\n### Interpolation\n\nSentences have been obtained after sampling twice from z ~ N(0, I) and then interpolating the two samples.\n\n```\n\u003csos\u003e i ' m not going to be a disaster \u003ceos\u003e\n\u003csos\u003e researchers said the ordinance is slated to be introduced by the virus of the virus that seeks to transform the drug centers \u003ceos\u003e  \n\u003csos\u003e i think the fed is n't committed to the disaster \u003ceos\u003e    \n\u003csos\u003e humana inc . said it signed a $ n million contract for the start-up of the national aeronautics and space force \u003ceos\u003e  \n\u003csos\u003e i think the fed is n't committed to the disaster \u003ceos\u003e  \n\u003csos\u003e osha said the contract signed a $ n million contract with meredith and universities that are used by the drug centers \u003ceos\u003e  \n\u003csos\u003e i think the fed is n't commenting on the region \u003ceos\u003e  \n\u003csos\u003e osha said the contract signed a definitive agreement with the facility and a new york facility in the netherlands and a number of the facility \u003ceos\u003e  \n\u003csos\u003e we do n't want to see the reduction in the next few months \u003ceos\u003e  \n\u003csos\u003e osha said the contract signed a definitive agreement with the facility and a new york facility in the netherlands and a number of seats in the netherlands \u003ceos\u003e  \n```\n\n## Training\n\nUse the download_data.sh file to get the Penn Treebank data.\n\nTraining is as simple as executing \n\n```\npython train.py\n```\n\nTo replicate the above results, I used the following config \n\n```\npython train.py --learning_rate 0.001 --num_layers 2 --word_dropout_rate 0.2 --annealing_till 2500\n```\n\nOther configs can be seen from the [train.py](train.py) file. \n\n## Inference\n\nTo use the checkpoint provided with this repository, run\n\n```\npython inference.py \u003cpath_to_checkpoint\u003e -nl 2\n```\n\nThe configs have to be added based on the training configs of the model checkpoint being used.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyansh26%2Fsentence-vae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshreyansh26%2Fsentence-vae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyansh26%2Fsentence-vae/lists"}