{"id":13660766,"url":"https://github.com/crazydonkey200/tensorflow-char-rnn","last_synced_at":"2025-04-24T23:30:47.603Z","repository":{"id":80210374,"uuid":"52704868","full_name":"crazydonkey200/tensorflow-char-rnn","owner":"crazydonkey200","description":"Char-RNN implemented using TensorFlow. ","archived":false,"fork":false,"pushed_at":"2018-03-29T17:20:22.000Z","size":5820,"stargazers_count":425,"open_issues_count":2,"forks_count":267,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-10T15:44:14.437Z","etag":null,"topics":["recurrent-neural-networks","rnn","rnn-tensorflow","tensorflow"],"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/crazydonkey200.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,"governance":null}},"created_at":"2016-02-28T04:39:30.000Z","updated_at":"2024-06-17T13:17:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"c94484d5-1c25-4c14-bbf5-3dc7e9c8e5f2","html_url":"https://github.com/crazydonkey200/tensorflow-char-rnn","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/crazydonkey200%2Ftensorflow-char-rnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazydonkey200%2Ftensorflow-char-rnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazydonkey200%2Ftensorflow-char-rnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazydonkey200%2Ftensorflow-char-rnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazydonkey200","download_url":"https://codeload.github.com/crazydonkey200/tensorflow-char-rnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250727460,"owners_count":21477316,"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":["recurrent-neural-networks","rnn","rnn-tensorflow","tensorflow"],"created_at":"2024-08-02T05:01:25.514Z","updated_at":"2025-04-24T23:30:46.122Z","avatar_url":"https://github.com/crazydonkey200.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# TensorFlow-Char-RNN\nA TensorFlow implementation of Andrej Karpathy's [Char-RNN](https://github.com/karpathy/char-rnn), a character level language model using multilayer Recurrent Neural Network (RNN, LSTM or GRU). See his article [The Unreasonable Effectiveness of Recurrent Neural Network](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) to learn more about this model. \n\n# Installation\n\n## Dependencies\n- Python 2.7\n- TensorFlow \u003e= 1.2\n\nFollow the instructions on [TensorFlow official website](https://www.tensorflow.org/) to install TensorFlow. \n\n# Test\n\nIf the installation finishes with no error, quickly test your installation by running:\n```bash\npython train.py --data_file=data/tiny_shakespeare.txt --num_epochs=10 --test\n```\n\nThis will train char-rnn on the first 1000 characters of the tiny shakespeare copus. The final train/valid/test perplexity should all be lower than 30. \n\n# Usage\n- `train.py` is the script for training.\n- `sample.py` is the script for sampling.\n- `char_rnn_model.py` implements the Char-RNN model.\n\n## Training\nTo train on tiny shakespeare corpus (included in data/) with default settings (this might take a while):\n```bash\npython train.py --data_file=data/tiny_shakespeare.txt\n```\n\nAll the output of this experiment will be saved in a folder (default to `output/`, you can specify the folder name using `--output_dir=your-output-folder`). \n\nThe experiment log will be printed to stdout by default. To direct the log to a file instead, use `--log_to_file` (then it will be saved in `your-output-folder/experiment_log.txt`).\n\nThe output folder layout: \n```\n  your-output-folder\n    ├── result.json             # results (best validation and test perplexity) and experiment parameters.\n    ├── vocab.json              # vocabulary extracted from the data.\n    ├── experiment_log.txt      # Your experiment log if you used --log_to_file in training.\n    ├── tensorboard_log         # Folder containing Logs for Tensorboard visualization.\n    ├── best_model              # Folder containing saved best model (based on validation set perplexity)\n    ├── saved_model             # Folder containing saved latest models (for continuing training).\n```\n\nNote: `train.py` assume the data file is using utf-8 encoding by default, use `--encoding=your-encoding` to specify the encoding if your data file cannot be decoded using utf-8.\n\n## Sampling\nTo sample from the best model of an experiment (with a given start_text and length):\n```bash\npython sample.py --init_dir=your-output-folder --start_text=\"The meaning of life is\" --length=100\n```\n\n## Visualization\nTo use Tensorboard (a visualization tool in TensorFlow) to [visualize the learning](https://www.tensorflow.org/get_started/summaries_and_tensorboard#tensorboard-visualizing-learning) (the \"events\" tab) and [the computation graph](https://www.tensorflow.org/versions/r0.8/how_tos/graph_viz/index.html#tensorboard-graph-visualization) (the \"graph\" tab).\n\nFirst run:\n```bash\ntensorboard --logdir=your-output-folder/tensorboard_log\n```\n\nThen navigate your browser to [http://localhost:6006](http://localhost:6006) to view. You can also specify the port using `--port=your-port-number`. \n\n## Continuing an experiment\nTo continue a finished or interrupted experiment, run:\n```bash\npython train.py --data_file=your-data-file --init_dir=your-output-folder\n```\n\n\n## Hyperparameter tuning\n\n`train.py` provides a list of hyperparameters you can tune.\n\nTo see the list of all hyperparameters, run:\n```bash\npython train.py --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazydonkey200%2Ftensorflow-char-rnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazydonkey200%2Ftensorflow-char-rnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazydonkey200%2Ftensorflow-char-rnn/lists"}