{"id":20000555,"url":"https://github.com/nikhilbarhate99/char-rnn-pytorch","last_synced_at":"2025-05-04T15:32:32.760Z","repository":{"id":45782625,"uuid":"194654768","full_name":"nikhilbarhate99/Char-RNN-PyTorch","owner":"nikhilbarhate99","description":"Minimal implementation of Multi-layer Recurrent Neural Networks (LSTM) for character-level language modelling in PyTorch","archived":false,"fork":false,"pushed_at":"2019-07-17T12:30:40.000Z","size":42521,"stargazers_count":46,"open_issues_count":0,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T07:42:59.357Z","etag":null,"topics":["char-rnn","deep-learning","lstm","natural-language-generation","natural-language-processing","nlp","pytorch","pytorch-implementation","pytorch-nlp","pytorch-tutorial","rnn"],"latest_commit_sha":null,"homepage":"","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/nikhilbarhate99.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}},"created_at":"2019-07-01T10:51:38.000Z","updated_at":"2024-11-21T01:11:40.000Z","dependencies_parsed_at":"2022-08-26T13:23:26.796Z","dependency_job_id":null,"html_url":"https://github.com/nikhilbarhate99/Char-RNN-PyTorch","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/nikhilbarhate99%2FChar-RNN-PyTorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhilbarhate99%2FChar-RNN-PyTorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhilbarhate99%2FChar-RNN-PyTorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhilbarhate99%2FChar-RNN-PyTorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikhilbarhate99","download_url":"https://codeload.github.com/nikhilbarhate99/Char-RNN-PyTorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252356184,"owners_count":21734895,"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":["char-rnn","deep-learning","lstm","natural-language-generation","natural-language-processing","nlp","pytorch","pytorch-implementation","pytorch-nlp","pytorch-tutorial","rnn"],"created_at":"2024-11-13T05:15:04.277Z","updated_at":"2025-05-04T15:32:29.535Z","avatar_url":"https://github.com/nikhilbarhate99.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Char RNN PyTorch\n\nMinimalist code for character-level language modelling using Multi-layer Recurrent Neural Networks (LSTM) in PyTorch. The RNN is trained to predict next letter in a given text sequence. The trained model can then be used to generate a new text sequence resembling the original data.\n\n## Requirements\n\nTrained and tested on:\n\n- `Python 3.6`\n- `PyTorch 1.0`\n- `NumPy 1.16.3`\n\n## Usage\n\n### Training\nTo train a new network run `CharRNN.py`. If you are using custom data, change the `data_path` and `save_path` variables accordingly. To keep the code simple the batch size is one, so the training procedure is a bit slow. The average loss and a sample from the model is printed after every epoch.\n\n### Testing\nTo test a preTrained network (~15 epochs) run `test.py`. The training dataset is required for testing, to create vocabulary dictionary, and also for sampling a random small (10 letters) text sequence to begin generation.\n\n## Samples\n\n**Shakespeare Dataset (~ 15 epochs) :**\n```\nDOCSER:\nWhat, will thy fond law?\nor that in all the chains that livinar?\n\nKING HENRY V:\nCome, come, I should our name answer'd for two mans\nTo deafly upbrain, and broke him so our\nMaster Athital. Mark ye, I say!\n\nB-CANSSIO:\nCome, let us die.\n\nHostes:\nThis was my prince of holy empress,\nThat shalt thou save you in it with brave cap of heaven.\nOr is the digest and praud with their closets save of faitral'?\n\nKING HENRY V:\nYour treason follow Ncpius, Dout \u0026ystermans' clent,\nOn the pity can, when tell them\nFreely from direen prisoners town; and let us\nknow the man of all.\n\nFLUELLEN:\nGo tell you.\n```\n\n-----------------------------------------------------------------\n\n**Sherlock Holmes Dataset (~ 15 epochs) :**\n```\n Mr. Holmes had drawn up and again so brick, at west who closed upon\n the loud broken pallow and a cabmon ta the chair that we had fired\n out.\n\n \"I wished in,\" said Holmes sobbily, \"trust in the light. I said that you\n have to do with Gardens, come, you will pass you\n light, so you print?\"\n\n \"We are it is impossible.\"\n\n \"I know that so submer a case here did he give you after I\n tell you?\"\n\n \"Ah, sir, I keep them, Watson,\" I said a tueler\n inspectoruded upon either way. \"Home!\" said Admirable\n Street. \"But not considered a memory, which it was to complice him.\"\n\n I had so vallemed found me about this gloomy men.\n```\n\n\n## Acknowledgements\nThis code is based on the [char-rnn](https://github.com/karpathy/char-rnn) and [min-char-rnn](https://gist.github.com/karpathy/d4dee566867f8291f086) code by Andrej Karpathy, which is in turn based on Oxford University Machine Learning class [practical 6](https://github.com/oxford-cs-ml-2015/practical6), which is in turn based on [learning to execute](https://github.com/wojciechz/learning_to_execute) code from Wojciech Zaremba.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhilbarhate99%2Fchar-rnn-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikhilbarhate99%2Fchar-rnn-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhilbarhate99%2Fchar-rnn-pytorch/lists"}