{
"info": {
"author": "Sang Han",
"author_email": "sanghan@protonmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Unix Shell",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic",
"Topic :: Utilities"
],
"description": "Training a Recurrent Neural Network for Text Generation\n=======================================================\n\n|Apache License Version 2.0| |PyPI version|\n\n.. figure:: https://github.com/jjangsangy/Word2Seq/raw/master/static/harry.gif\n :alt: harry potter\n\n harry potter\n\nThis implements a char-rnn, as made famous by `Andrei Karpathy\u2019s\nwork `__ on\ntext generation using recurrent neural networks.\n\nTraining on GPU vs CPU\n======================\n\nIt is recommended to run this script on GPU, as recurrent networks are\nquite computationally intensive. If access to GPU optimized tensorflow\nis not available, it\u2019s sometimes possible to find precompiled binaries\non Github.\n\nI have compiled some optimized `tensorflow\nbinaries `__ for\n``MacOS`` that people can use running the latest tensorflow and\nutilizing Intel Math Kernel Library.\n\nCorpus Sizes\n============\n\nMake sure your corpus has >100k characters at least, but for the best\n>1M characters. Relatively, that is around the size, of Harry Potter\nBook 7.\n\nArchitecture\n============\n\nWe implement a Stateful Stacked LSTM in Keras that can be customized on\nthe command line.\n\n::\n\n _________________________________________________________________\n Layer (type) Output Shape Param #\n =================================================================\n lstm_1 (LSTM) (None, 40, 128) 110080\n _________________________________________________________________\n lstm_2 (LSTM) (None, 40, 128) 131584\n _________________________________________________________________\n lstm_3 (LSTM) (None, 128) 131584\n _________________________________________________________________\n dropout_1 (Dropout) (None, 128) 0\n _________________________________________________________________\n output (Dense) (None, 86) 11094\n _________________________________________________________________\n activation_1 (Activation) (None, 86) 0\n\nExamples\n========\n\nI\u2019ve distributed the binary weights and models used to generate these\nsegments which can be found in the ``models`` directory.\n\nThe Illiad of Homer\n-------------------\n\n::\n\n BOOK II.\n\n\n Heckees, Sestos and Adresteia draw as he 100\n Horden arms by this beast guard killed.\n Ark, though batch offered the cues.\n Is mine enchanted his wrist kingly watch\n Threatened benefit of his knee is these.\n Caring wet table to be bespoke herself 420\n For battle, damed us them spoken I deemed.\n Nor purpiring in neck he well-armown,\n Ilium I rathor! Dolyage the cleaped Daon\n The yare tiblevelin, the midef glow\n of-minded swarming reptoul leaned\n Shall foughter for his, nor hed oft which\n Onforthirul dead may boatiant sost 570\n Of Meris, at will to epthe wavecus,\n And give should were weal cup obloed, arms,\n But in their dowert worb his ruch tongs\n Thy deuphted of his I led hair bedeme,\n Ademorodes' tremble ladnerss thee, to Aiche.\n My both sindal ordreel beard she willfully\n In dung'd tryinigable home Meanely.\n Senoth if blare righter of warring aid. 290\n Hastes his fortancling sarius call'd ittens\n Poly phe so ace nelty twy agirs on deepsife 225\n\nHarry Potter and The Deathly Hallows\n------------------------------------\n\n::\n\n \u201cI say we jump when it gets low enough!\u201d\n\n And he realized, they were leaving along and began to\n ask over the star and where the green nan\n langed to the barman knocker on the bed and heard.\n\n But Ron, and Hermione was pointing at Harry\n who had bleeded. He really had to expect.\n\n It had gotted to move again, but under the thought\n we had to, Harry with an elf was done. It was followed\n that the goblins striding facing them.\n\n \u201cAre in, it\u2019s not toast the thing\u201d said Malfoys into\n the lost that the stone was now is younger.\n\n \u201cWonks, will it, in here!\u201d How not did the school\n sitting like words to his face and thought?\n\n \u201cYou are taken\u201d said Ron.\n\n How long for the tiny black of his actual and then held\n on the long while the thing else in it.\n\n Had perswaind through the side of his night floor.\n\n Harry went for this bleeding of Dobby. Snape had\n prefered him, as though swelled initially.\n He asked, and shouldered\n\n \u201cGurblevy blood morned and she would have been two\n of the officious for the corner\u201d\n\n \u201cOh, the interested when you worked with something that\n west?\u201d\n\n \u201cWhat was young in, you can\u2019t be up hard, on the Dark\n Lord turned,\u201d and Harry excited them, leaving as\n the goat of her back again. The sounds of\n the two, and uncentantable with nestprotures of preuch\n around to a thickness for the blood and rather into the\n goblin and took room.\n\n Harry and thought it was claying the search of\n the darkness from his head to the protects and\n entered in the few sunation of she called in the\n door \u2014 because Dumbledore had made when\n the table of side of the distance of them snow,\n and you can have it was firsts\n and shouted \"Disappeararall!\".\n\n I was a while what was mletograls.\n\n It laughed partly.\n\n \u201cMad.\u201d\n\nThe Linux Kernel\n----------------\n\n.. code:: c\n\n /*\n * Copyright (C) 2006 Bassififo 11RP\n * subplied the invert the II detach this of the Linux numin this himes.\n * DID subloge in the packet processor permitation\n *\n * This program is distributed in the hope that it will be useful\n * but WITHOUT ANY WARRANTY\n *\n * without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL\n * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR\n * OTHER LIABILITY, WHTTHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n * FITNESS FOR A PARTICULAR PURPOSE.\n *\n */\n\n #include \"stmbions.h\"\n #include \"msc.h\"\n #include \n #include \n #include \n\n static struct *rc_map_ligo dumar_memcache = {\n .name = \"C0c424\",\n .chip = {\n .init = simmar->dummave,\n .flags = CORT_SCAP_SCUEC,\n .base.oclass = RE,\n .to_parent = nv50_disp_ops,\n .remove = 0;\n };\n };\n\n /*\n * Device drivers and TIL) open initialize\n * or the run be and cases volatile.\n */\n static int __exit_exit_mpc_module(struct pcm_device *dev,\n struct of_device_id *pdev,\n struct hw_config *parent)\n {\n struct cck_inode *proto;\n struct platform_device *pdev;\n const struct clk_ops *bus_bit;\n struct clk_regmap *register;\n\n if (IS__ONFO_LSPAD) {\n return -ENODEV;\n }\n if (!(parent < 0)) {\n memlport(sizeof(struct sk_muachice *));\n return -ENODEV;\n }\n if !(ret) {\n return idxi_register_phy(PC_PROMST_ORE);\n }\n }\n\n static int __exit_exit(struct sl_bus_func *ebt_reg, struct nvkm_map *dev)\n {\n struct clk_ops *rmutex;\n size = cpu_lock;\n if (!data) {\n return;\n }\n }\n\nJay Chou Lyrics\n---------------\n\n Lyrics data and implementation originated from this `blog\n post `__\n and `implementation `__ by\n `leido `__\n\n::\n\n \u4f5c\u8a5e\uff1a\u5468\u6770\u502b\n \u4f5c\u66f2\uff1a\u65b9\u6587\u502b\n\n \u7d66\u4f60\u5df2\u7d93\u5f88\u4e45\n\n \u6211\u5011\u8d70\u4e86 \u6211\u6c92\u6709\u611b\n \u4f60\u8aaa\u6211\u9084\u662f\u4e0d\u80fd\u627f\u8afe\n \u4f60\u8aaa\u628a\u4e00\u7a2e\u9f8d \u90fd\u56de\u9060\n \u9078\u624d\u662f\u8ab0\u8aaa\u4f60\u7684\u611b\u6ea2\u51fa\u5c31\u8c61\u96e8\u6c34\n\n \u90aa\u706b\u7b49\u5f85\u6211\u5011\u7684\u5468\u6770\u502b\n \u7687\u5ba4\u7684\u7e3d\u6c7a\u60f3\u4e00\u7a2e\u89e3\u85e5\n \u6211\u5011\u5fae\u7b11\u90a3\u50b7\n \u9b27\u4eba\u5011 \u4f60\u78ba\u5b9a\u4e86\u90a3\u89d2\u5411\n\n \u6211\u4e0d\u80fd\u518d\u60f3\n \u6211\u4e0d\u80fd\u518d\u60f3\n\n \u6211\u4e0d\u662f\u518d\u591a \u7d66\u4e0d\u8a72\u4e00\u53e3\u6c23\n \u96a8\u540e\u4e2d\u4e00\u767e\u6094\u5728\u98a8\u5929\u908a\n \u671d\u8457\u8d77\u4e00\u767e\u6094\u5728\u5047\u724c\u6d17\u5237\n\n \u4f60\u537b\u7d66\u4f60\u7684\u611b\u60c5\u3000\n \u4f60\u8aaa\u6211\u4e0d\u8a72\u6c92\u6709\n \u4f60\u4e0d\u77e5\u9053 \u4e0d\u8981\u6211\n \u6211\u4e0d\u60f3\u8981\u6211\n \u6211\u4e0d \u6211\u4e0d\u8981\u518d\u60f3\n\n \u6211\u77e5\u9053\u8aaa\u66f4\u82e6\n \u6211\u5011\u5728\u79d8\u5bc6\n \u6211\u5011\u7d66\u4f60\u7684\u81c9\n\n \u9084\u8b93\u6211\u5011\u8ffd\u6c42 \u4e0d\u60f3\u8981\u8d70\n \u7d30\u6578\u615a\u6127\u6211\u5011\u90fd\u4e0d\u5230\n \u6211\u77e5\u9053\u4e0d\u80fd\n \u4f60\u60c5\u5e95\u9084\u60f3\u6211\u548c\u5531\u518d\u60f3\n\n \u5c31\u904e\u7684\u96fb\u65b9\u88e1\n \u6211\u5011\u9eef\u4e00\u9801\u6703\u540d\n\n \u4f60\u7684\u591a\u5c0f\u5230\u807d\u6703\u75db\u8d70\n \u7d30\u6578\u615a\u6127\u6211\u50b7\u4f60\u5e7e\u56de\n \u6211\u704c\u6e89 \u4e00\u679c\n \u72fc\u61fc\u6708 \u6771\u65b9\u5c31\u525b\u53ef\n \u7c21\u55ae\u7da0\u767d\u537b\u53c8\u518d\u8003\u5012 \u6211\n \u8aaa\u6563\u4f60\u60f3\u5f88\u4e45\u4e86\u5427?\n\n \u537b\u7b49\u62f3\u8ddf\u96e2\u5225\n \u9577\u6f22\u88e1 \u672a\u5927\u4e0b\u91cf\n \u9ce5\u98db\u7fd4\u958b\u7684\u5730\u65b9\n \u6211\u7b49\u5e7e\u500b\u4e16\u754c\n\n \u8d8a\u4f86\u4e00\u8d77\u65c5\u884c\n \u5317\u5728\u7a97\u76e4\u7684\u5e8a\n \u5468\u570d\u7684\u773c\u7738\n \u8ddf\u85e5\u8df3\u88e1 \u5e78\u6301\u5beb\u7684\u7a7a\u91cf\n \u6211\u8f15\u8f15\u5730\u5690\u4e00\u53e3 \u4efd\u91cf\u96d6\u7136\u4e0d\u591a\n\n \u6211\u4e0d\u80fd\u6211\u5f77\u5f7f\u90fd\u9019\u9ebc\n \u8106\u5f31 \u7c6c\u8713\u8aaa\u7684\u611f\u89ba\n \u6211\u5011\u64c1\u4ee5\u4e00\u8d77\u7684\u5c71\u8df3\u9032\n \u6211\u5011\u7684\u611b (\u4e0d\u80fd)\n\n \u7238\u975e\u662f\u6211\u5011\u4e58\u8457\u967d\u5149\n \u6211\u8eca\u6cd5\u8a69\u96e2\u958b\n \u6b63\u8868\u60c5\u5c0d\u9060\u65b9\u7684\u628a\u53eb\u4e00\u5929\n \u6211\u5011\u5728\u4e00\u96bb\u8c93\n \u52d5\u4f5c\u8f15\u76c8\u5730\u570d \u537b\u71d2\u4e0d\u4e86\u4e5f\u6709\u4e00\u758a\n\n \u6e34\u671b\u5011\u5979\u9060\u6b7b\u4e86\u5317\n \u53db\u8ecd\u5982\u50b2 \u7121\u540d\u98a8\u5439\u770b\u8457\u65e5\n \u4f60\u7d42\u7532 \u6211\u5011\u5e36\u8457\u4f60\u7684\u611b\u5beb\u4e86\n \u6211\u7684\u4e16\u754c \u4f60\u5728\u773c\u795e\u770b\u8457\u6211\n \u6211\u7684\u8eab\u5f71\n \u6211\u7684\u611f\u89ba\n \u6211\u5011\u7684\u611b\u5b8c\u5728\n \u4f60\u90a3\u6cd5\u64ca\u55c7\n \u800c\u6211\u7d66 \u6211\u7684\u9078\u64c7\n \u5b83\u5728\u8eab\u5f71\n \u9752\u5875\u57c3\n\nFox News\n--------\n\n::\n\n Fox News\n Date: 2016-11-07\n Trump and the Bond\n\n \u201cTrump is, as the district,\" said State Department\u2019s new strategist.\n The legal officials people and it would be the new president,\n every \"entiple winning to this dasham other appeared many and\n policy, and is new strategist\u201d.\n\n For President America. By the latest running\n presidential Hillary Clinton isn\u2019t a christian. The issue of\n internet in on email and friends.\n\n \u201cTo don't continue to be to child\u201d likely to be not be one\n Clinton told Fox.\n\n The 2015 on Hillary Clinton was released the she get to go or\n nearly campaign even the president for the finalist to top\n about the Washington and a bird resting possible to\n be removed latest between the forward.\n\n The source and subtracting to do a case of exiles of the first state\n More of a more decision and secretary into the battering the FBI and\n A Cheney Republican said \"Trump is criminal server, who went\u201d\n Portion to be this were voters and any team would have this criticism\n who this company do several diplomatic history emails with Trump on a state's endorse.\n\nCoinDesk\n--------\n\n::\n\n According to The DAO\n\n According to The DAO official financial services and compliance ledger\n finances are taken with the market of a distributed ledger statement\n\n \"It's the company's international industry\"\n\n Additional entry plans to be wide revealed to include call the detail of the affective\n in effectively data, one open solutions of two wider way to a revalue more to ensure the US\n has the ability to the government with the smart contract funding with a major\n month and fell which has adopted a new, there are described a\n hacking currently raising a \"Option\" (was overall in the data).\n\n They are looking to trade in volume on the Ethereum Foundation.\n\n The filing can expect to open statements with the acquisition of the company\n exchange Singapore's of DAOs and government (LICAF)\n\n The board is that the first test co-founder mission.\n\nInstallation\n============\n\nCurrently only runs on Python 3 (because I can), you can install\ndependencies using ``pip``\n\n.. code:: sh\n\n $ pip3 install charrnn\n\nUsage\n=====\n\nThis package installs a command line application called ``charrnn``\n\n.. code:: sh\n\n $ charrnn --help\n usage: charrnn [-h] [--verbose] [--model file] [--window length]\n [--batch size] [--datasets directory]\n {train,decode} ...\n\n Train a neural network\n\n positional arguments:\n {train,decode} Help train or produce output from your neural network\n train Train your character recurrent neural net\n decode Output from previously trained network\n\n optional arguments:\n -h, --help show this help message and exit\n --verbose, -v Keras verbose output\n --model file, -m file\n Specify the model hdf5 file to save to or load from:\n [default]: models/model.h5\n --window length, -w length\n Specify the size of the window size to train on:\n [default]: 40\n --batch size, -b size\n Specify the input batch size for LSTM layers:\n [default]: 128\n --datasets directory, -t directory\n Specify the directory where the datasets are located\n [default]: datasets\n\nTraining\n--------\n\nPlace your corpuse[s] into the ``datasets`` folder or specify it on the\ncommand line\n\nTo customize the parameters for generating text you can parameterize\nwith input arguments.\n\n.. code:: sh\n\n $ charrnn train\n usage: charrnn train [-h] [--log_dir directory] [--split size] [--layers deep]\n [--dropout amount] [--resume] [--epochs num]\n [--optimizer optimizer] [--monitor monitor]\n\n optional arguments:\n -h, --help show this help message and exit\n --log_dir directory, -r directory\n Specify the output directory for tensorflow logs:\n [default]: None\n --split size, -p size\n Specify the split between validation and training data\n [default]: 0.15\n --layers deep, -l deep\n Specify the number of layers deep of LSTM nodes:\n [default]: 3\n --dropout amount, -d amount\n Amount of LSTM dropout to apply between 0.0 - 1.0:\n [default]: 0.2\n --resume Resume from saved model file rather than creating a\n new model at model.h5\n --epochs num, -e num Specify for however many epochs to train over\n [default]: 50\n --optimizer optimizer, -o optimizer\n Specify optimizer used to train gradient descent:\n [default]: nadam\n --monitor monitor, -n monitor\n Specify value to monitor for training/building model:\n [defaut]: val_loss\n\nText Generation\n---------------\n\nIn order to generate text use the ``decode`` arg\n\n.. code:: sh\n\n usage: charrnn decode [-h] [--temperature t] [--output size]\n\n optional arguments:\n -h, --help show this help message and exit\n --temperature t, -t t\n Set the temperature value for prediction on batch:\n [default]: 0.8\n --output size, -o size\n Set the desired size of the characters decoded:\n [default]: 4000\n\nDebugging\n---------\n\nTo debug we\u2019ve written log files in the log directory. In order to\naccess these logs, you can run tensorboard.\n\n.. code:: sh\n\n $ tensorboard --logdir=./logs\n\n|graph| |tensorboard|\n\n.. |Apache License Version 2.0| image:: https://img.shields.io/badge/license-Apache_2.0-green.svg\n :target: LICENSE\n.. |PyPI version| image:: https://badge.fury.io/py/charrnn.svg\n :target: https://badge.fury.io/py/charrnn\n.. |graph| image:: https://github.com/jjangsangy/Word2Seq/raw/master/static/graph.png\n.. |tensorboard| image:: https://github.com/jjangsangy/Word2Seq/raw/master/static/tensorboard.png\n\n",
"description_content_type": null,
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/jjangsangy/Word2Seq",
"keywords": "",
"license": "Apache License 2.0",
"maintainer": "",
"maintainer_email": "",
"name": "charrnn",
"package_url": "https://pypi.org/project/charrnn/",
"platform": "",
"project_url": "https://pypi.org/project/charrnn/",
"project_urls": {
"Homepage": "https://github.com/jjangsangy/Word2Seq"
},
"release_url": "https://pypi.org/project/charrnn/0.1.1/",
"requires_dist": null,
"requires_python": "",
"summary": "Character Recurrent Neural Network For Text Generation",
"version": "0.1.1"
},
"last_serial": 3347552,
"releases": {
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "86313c51e3d89cfc6d10854fba686650",
"sha256": "0bb23779e6d1bcffbce0ab25e3b45356aa0e213c1cfed5b9c5e8fa77059483d9"
},
"downloads": -1,
"filename": "charrnn-0.1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "86313c51e3d89cfc6d10854fba686650",
"packagetype": "bdist_wheel",
"python_version": "3.6",
"requires_python": null,
"size": 31166,
"upload_time": "2017-11-20T06:57:20",
"url": "https://files.pythonhosted.org/packages/d3/ff/dd6cb6499b720a67f4313698d83c7234453bdcbe092900d7ac3a541bbb19/charrnn-0.1.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "bf6a779a92486770245d552058ef6061",
"sha256": "79c6e0ab7bf6474c23462bc8a416bc00a996567aff521cb91db9335b54ca26c4"
},
"downloads": -1,
"filename": "charrnn-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "bf6a779a92486770245d552058ef6061",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35359,
"upload_time": "2017-11-19T07:09:59",
"url": "https://files.pythonhosted.org/packages/eb/3e/3b2df3e6d04b9b993228e1fbae7b70b3a895afe89bb429a2a919958cdc9f/charrnn-0.1.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "86313c51e3d89cfc6d10854fba686650",
"sha256": "0bb23779e6d1bcffbce0ab25e3b45356aa0e213c1cfed5b9c5e8fa77059483d9"
},
"downloads": -1,
"filename": "charrnn-0.1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "86313c51e3d89cfc6d10854fba686650",
"packagetype": "bdist_wheel",
"python_version": "3.6",
"requires_python": null,
"size": 31166,
"upload_time": "2017-11-20T06:57:20",
"url": "https://files.pythonhosted.org/packages/d3/ff/dd6cb6499b720a67f4313698d83c7234453bdcbe092900d7ac3a541bbb19/charrnn-0.1.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "bf6a779a92486770245d552058ef6061",
"sha256": "79c6e0ab7bf6474c23462bc8a416bc00a996567aff521cb91db9335b54ca26c4"
},
"downloads": -1,
"filename": "charrnn-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "bf6a779a92486770245d552058ef6061",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 35359,
"upload_time": "2017-11-19T07:09:59",
"url": "https://files.pythonhosted.org/packages/eb/3e/3b2df3e6d04b9b993228e1fbae7b70b3a895afe89bb429a2a919958cdc9f/charrnn-0.1.1.tar.gz"
}
]
}