diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2023-01-23 16:32:08 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2023-01-23 16:32:08 +0530 |
commit | fef43cef50f6f3b569ee0830ad5cfe92a702463c (patch) | |
tree | b21e3dc9212cc95aff7c7bc2d0b5a916041b0a80 | |
parent | 43cd81bd64880af6492b94d644538df32bcf4e88 (diff) |
update model
-rw-r--r-- | GenerateShakespeare.ipynb | 2 | ||||
-rw-r--r-- | jsmodel/group1-shard1of4.bin | bin | 4194304 -> 4194304 bytes | |||
-rw-r--r-- | jsmodel/group1-shard2of4.bin | bin | 4194304 -> 4194304 bytes | |||
-rw-r--r-- | jsmodel/group1-shard3of4.bin | bin | 4194304 -> 4194304 bytes | |||
-rw-r--r-- | jsmodel/group1-shard4of4.bin | bin | 3491076 -> 3491076 bytes | |||
-rw-r--r-- | model.h5 | bin | 16093616 -> 16093616 bytes | |||
-rw-r--r-- | web/jsmodel/group1-shard1of4.bin | bin | 4194304 -> 4194304 bytes | |||
-rw-r--r-- | web/jsmodel/group1-shard2of4.bin | bin | 4194304 -> 4194304 bytes | |||
-rw-r--r-- | web/jsmodel/group1-shard3of4.bin | bin | 4194304 -> 4194304 bytes | |||
-rw-r--r-- | web/jsmodel/group1-shard4of4.bin | bin | 3491076 -> 3491076 bytes |
10 files changed, 1 insertions, 1 deletions
diff --git a/GenerateShakespeare.ipynb b/GenerateShakespeare.ipynb index e49c4c8..7a235fa 100644 --- a/GenerateShakespeare.ipynb +++ b/GenerateShakespeare.ipynb @@ -1 +1 @@ -{"metadata":{"accelerator":"GPU","colab":{"provenance":[]},"gpuClass":"standard","kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.7.10","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install pandas","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"aOX6ge672GEp","outputId":"30bf145d-ffbf-476a-cc7b-3ee230c12787","execution":{"iopub.status.busy":"2023-01-23T05:42:10.084468Z","iopub.execute_input":"2023-01-23T05:42:10.085270Z","iopub.status.idle":"2023-01-23T05:42:17.352790Z","shell.execute_reply.started":"2023-01-23T05:42:10.085176Z","shell.execute_reply":"2023-01-23T05:42:17.351904Z"},"trusted":true},"execution_count":1,"outputs":[{"name":"stdout","text":"Requirement already satisfied: pandas in /opt/conda/lib/python3.7/site-packages (1.2.5)\nRequirement already satisfied: python-dateutil>=2.7.3 in /opt/conda/lib/python3.7/site-packages (from pandas) (2.8.0)\nRequirement already satisfied: pytz>=2017.3 in /opt/conda/lib/python3.7/site-packages (from pandas) (2021.1)\nRequirement already satisfied: numpy>=1.16.5 in /opt/conda/lib/python3.7/site-packages (from pandas) (1.19.5)\nRequirement already satisfied: six>=1.5 in /opt/conda/lib/python3.7/site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)\n\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\n","output_type":"stream"}]},{"cell_type":"code","source":"import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport tensorflow as tf\n\nfrom tensorflow.keras import Sequential\nfrom tensorflow.keras.layers import Embedding, GRU, Dense\n\nimport numpy as np\nimport pandas as pd\nimport os\nimport time","metadata":{"id":"Qu46zrM8wlpM","execution":{"iopub.status.busy":"2023-01-23T05:42:17.354943Z","iopub.execute_input":"2023-01-23T05:42:17.355430Z","iopub.status.idle":"2023-01-23T05:42:18.977205Z","shell.execute_reply.started":"2023-01-23T05:42:17.355391Z","shell.execute_reply":"2023-01-23T05:42:18.976489Z"},"trusted":true},"execution_count":2,"outputs":[]},{"cell_type":"code","source":"physical_devices = tf.config.list_physical_devices('GPU')\nprint(\"Num GPUs:\", len(physical_devices))","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:42:18.978748Z","iopub.execute_input":"2023-01-23T05:42:18.979065Z","iopub.status.idle":"2023-01-23T05:42:19.037511Z","shell.execute_reply.started":"2023-01-23T05:42:18.979027Z","shell.execute_reply":"2023-01-23T05:42:19.036718Z"},"trusted":true},"execution_count":3,"outputs":[{"name":"stdout","text":"Num GPUs: 1\n","output_type":"stream"}]},{"cell_type":"code","source":"dataset_url = tf.keras.utils.get_file('shakespeare.txt', 'https://storage.googleapis.com/download.tensorflow.org/data/shakespeare.txt')\ndataset_text = open(dataset_url, 'rb').read().decode(encoding='UTF-8')\nprint(dataset_text[:1000])","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"v4gmrb8Yw4HQ","outputId":"8e1db03d-310d-49f6-c617-c1b46014618c","execution":{"iopub.status.busy":"2023-01-23T05:42:19.040265Z","iopub.execute_input":"2023-01-23T05:42:19.040796Z","iopub.status.idle":"2023-01-23T05:42:19.050689Z","shell.execute_reply.started":"2023-01-23T05:42:19.040757Z","shell.execute_reply":"2023-01-23T05:42:19.050109Z"},"trusted":true},"execution_count":4,"outputs":[{"name":"stdout","text":"First Citizen:\nBefore we proceed any further, hear me speak.\n\nAll:\nSpeak, speak.\n\nFirst Citizen:\nYou are all resolved rather to die than to famish?\n\nAll:\nResolved. resolved.\n\nFirst Citizen:\nFirst, you know Caius Marcius is chief enemy to the people.\n\nAll:\nWe know't, we know't.\n\nFirst Citizen:\nLet us kill him, and we'll have corn at our own price.\nIs't a verdict?\n\nAll:\nNo more talking on't; let it be done: away, away!\n\nSecond Citizen:\nOne word, good citizens.\n\nFirst Citizen:\nWe are accounted poor citizens, the patricians good.\nWhat authority surfeits on would relieve us: if they\nwould yield us but the superfluity, while it were\nwholesome, we might guess they relieved us humanely;\nbut they think we are too dear: the leanness that\nafflicts us, the object of our misery, is as an\ninventory to particularise their abundance; our\nsufferance is a gain to them Let us revenge this with\nour pikes, ere we become rakes: for the gods know I\nspeak this in hunger for bread, not in thirst for revenge.\n\n\n","output_type":"stream"}]},{"cell_type":"code","source":"vocab = sorted(set(dataset_text))\nprint(f'There are {len(vocab)} unique characters')","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"M6fUyb4exOYw","outputId":"275ea813-d767-4653-d33a-34cafca6032b","execution":{"iopub.status.busy":"2023-01-23T05:42:19.051989Z","iopub.execute_input":"2023-01-23T05:42:19.052463Z","iopub.status.idle":"2023-01-23T05:42:19.072183Z","shell.execute_reply.started":"2023-01-23T05:42:19.052428Z","shell.execute_reply":"2023-01-23T05:42:19.071259Z"},"trusted":true},"execution_count":5,"outputs":[{"name":"stdout","text":"There are 65 unique characters\n","output_type":"stream"}]},{"cell_type":"code","source":"char2idx = {char:index for index, char in enumerate(vocab)}\nchar2idx","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"C_v1hjDmxnxQ","outputId":"c24d469d-5bf1-4d2b-d7ed-97785a91c573","execution":{"iopub.status.busy":"2023-01-23T05:42:19.073666Z","iopub.execute_input":"2023-01-23T05:42:19.073919Z","iopub.status.idle":"2023-01-23T05:42:19.086841Z","shell.execute_reply.started":"2023-01-23T05:42:19.073888Z","shell.execute_reply":"2023-01-23T05:42:19.086002Z"},"trusted":true},"execution_count":6,"outputs":[{"execution_count":6,"output_type":"execute_result","data":{"text/plain":"{'\\n': 0,\n ' ': 1,\n '!': 2,\n '$': 3,\n '&': 4,\n \"'\": 5,\n ',': 6,\n '-': 7,\n '.': 8,\n '3': 9,\n ':': 10,\n ';': 11,\n '?': 12,\n 'A': 13,\n 'B': 14,\n 'C': 15,\n 'D': 16,\n 'E': 17,\n 'F': 18,\n 'G': 19,\n 'H': 20,\n 'I': 21,\n 'J': 22,\n 'K': 23,\n 'L': 24,\n 'M': 25,\n 'N': 26,\n 'O': 27,\n 'P': 28,\n 'Q': 29,\n 'R': 30,\n 'S': 31,\n 'T': 32,\n 'U': 33,\n 'V': 34,\n 'W': 35,\n 'X': 36,\n 'Y': 37,\n 'Z': 38,\n 'a': 39,\n 'b': 40,\n 'c': 41,\n 'd': 42,\n 'e': 43,\n 'f': 44,\n 'g': 45,\n 'h': 46,\n 'i': 47,\n 'j': 48,\n 'k': 49,\n 'l': 50,\n 'm': 51,\n 'n': 52,\n 'o': 53,\n 'p': 54,\n 'q': 55,\n 'r': 56,\n 's': 57,\n 't': 58,\n 'u': 59,\n 'v': 60,\n 'w': 61,\n 'x': 62,\n 'y': 63,\n 'z': 64}"},"metadata":{}}]},{"cell_type":"code","source":"idx2char = np.array(vocab)\nidx2char","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"G1AnsQToxwUG","outputId":"f0fce00b-d6b4-47b6-f061-4b8f7b2d6ab4","execution":{"iopub.status.busy":"2023-01-23T05:42:19.088184Z","iopub.execute_input":"2023-01-23T05:42:19.088453Z","iopub.status.idle":"2023-01-23T05:42:19.096843Z","shell.execute_reply.started":"2023-01-23T05:42:19.088423Z","shell.execute_reply":"2023-01-23T05:42:19.095950Z"},"trusted":true},"execution_count":7,"outputs":[{"execution_count":7,"output_type":"execute_result","data":{"text/plain":"array(['\\n', ' ', '!', '$', '&', \"'\", ',', '-', '.', '3', ':', ';', '?',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\n 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'],\n dtype='<U1')"},"metadata":{}}]},{"cell_type":"code","source":"text_as_int = np.array([char2idx[char] for char in dataset_text])\ntext_as_int[:10]","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Lhj_cmzFyAnR","outputId":"d51a2588-9d44-4f0e-e221-7dfabfb1a622","execution":{"iopub.status.busy":"2023-01-23T05:42:19.098314Z","iopub.execute_input":"2023-01-23T05:42:19.098626Z","iopub.status.idle":"2023-01-23T05:42:19.257519Z","shell.execute_reply.started":"2023-01-23T05:42:19.098589Z","shell.execute_reply":"2023-01-23T05:42:19.256672Z"},"trusted":true},"execution_count":8,"outputs":[{"execution_count":8,"output_type":"execute_result","data":{"text/plain":"array([18, 47, 56, 57, 58, 1, 15, 47, 58, 47])"},"metadata":{}}]},{"cell_type":"code","source":"len(dataset_text)","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"fc0EdA8XyKCF","outputId":"a0609bed-91af-48fc-a42d-f51ef0bb1e2b","execution":{"iopub.status.busy":"2023-01-23T05:42:19.259051Z","iopub.execute_input":"2023-01-23T05:42:19.259368Z","iopub.status.idle":"2023-01-23T05:42:19.265849Z","shell.execute_reply.started":"2023-01-23T05:42:19.259334Z","shell.execute_reply":"2023-01-23T05:42:19.265149Z"},"trusted":true},"execution_count":9,"outputs":[{"execution_count":9,"output_type":"execute_result","data":{"text/plain":"1115394"},"metadata":{}}]},{"cell_type":"code","source":"seq_length = 100\nexamples_per_epoch = len(dataset_text)//seq_length\nexamples_per_epoch","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Q_MlG0OUyScY","outputId":"16035d85-136f-4178-f2ab-b1d9f876fa5d","execution":{"iopub.status.busy":"2023-01-23T05:42:19.269716Z","iopub.execute_input":"2023-01-23T05:42:19.270507Z","iopub.status.idle":"2023-01-23T05:42:19.277000Z","shell.execute_reply.started":"2023-01-23T05:42:19.270471Z","shell.execute_reply":"2023-01-23T05:42:19.276149Z"},"trusted":true},"execution_count":10,"outputs":[{"execution_count":10,"output_type":"execute_result","data":{"text/plain":"11153"},"metadata":{}}]},{"cell_type":"code","source":"char_dataset = tf.data.Dataset.from_tensor_slices(text_as_int)\nfor i in char_dataset.take(100):\n print(idx2char[i.numpy()])","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"H13JVt2Kycnv","outputId":"7eed174f-5c7c-49b5-81a7-6a9f840a2aa1","execution":{"iopub.status.busy":"2023-01-23T05:42:19.278448Z","iopub.execute_input":"2023-01-23T05:42:19.279059Z","iopub.status.idle":"2023-01-23T05:42:19.941991Z","shell.execute_reply.started":"2023-01-23T05:42:19.279020Z","shell.execute_reply":"2023-01-23T05:42:19.941236Z"},"trusted":true},"execution_count":11,"outputs":[{"name":"stdout","text":"F\ni\nr\ns\nt\n \nC\ni\nt\ni\nz\ne\nn\n:\n\n\nB\ne\nf\no\nr\ne\n \nw\ne\n \np\nr\no\nc\ne\ne\nd\n \na\nn\ny\n \nf\nu\nr\nt\nh\ne\nr\n,\n \nh\ne\na\nr\n \nm\ne\n \ns\np\ne\na\nk\n.\n\n\n\n\nA\nl\nl\n:\n\n\nS\np\ne\na\nk\n,\n \ns\np\ne\na\nk\n.\n\n\n\n\nF\ni\nr\ns\nt\n \nC\ni\nt\ni\nz\ne\nn\n:\n\n\nY\no\nu\n","output_type":"stream"}]},{"cell_type":"code","source":"sequences = char_dataset.batch(seq_length + 1, drop_remainder=True)\n\nfor item in sequences.take(50):\n print(repr(''.join(idx2char[item.numpy()])))","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"T8Q-SAGHyjvE","outputId":"058e81b3-ecc0-41d2-e918-2653c80a1bfe","execution":{"iopub.status.busy":"2023-01-23T05:42:19.943296Z","iopub.execute_input":"2023-01-23T05:42:19.943760Z","iopub.status.idle":"2023-01-23T05:42:19.977162Z","shell.execute_reply.started":"2023-01-23T05:42:19.943720Z","shell.execute_reply":"2023-01-23T05:42:19.976456Z"},"trusted":true},"execution_count":12,"outputs":[{"name":"stdout","text":"'First Citizen:\\nBefore we proceed any further, hear me speak.\\n\\nAll:\\nSpeak, speak.\\n\\nFirst Citizen:\\nYou '\n'are all resolved rather to die than to famish?\\n\\nAll:\\nResolved. resolved.\\n\\nFirst Citizen:\\nFirst, you k'\n\"now Caius Marcius is chief enemy to the people.\\n\\nAll:\\nWe know't, we know't.\\n\\nFirst Citizen:\\nLet us ki\"\n\"ll him, and we'll have corn at our own price.\\nIs't a verdict?\\n\\nAll:\\nNo more talking on't; let it be d\"\n'one: away, away!\\n\\nSecond Citizen:\\nOne word, good citizens.\\n\\nFirst Citizen:\\nWe are accounted poor citi'\n'zens, the patricians good.\\nWhat authority surfeits on would relieve us: if they\\nwould yield us but th'\n'e superfluity, while it were\\nwholesome, we might guess they relieved us humanely;\\nbut they think we a'\n're too dear: the leanness that\\nafflicts us, the object of our misery, is as an\\ninventory to particula'\n'rise their abundance; our\\nsufferance is a gain to them Let us revenge this with\\nour pikes, ere we bec'\n'ome rakes: for the gods know I\\nspeak this in hunger for bread, not in thirst for revenge.\\n\\nSecond Cit'\n\"izen:\\nWould you proceed especially against Caius Marcius?\\n\\nAll:\\nAgainst him first: he's a very dog to\"\n' the commonalty.\\n\\nSecond Citizen:\\nConsider you what services he has done for his country?\\n\\nFirst Citi'\n'zen:\\nVery well; and could be content to give him good\\nreport fort, but that he pays himself with bein'\n'g proud.\\n\\nSecond Citizen:\\nNay, but speak not maliciously.\\n\\nFirst Citizen:\\nI say unto you, what he hat'\n'h done famously, he did\\nit to that end: though soft-conscienced men can be\\ncontent to say it was for '\n'his country he did it to\\nplease his mother and to be partly proud; which he\\nis, even till the altitud'\n'e of his virtue.\\n\\nSecond Citizen:\\nWhat he cannot help in his nature, you account a\\nvice in him. You m'\n'ust in no way say he is covetous.\\n\\nFirst Citizen:\\nIf I must not, I need not be barren of accusations;'\n\"\\nhe hath faults, with surplus, to tire in repetition.\\nWhat shouts are these? The other side o' the ci\"\n'ty\\nis risen: why stay we prating here? to the Capitol!\\n\\nAll:\\nCome, come.\\n\\nFirst Citizen:\\nSoft! who co'\n'mes here?\\n\\nSecond Citizen:\\nWorthy Menenius Agrippa; one that hath always loved\\nthe people.\\n\\nFirst Cit'\n\"izen:\\nHe's one honest enough: would all the rest were so!\\n\\nMENENIUS:\\nWhat work's, my countrymen, in h\"\n'and? where go you\\nWith bats and clubs? The matter? speak, I pray you.\\n\\nFirst Citizen:\\nOur business is'\n\" not unknown to the senate; they have\\nhad inkling this fortnight what we intend to do,\\nwhich now we'l\"\n\"l show 'em in deeds. They say poor\\nsuitors have strong breaths: they shall know we\\nhave strong arms t\"\n'oo.\\n\\nMENENIUS:\\nWhy, masters, my good friends, mine honest neighbours,\\nWill you undo yourselves?\\n\\nFirs'\n't Citizen:\\nWe cannot, sir, we are undone already.\\n\\nMENENIUS:\\nI tell you, friends, most charitable car'\n'e\\nHave the patricians of you. For your wants,\\nYour suffering in this dearth, you may as well\\nStrike a'\n't the heaven with your staves as lift them\\nAgainst the Roman state, whose course will on\\nThe way it t'\n'akes, cracking ten thousand curbs\\nOf more strong link asunder than can ever\\nAppear in your impediment'\n'. For the dearth,\\nThe gods, not the patricians, make it, and\\nYour knees to them, not arms, must help.'\n\" Alack,\\nYou are transported by calamity\\nThither where more attends you, and you slander\\nThe helms o' \"\n'the state, who care for you like fathers,\\nWhen you curse them as enemies.\\n\\nFirst Citizen:\\nCare for us'\n\"! True, indeed! They ne'er cared for us\\nyet: suffer us to famish, and their store-houses\\ncrammed with\"\n' grain; make edicts for usury, to\\nsupport usurers; repeal daily any wholesome act\\nestablished against'\n' the rich, and provide more\\npiercing statutes daily, to chain up and restrain\\nthe poor. If the wars e'\n\"at us not up, they will; and\\nthere's all the love they bear us.\\n\\nMENENIUS:\\nEither you must\\nConfess yo\"\n'urselves wondrous malicious,\\nOr be accused of folly. I shall tell you\\nA pretty tale: it may be you ha'\n\"ve heard it;\\nBut, since it serves my purpose, I will venture\\nTo stale 't a little more.\\n\\nFirst Citize\"\n\"n:\\nWell, I'll hear it, sir: yet you must not think to\\nfob off our disgrace with a tale: but, an 't pl\"\n\"ease\\nyou, deliver.\\n\\nMENENIUS:\\nThere was a time when all the body's members\\nRebell'd against the belly\"\n\", thus accused it:\\nThat only like a gulf it did remain\\nI' the midst o' the body, idle and unactive,\\nS\"\n'till cupboarding the viand, never bearing\\nLike labour with the rest, where the other instruments\\nDid '\n'see and hear, devise, instruct, walk, feel,\\nAnd, mutually participate, did minister\\nUnto the appetite'\n\" and affection common\\nOf the whole body. The belly answer'd--\\n\\nFirst Citizen:\\nWell, sir, what answer \"\n\"made the belly?\\n\\nMENENIUS:\\nSir, I shall tell you. With a kind of smile,\\nWhich ne'er came from the lun\"\n'gs, but even thus--\\nFor, look you, I may make the belly smile\\nAs well as speak--it tauntingly replied'\n'\\nTo the discontented members, the mutinous parts\\nThat envied his receipt; even so most fitly\\nAs you m'\n\"align our senators for that\\nThey are not such as you.\\n\\nFirst Citizen:\\nYour belly's answer? What!\\nThe \"\n'kingly-crowned head, the vigilant eye,\\nThe counsellor heart, the arm our soldier,\\nOur steed the leg, '\n","output_type":"stream"}]},{"cell_type":"code","source":"def split_input_target(chunk):\n input_text = chunk[:-1]\n target_text = chunk[1:]\n return input_text, target_text\n\ndataset = sequences.map(split_input_target)","metadata":{"id":"ftr2kK3DzHub","execution":{"iopub.status.busy":"2023-01-23T05:42:19.980043Z","iopub.execute_input":"2023-01-23T05:42:19.980251Z","iopub.status.idle":"2023-01-23T05:42:20.032781Z","shell.execute_reply.started":"2023-01-23T05:42:19.980226Z","shell.execute_reply":"2023-01-23T05:42:20.032098Z"},"trusted":true},"execution_count":13,"outputs":[]},{"cell_type":"code","source":"for input_example, target_example in dataset.take(1):\n print('Input data: ', repr(''.join(idx2char[input_example.numpy()])))\n print('Target data:', repr(''.join(idx2char[target_example.numpy()])))","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"f-xcDQtkzWeR","outputId":"a5109e4b-ece7-48ab-e5d0-a1a245f97a9d","execution":{"iopub.status.busy":"2023-01-23T05:42:20.035451Z","iopub.execute_input":"2023-01-23T05:42:20.035648Z","iopub.status.idle":"2023-01-23T05:42:20.060245Z","shell.execute_reply.started":"2023-01-23T05:42:20.035626Z","shell.execute_reply":"2023-01-23T05:42:20.059123Z"},"trusted":true},"execution_count":14,"outputs":[{"name":"stdout","text":"Input data: 'First Citizen:\\nBefore we proceed any further, hear me speak.\\n\\nAll:\\nSpeak, speak.\\n\\nFirst Citizen:\\nYou'\nTarget data: 'irst Citizen:\\nBefore we proceed any further, hear me speak.\\n\\nAll:\\nSpeak, speak.\\n\\nFirst Citizen:\\nYou '\n","output_type":"stream"}]},{"cell_type":"code","source":"BATCH_SIZE = 64\nBUFFER_SIZE = 10000\n\ndataset = dataset.shuffle(BUFFER_SIZE).batch(BATCH_SIZE, drop_remainder=True)","metadata":{"id":"M3nYBNOPzZjB","execution":{"iopub.status.busy":"2023-01-23T05:42:20.061393Z","iopub.execute_input":"2023-01-23T05:42:20.061627Z","iopub.status.idle":"2023-01-23T05:42:20.072828Z","shell.execute_reply.started":"2023-01-23T05:42:20.061596Z","shell.execute_reply":"2023-01-23T05:42:20.072087Z"},"trusted":true},"execution_count":15,"outputs":[]},{"cell_type":"code","source":"vocab_size = 65 # len(vocab)\nembedding_dim = 256\nrnn_units = 1024\n\ndef build_model(vocab_size, embedding_dim, rnn_units, batch_size):\n model = tf.keras.Sequential()\n\n model.add(\n Embedding(\n vocab_size,\n embedding_dim,\n batch_input_shape = [batch_size, None]\n )\n )\n\n model.add(\n GRU(\n rnn_units,\n return_sequences=True,\n stateful=True,\n recurrent_initializer='glorot_uniform'\n )\n )\n\n model.add(\n Dense(vocab_size)\n )\n \n return model\n\nmodel = build_model(\n vocab_size=len(vocab),\n embedding_dim=embedding_dim,\n rnn_units=rnn_units,\n batch_size=BATCH_SIZE\n)","metadata":{"id":"PUgMHiBAzkF6","execution":{"iopub.status.busy":"2023-01-23T05:48:16.912285Z","iopub.execute_input":"2023-01-23T05:48:16.913054Z","iopub.status.idle":"2023-01-23T05:48:17.105930Z","shell.execute_reply.started":"2023-01-23T05:48:16.913018Z","shell.execute_reply":"2023-01-23T05:48:17.105120Z"},"trusted":true},"execution_count":31,"outputs":[]},{"cell_type":"code","source":"for input_example_batch, target_example_batch in dataset.take(1):\n example_batch_predictions = model(input_example_batch)\n print(example_batch_predictions.shape, \"# (batch_size, sequence_length, vocab_size)\")","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"t3vhBlLo1CpR","outputId":"6cc43fa1-a79c-4252-ae73-13f591674eb8","execution":{"iopub.status.busy":"2023-01-23T05:48:17.401827Z","iopub.execute_input":"2023-01-23T05:48:17.402309Z","iopub.status.idle":"2023-01-23T05:48:18.983245Z","shell.execute_reply.started":"2023-01-23T05:48:17.402280Z","shell.execute_reply":"2023-01-23T05:48:18.981735Z"},"trusted":true},"execution_count":32,"outputs":[{"name":"stdout","text":"(64, 100, 65) # (batch_size, sequence_length, vocab_size)\n","output_type":"stream"}]},{"cell_type":"code","source":"model.summary()","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"IL1SWrFm1PzX","outputId":"be551056-289e-44c6-897f-49fb2b9aef67","execution":{"iopub.status.busy":"2023-01-23T05:48:18.985002Z","iopub.execute_input":"2023-01-23T05:48:18.985682Z","iopub.status.idle":"2023-01-23T05:48:18.994861Z","shell.execute_reply.started":"2023-01-23T05:48:18.985642Z","shell.execute_reply":"2023-01-23T05:48:18.993999Z"},"trusted":true},"execution_count":33,"outputs":[{"name":"stdout","text":"Model: \"sequential_2\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding_2 (Embedding) (64, None, 256) 16640 \n_________________________________________________________________\ngru_2 (GRU) (64, None, 1024) 3938304 \n_________________________________________________________________\ndense_2 (Dense) (64, None, 65) 66625 \n=================================================================\nTotal params: 4,021,569\nTrainable params: 4,021,569\nNon-trainable params: 0\n_________________________________________________________________\n","output_type":"stream"}]},{"cell_type":"code","source":"sampled_indices = tf.random.categorical(example_batch_predictions[0], num_samples=1)\nsampled_indices = tf.squeeze(sampled_indices, axis=-1).numpy()\nsampled_indices","metadata":{"id":"0-gpYLMw1Sdm","execution":{"iopub.status.busy":"2023-01-23T05:48:18.996495Z","iopub.execute_input":"2023-01-23T05:48:18.997002Z","iopub.status.idle":"2023-01-23T05:48:19.005064Z","shell.execute_reply.started":"2023-01-23T05:48:18.996966Z","shell.execute_reply":"2023-01-23T05:48:19.004150Z"},"trusted":true},"execution_count":34,"outputs":[{"execution_count":34,"output_type":"execute_result","data":{"text/plain":"array([11, 13, 63, 60, 45, 29, 57, 14, 55, 31, 28, 5, 6, 3, 64, 28, 48,\n 2, 18, 15, 55, 16, 13, 51, 41, 45, 1, 2, 13, 33, 59, 17, 59, 2,\n 32, 39, 22, 17, 39, 56, 30, 3, 51, 42, 51, 25, 31, 13, 30, 49, 53,\n 51, 11, 6, 53, 22, 48, 41, 5, 47, 40, 7, 47, 22, 25, 61, 42, 23,\n 25, 37, 14, 8, 2, 12, 39, 13, 33, 39, 50, 61, 27, 22, 4, 21, 63,\n 27, 58, 5, 50, 48, 38, 24, 4, 8, 12, 30, 48, 57, 38, 36])"},"metadata":{}}]},{"cell_type":"code","source":"print(\"Input: \\n\", repr(\"\".join(idx2char[input_example_batch[0]])))\nprint()\nprint(\"Next Char Predictions: \\n\", repr(\"\".join(idx2char[sampled_indices ])))","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"g3XtOlwA1kAx","outputId":"3e162f3c-76c9-4aea-e01e-05be7ff89c68","execution":{"iopub.status.busy":"2023-01-23T05:48:19.520318Z","iopub.execute_input":"2023-01-23T05:48:19.520564Z","iopub.status.idle":"2023-01-23T05:48:19.526600Z","shell.execute_reply.started":"2023-01-23T05:48:19.520539Z","shell.execute_reply":"2023-01-23T05:48:19.525826Z"},"trusted":true},"execution_count":35,"outputs":[{"name":"stdout","text":"Input: \n \"n looks bloody on the earth\\nAnd lean-look'd prophets whisper fearful change;\\nRich men look sad and r\"\n\nNext Char Predictions: \n \";AyvgQsBqSP',$zPj!FCqDAmcg !AUuEu!TaJEarR$mdmMSARkom;,oJjc'ib-iJMwdKMYB.!?aAUalwOJ&IyOt'ljZL&.?RjsZX\"\n","output_type":"stream"}]},{"cell_type":"code","source":"def loss(labels, logits):\n return tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True)","metadata":{"id":"6CGV77qX1pVb","execution":{"iopub.status.busy":"2023-01-23T05:48:20.622009Z","iopub.execute_input":"2023-01-23T05:48:20.622284Z","iopub.status.idle":"2023-01-23T05:48:20.626777Z","shell.execute_reply.started":"2023-01-23T05:48:20.622253Z","shell.execute_reply":"2023-01-23T05:48:20.625949Z"},"trusted":true},"execution_count":36,"outputs":[]},{"cell_type":"code","source":"checkpoint_dir = './training_checkpoints'\ncheckpoint_prefix = os.path.join(checkpoint_dir, 'ckpt_{epoch}')\n\ncheckpoint_callback = tf.keras.callbacks.ModelCheckpoint(\n filepath=checkpoint_prefix,\n save_weights_only=True\n)","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:48:21.135077Z","iopub.execute_input":"2023-01-23T05:48:21.135456Z","iopub.status.idle":"2023-01-23T05:48:21.140266Z","shell.execute_reply.started":"2023-01-23T05:48:21.135425Z","shell.execute_reply":"2023-01-23T05:48:21.139270Z"},"trusted":true},"execution_count":37,"outputs":[]},{"cell_type":"code","source":"def loss(labels, logits):\n return tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True)","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:48:21.952950Z","iopub.execute_input":"2023-01-23T05:48:21.953627Z","iopub.status.idle":"2023-01-23T05:48:21.960060Z","shell.execute_reply.started":"2023-01-23T05:48:21.953577Z","shell.execute_reply":"2023-01-23T05:48:21.959325Z"},"trusted":true},"execution_count":38,"outputs":[]},{"cell_type":"code","source":"model.compile(\n optimizer='adam',\n loss=loss\n)","metadata":{"id":"d1J3AtaM11k-","execution":{"iopub.status.busy":"2023-01-23T05:48:22.838668Z","iopub.execute_input":"2023-01-23T05:48:22.838911Z","iopub.status.idle":"2023-01-23T05:48:22.856775Z","shell.execute_reply.started":"2023-01-23T05:48:22.838884Z","shell.execute_reply":"2023-01-23T05:48:22.856104Z"},"trusted":true},"execution_count":39,"outputs":[]},{"cell_type":"code","source":"EPOCHS = 35\nhistory = model.fit(dataset, epochs=EPOCHS, callbacks = [checkpoint_callback])","metadata":{"id":"z3ZPuTza168O","execution":{"iopub.status.busy":"2023-01-23T05:48:23.341195Z","iopub.execute_input":"2023-01-23T05:48:23.341457Z","iopub.status.idle":"2023-01-23T05:53:33.370272Z","shell.execute_reply.started":"2023-01-23T05:48:23.341429Z","shell.execute_reply":"2023-01-23T05:53:33.369333Z"},"trusted":true},"execution_count":40,"outputs":[{"name":"stdout","text":"Epoch 1/35\n172/172 [==============================] - 10s 41ms/step - loss: 3.2216\nEpoch 2/35\n172/172 [==============================] - 9s 41ms/step - loss: 2.0509\nEpoch 3/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.7478\nEpoch 4/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.5806\nEpoch 5/35\n172/172 [==============================] - 9s 42ms/step - loss: 1.4736\nEpoch 6/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.4061\nEpoch 7/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.3548\nEpoch 8/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.3132\nEpoch 9/35\n172/172 [==============================] - 9s 42ms/step - loss: 1.2787\nEpoch 10/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.2442\nEpoch 11/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.2064\nEpoch 12/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.1746\nEpoch 13/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.1417\nEpoch 14/35\n172/172 [==============================] - 9s 42ms/step - loss: 1.1077\nEpoch 15/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.0724\nEpoch 16/35\n172/172 [==============================] - 9s 42ms/step - loss: 1.0369\nEpoch 17/35\n172/172 [==============================] - 9s 41ms/step - loss: 1.0011\nEpoch 18/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.9657\nEpoch 19/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.9257\nEpoch 20/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.8903\nEpoch 21/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.8564\nEpoch 22/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.8274\nEpoch 23/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.7986\nEpoch 24/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.7736\nEpoch 25/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.7469\nEpoch 26/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.7277\nEpoch 27/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.7115\nEpoch 28/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.6967\nEpoch 29/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.6821\nEpoch 30/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.6732\nEpoch 31/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.6618\nEpoch 32/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.6527\nEpoch 33/35\n172/172 [==============================] - 9s 41ms/step - loss: 0.6437\nEpoch 34/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.6404\nEpoch 35/35\n172/172 [==============================] - 9s 42ms/step - loss: 0.6350\n","output_type":"stream"}]},{"cell_type":"code","source":"lossPlot = pd.DataFrame(history.history)\nlossPlot.plot()","metadata":{"id":"ciJjklck2EME","execution":{"iopub.status.busy":"2023-01-23T05:53:35.864744Z","iopub.execute_input":"2023-01-23T05:53:35.867516Z","iopub.status.idle":"2023-01-23T05:53:36.122448Z","shell.execute_reply.started":"2023-01-23T05:53:35.867466Z","shell.execute_reply":"2023-01-23T05:53:36.121666Z"},"trusted":true},"execution_count":41,"outputs":[{"execution_count":41,"output_type":"execute_result","data":{"text/plain":"<AxesSubplot:>"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"<Figure size 432x288 with 1 Axes>","image/png":"iVBORw0KGgoAAAANSUhEUgAAAXoAAAD7CAYAAABkO19ZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZ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Hu3g68CFwEjDezlNCqmM2OQTXPD3Wdubv3AP/BCPs5XoJ+BXBG6Ox5KnArsCTKNR2TmWWZWc6RZWAesP7Yr4oZS4AFoeUFwJNRrCUsRwIz5EZiaF+bmQG/ADa5+48GrYrZ/TxczTG+n4vMbHxoOQO4guC5hReBj4U2i7X9PFTNbw46ADCC5xSOuZ/j5oKp0DCufyI4Auded/9edCs6NjObTPAoHiAFeCAWazazB4HLCN4xrxn4NvAEwZEK1QTvMnqLu8fMyc9har6MYHeCExzt9OeD+r+jyswuAV4B1gEDoeZvEuzzjsn9fIyabyN29/N0gidbkwke5D7i7neG/l98iGAXyGrgk6Ej5ag7Rs2/A4oIjsqpA/5i0Enb979PvAS9iIgMLV66bkREZBgKehGROKegFxGJcwp6EZE4p6AXEYlzCnoRkTinoBcRiXMKehGROPf/AZJU1FEm9kB0AAAAAElFTkSuQmCC\n"},"metadata":{"needs_background":"light"}}]},{"cell_type":"code","source":"tf.train.latest_checkpoint(checkpoint_dir)\n\nmodel = build_model(vocab_size, embedding_dim, rnn_units, batch_size=1)\n\nmodel.load_weights(tf.train.latest_checkpoint(checkpoint_dir))\n\nmodel.build(tf.TensorShape([1, None]))\n\nmodel.summary()","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:53:38.925436Z","iopub.execute_input":"2023-01-23T05:53:38.925714Z","iopub.status.idle":"2023-01-23T05:53:39.188346Z","shell.execute_reply.started":"2023-01-23T05:53:38.925686Z","shell.execute_reply":"2023-01-23T05:53:39.186962Z"},"trusted":true},"execution_count":42,"outputs":[{"name":"stdout","text":"Model: \"sequential_3\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding_3 (Embedding) (1, None, 256) 16640 \n_________________________________________________________________\ngru_3 (GRU) (1, None, 1024) 3938304 \n_________________________________________________________________\ndense_3 (Dense) (1, None, 65) 66625 \n=================================================================\nTotal params: 4,021,569\nTrainable params: 4,021,569\nNon-trainable params: 0\n_________________________________________________________________\n","output_type":"stream"}]},{"cell_type":"code","source":"model.save('model.h5')","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:53:40.113042Z","iopub.execute_input":"2023-01-23T05:53:40.113336Z","iopub.status.idle":"2023-01-23T05:53:40.163870Z","shell.execute_reply.started":"2023-01-23T05:53:40.113305Z","shell.execute_reply":"2023-01-23T05:53:40.162900Z"},"trusted":true},"execution_count":43,"outputs":[]},{"cell_type":"code","source":"model = tf.keras.models.load_model('model.h5')","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:55:04.484716Z","iopub.execute_input":"2023-01-23T05:55:04.484998Z","iopub.status.idle":"2023-01-23T05:55:04.716204Z","shell.execute_reply.started":"2023-01-23T05:55:04.484967Z","shell.execute_reply":"2023-01-23T05:55:04.715394Z"},"trusted":true},"execution_count":51,"outputs":[]},{"cell_type":"code","source":"def generate_text(model, start_string=u'ROMEO:', num_generate=1000, temperature=0.7):\n input_eval = [char2idx[s] for s in start_string]\n input_eval = tf.expand_dims(input_eval, 0)\n\n text_generated = []\n\n model.reset_states()\n for i in range(num_generate):\n predictions = model(input_eval)\n predictions = tf.squeeze(predictions, 0)\n predictions = predictions / temperature\n predicted_id = tf.random.categorical(predictions, num_samples=1)[-1,0].numpy()\n input_eval = tf.expand_dims([predicted_id], 0)\n text_generated.append(idx2char[predicted_id])\n\n return (start_string + ''.join(text_generated))","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:59:17.611210Z","iopub.execute_input":"2023-01-23T05:59:17.611527Z","iopub.status.idle":"2023-01-23T05:59:17.618325Z","shell.execute_reply.started":"2023-01-23T05:59:17.611490Z","shell.execute_reply":"2023-01-23T05:59:17.617438Z"},"trusted":true},"execution_count":58,"outputs":[]},{"cell_type":"code","source":"print(generate_text(model))","metadata":{"execution":{"iopub.status.busy":"2023-01-23T05:59:17.959537Z","iopub.execute_input":"2023-01-23T05:59:17.959774Z","iopub.status.idle":"2023-01-23T05:59:21.962224Z","shell.execute_reply.started":"2023-01-23T05:59:17.959748Z","shell.execute_reply":"2023-01-23T05:59:21.961442Z"},"trusted":true},"execution_count":59,"outputs":[{"name":"stdout","text":"ROMEO:\nWhy, many, sir, what place can witness and the man of some unreverent sinking.\nThe news to say to me, he brings the men of Greece\nAnd bear the self-same tongue; as at the store of men,\nThe queen is coming.\n\nPERDITA:\nSo will, I do not\nThus proclaim us from our hands whose wars death is a devil.\n\nLADY MOPt not from him;\nBut thou the king, post to thy beauty,\nAnd made Verona's sake, Sir John, who being so happy?\n\nThird Servant:\nThat is the best of our friends with silence,\nOr else new form'd him.\n\nSICINIUS:\nShall lie alone;\nLest I rest to say, Signior Prince of Warwick,\nAnd he shall she the belly sir.\n\nCORIOLANUS:\nAway!\n\nSecond Servant:\nOr seeming, COMINIUS:\nFor my peace is mine.\n\nKING RICHARD II:\nWhy straight did I think the weakest world,\nThat we will plant so wide as aught and hazard of the father's voice,\nThat at the boy, if mine own carver man: if she have recourse us.\n\nMessenger:\nShe whom I love.\n\nSecond Murderer:\nO sir, you were possess'd, when thou camest here in the\nThe truth, o\n","output_type":"stream"}]}]}
\ No newline at end of file +{"metadata":{"accelerator":"GPU","colab":{"provenance":[]},"gpuClass":"standard","kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.7.10","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport tensorflow as tf\n\nfrom tensorflow.keras import Sequential\nfrom tensorflow.keras.layers import Embedding, GRU, Dense\n\nimport numpy as np\nimport pandas as pd\nimport os\nimport time","metadata":{"id":"Qu46zrM8wlpM","execution":{"iopub.status.busy":"2023-01-23T09:37:02.077378Z","iopub.execute_input":"2023-01-23T09:37:02.077920Z","iopub.status.idle":"2023-01-23T09:37:07.764808Z","shell.execute_reply.started":"2023-01-23T09:37:02.077805Z","shell.execute_reply":"2023-01-23T09:37:07.763997Z"},"trusted":true},"execution_count":1,"outputs":[]},{"cell_type":"code","source":"physical_devices = tf.config.list_physical_devices('GPU')\nprint(\"Num GPUs:\", len(physical_devices))","metadata":{"execution":{"iopub.status.busy":"2023-01-23T09:37:07.766572Z","iopub.execute_input":"2023-01-23T09:37:07.766837Z","iopub.status.idle":"2023-01-23T09:37:08.041371Z","shell.execute_reply.started":"2023-01-23T09:37:07.766802Z","shell.execute_reply":"2023-01-23T09:37:08.040428Z"},"trusted":true},"execution_count":2,"outputs":[{"name":"stdout","text":"Num GPUs: 2\n","output_type":"stream"}]},{"cell_type":"code","source":"dataset_url = tf.keras.utils.get_file('shakespeare.txt', 'https://storage.googleapis.com/download.tensorflow.org/data/shakespeare.txt')\ndataset_text = open(dataset_url, 'rb').read().decode(encoding='UTF-8')\nprint(dataset_text[:1000])","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"v4gmrb8Yw4HQ","outputId":"8e1db03d-310d-49f6-c617-c1b46014618c","execution":{"iopub.status.busy":"2023-01-23T09:37:08.043029Z","iopub.execute_input":"2023-01-23T09:37:08.043606Z","iopub.status.idle":"2023-01-23T09:37:08.200353Z","shell.execute_reply.started":"2023-01-23T09:37:08.043564Z","shell.execute_reply":"2023-01-23T09:37:08.199665Z"},"trusted":true},"execution_count":3,"outputs":[{"name":"stdout","text":"Downloading data from https://storage.googleapis.com/download.tensorflow.org/data/shakespeare.txt\n1122304/1115394 [==============================] - 0s 0us/step\nFirst Citizen:\nBefore we proceed any further, hear me speak.\n\nAll:\nSpeak, speak.\n\nFirst Citizen:\nYou are all resolved rather to die than to famish?\n\nAll:\nResolved. resolved.\n\nFirst Citizen:\nFirst, you know Caius Marcius is chief enemy to the people.\n\nAll:\nWe know't, we know't.\n\nFirst Citizen:\nLet us kill him, and we'll have corn at our own price.\nIs't a verdict?\n\nAll:\nNo more talking on't; let it be done: away, away!\n\nSecond Citizen:\nOne word, good citizens.\n\nFirst Citizen:\nWe are accounted poor citizens, the patricians good.\nWhat authority surfeits on would relieve us: if they\nwould yield us but the superfluity, while it were\nwholesome, we might guess they relieved us humanely;\nbut they think we are too dear: the leanness that\nafflicts us, the object of our misery, is as an\ninventory to particularise their abundance; our\nsufferance is a gain to them Let us revenge this with\nour pikes, ere we become rakes: for the gods know I\nspeak this in hunger for bread, not in thirst for revenge.\n\n\n","output_type":"stream"}]},{"cell_type":"code","source":"vocab = sorted(set(dataset_text))\nprint(f'There are {len(vocab)} unique characters')","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"M6fUyb4exOYw","outputId":"275ea813-d767-4653-d33a-34cafca6032b","execution":{"iopub.status.busy":"2023-01-23T09:37:08.202817Z","iopub.execute_input":"2023-01-23T09:37:08.203077Z","iopub.status.idle":"2023-01-23T09:37:08.222579Z","shell.execute_reply.started":"2023-01-23T09:37:08.203044Z","shell.execute_reply":"2023-01-23T09:37:08.221616Z"},"trusted":true},"execution_count":4,"outputs":[{"name":"stdout","text":"There are 65 unique characters\n","output_type":"stream"}]},{"cell_type":"code","source":"char2idx = {char:index for index, char in enumerate(vocab)}\nchar2idx","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"C_v1hjDmxnxQ","outputId":"c24d469d-5bf1-4d2b-d7ed-97785a91c573","execution":{"iopub.status.busy":"2023-01-23T09:37:08.224008Z","iopub.execute_input":"2023-01-23T09:37:08.224567Z","iopub.status.idle":"2023-01-23T09:37:08.240003Z","shell.execute_reply.started":"2023-01-23T09:37:08.224533Z","shell.execute_reply":"2023-01-23T09:37:08.239251Z"},"trusted":true},"execution_count":5,"outputs":[{"execution_count":5,"output_type":"execute_result","data":{"text/plain":"{'\\n': 0,\n ' ': 1,\n '!': 2,\n '$': 3,\n '&': 4,\n \"'\": 5,\n ',': 6,\n '-': 7,\n '.': 8,\n '3': 9,\n ':': 10,\n ';': 11,\n '?': 12,\n 'A': 13,\n 'B': 14,\n 'C': 15,\n 'D': 16,\n 'E': 17,\n 'F': 18,\n 'G': 19,\n 'H': 20,\n 'I': 21,\n 'J': 22,\n 'K': 23,\n 'L': 24,\n 'M': 25,\n 'N': 26,\n 'O': 27,\n 'P': 28,\n 'Q': 29,\n 'R': 30,\n 'S': 31,\n 'T': 32,\n 'U': 33,\n 'V': 34,\n 'W': 35,\n 'X': 36,\n 'Y': 37,\n 'Z': 38,\n 'a': 39,\n 'b': 40,\n 'c': 41,\n 'd': 42,\n 'e': 43,\n 'f': 44,\n 'g': 45,\n 'h': 46,\n 'i': 47,\n 'j': 48,\n 'k': 49,\n 'l': 50,\n 'm': 51,\n 'n': 52,\n 'o': 53,\n 'p': 54,\n 'q': 55,\n 'r': 56,\n 's': 57,\n 't': 58,\n 'u': 59,\n 'v': 60,\n 'w': 61,\n 'x': 62,\n 'y': 63,\n 'z': 64}"},"metadata":{}}]},{"cell_type":"code","source":"idx2char = np.array(vocab)\nidx2char","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"G1AnsQToxwUG","outputId":"f0fce00b-d6b4-47b6-f061-4b8f7b2d6ab4","execution":{"iopub.status.busy":"2023-01-23T09:37:08.241241Z","iopub.execute_input":"2023-01-23T09:37:08.241510Z","iopub.status.idle":"2023-01-23T09:37:08.251158Z","shell.execute_reply.started":"2023-01-23T09:37:08.241479Z","shell.execute_reply":"2023-01-23T09:37:08.250471Z"},"trusted":true},"execution_count":6,"outputs":[{"execution_count":6,"output_type":"execute_result","data":{"text/plain":"array(['\\n', ' ', '!', '$', '&', \"'\", ',', '-', '.', '3', ':', ';', '?',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',\n 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'],\n dtype='<U1')"},"metadata":{}}]},{"cell_type":"code","source":"text_as_int = np.array([char2idx[char] for char in dataset_text])\ntext_as_int[:10]","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Lhj_cmzFyAnR","outputId":"d51a2588-9d44-4f0e-e221-7dfabfb1a622","execution":{"iopub.status.busy":"2023-01-23T09:37:08.252482Z","iopub.execute_input":"2023-01-23T09:37:08.252963Z","iopub.status.idle":"2023-01-23T09:37:08.430240Z","shell.execute_reply.started":"2023-01-23T09:37:08.252927Z","shell.execute_reply":"2023-01-23T09:37:08.429107Z"},"trusted":true},"execution_count":7,"outputs":[{"execution_count":7,"output_type":"execute_result","data":{"text/plain":"array([18, 47, 56, 57, 58, 1, 15, 47, 58, 47])"},"metadata":{}}]},{"cell_type":"code","source":"len(dataset_text)","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"fc0EdA8XyKCF","outputId":"a0609bed-91af-48fc-a42d-f51ef0bb1e2b","execution":{"iopub.status.busy":"2023-01-23T09:37:08.431688Z","iopub.execute_input":"2023-01-23T09:37:08.431973Z","iopub.status.idle":"2023-01-23T09:37:08.439019Z","shell.execute_reply.started":"2023-01-23T09:37:08.431936Z","shell.execute_reply":"2023-01-23T09:37:08.438293Z"},"trusted":true},"execution_count":8,"outputs":[{"execution_count":8,"output_type":"execute_result","data":{"text/plain":"1115394"},"metadata":{}}]},{"cell_type":"code","source":"seq_length = 100\nexamples_per_epoch = len(dataset_text)//seq_length\nexamples_per_epoch","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Q_MlG0OUyScY","outputId":"16035d85-136f-4178-f2ab-b1d9f876fa5d","execution":{"iopub.status.busy":"2023-01-23T09:37:08.440219Z","iopub.execute_input":"2023-01-23T09:37:08.441024Z","iopub.status.idle":"2023-01-23T09:37:08.449458Z","shell.execute_reply.started":"2023-01-23T09:37:08.440985Z","shell.execute_reply":"2023-01-23T09:37:08.448568Z"},"trusted":true},"execution_count":9,"outputs":[{"execution_count":9,"output_type":"execute_result","data":{"text/plain":"11153"},"metadata":{}}]},{"cell_type":"code","source":"char_dataset = tf.data.Dataset.from_tensor_slices(text_as_int)\nfor i in char_dataset.take(100):\n print(idx2char[i.numpy()])","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"H13JVt2Kycnv","outputId":"7eed174f-5c7c-49b5-81a7-6a9f840a2aa1","_kg_hide-output":true,"execution":{"iopub.status.busy":"2023-01-23T09:37:08.452653Z","iopub.execute_input":"2023-01-23T09:37:08.453103Z","iopub.status.idle":"2023-01-23T09:37:10.825477Z","shell.execute_reply.started":"2023-01-23T09:37:08.453070Z","shell.execute_reply":"2023-01-23T09:37:10.824782Z"},"trusted":true},"execution_count":10,"outputs":[{"name":"stdout","text":"F\ni\nr\ns\nt\n \nC\ni\nt\ni\nz\ne\nn\n:\n\n\nB\ne\nf\no\nr\ne\n \nw\ne\n \np\nr\no\nc\ne\ne\nd\n \na\nn\ny\n \nf\nu\nr\nt\nh\ne\nr\n,\n \nh\ne\na\nr\n \nm\ne\n \ns\np\ne\na\nk\n.\n\n\n\n\nA\nl\nl\n:\n\n\nS\np\ne\na\nk\n,\n \ns\np\ne\na\nk\n.\n\n\n\n\nF\ni\nr\ns\nt\n \nC\ni\nt\ni\nz\ne\nn\n:\n\n\nY\no\nu\n","output_type":"stream"}]},{"cell_type":"code","source":"sequences = char_dataset.batch(seq_length + 1, drop_remainder=True)\n\nfor item in sequences.take(50):\n print(repr(''.join(idx2char[item.numpy()])))","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"T8Q-SAGHyjvE","outputId":"058e81b3-ecc0-41d2-e918-2653c80a1bfe","execution":{"iopub.status.busy":"2023-01-23T09:37:10.829228Z","iopub.execute_input":"2023-01-23T09:37:10.829459Z","iopub.status.idle":"2023-01-23T09:37:10.880413Z","shell.execute_reply.started":"2023-01-23T09:37:10.829427Z","shell.execute_reply":"2023-01-23T09:37:10.877662Z"},"trusted":true},"execution_count":11,"outputs":[{"name":"stdout","text":"'First Citizen:\\nBefore we proceed any further, hear me speak.\\n\\nAll:\\nSpeak, speak.\\n\\nFirst Citizen:\\nYou '\n'are all resolved rather to die than to famish?\\n\\nAll:\\nResolved. resolved.\\n\\nFirst Citizen:\\nFirst, you k'\n\"now Caius Marcius is chief enemy to the people.\\n\\nAll:\\nWe know't, we know't.\\n\\nFirst Citizen:\\nLet us ki\"\n\"ll him, and we'll have corn at our own price.\\nIs't a verdict?\\n\\nAll:\\nNo more talking on't; let it be d\"\n'one: away, away!\\n\\nSecond Citizen:\\nOne word, good citizens.\\n\\nFirst Citizen:\\nWe are accounted poor citi'\n'zens, the patricians good.\\nWhat authority surfeits on would relieve us: if they\\nwould yield us but th'\n'e superfluity, while it were\\nwholesome, we might guess they relieved us humanely;\\nbut they think we a'\n're too dear: the leanness that\\nafflicts us, the object of our misery, is as an\\ninventory to particula'\n'rise their abundance; our\\nsufferance is a gain to them Let us revenge this with\\nour pikes, ere we bec'\n'ome rakes: for the gods know I\\nspeak this in hunger for bread, not in thirst for revenge.\\n\\nSecond Cit'\n\"izen:\\nWould you proceed especially against Caius Marcius?\\n\\nAll:\\nAgainst him first: he's a very dog to\"\n' the commonalty.\\n\\nSecond Citizen:\\nConsider you what services he has done for his country?\\n\\nFirst Citi'\n'zen:\\nVery well; and could be content to give him good\\nreport fort, but that he pays himself with bein'\n'g proud.\\n\\nSecond Citizen:\\nNay, but speak not maliciously.\\n\\nFirst Citizen:\\nI say unto you, what he hat'\n'h done famously, he did\\nit to that end: though soft-conscienced men can be\\ncontent to say it was for '\n'his country he did it to\\nplease his mother and to be partly proud; which he\\nis, even till the altitud'\n'e of his virtue.\\n\\nSecond Citizen:\\nWhat he cannot help in his nature, you account a\\nvice in him. You m'\n'ust in no way say he is covetous.\\n\\nFirst Citizen:\\nIf I must not, I need not be barren of accusations;'\n\"\\nhe hath faults, with surplus, to tire in repetition.\\nWhat shouts are these? The other side o' the ci\"\n'ty\\nis risen: why stay we prating here? to the Capitol!\\n\\nAll:\\nCome, come.\\n\\nFirst Citizen:\\nSoft! who co'\n'mes here?\\n\\nSecond Citizen:\\nWorthy Menenius Agrippa; one that hath always loved\\nthe people.\\n\\nFirst Cit'\n\"izen:\\nHe's one honest enough: would all the rest were so!\\n\\nMENENIUS:\\nWhat work's, my countrymen, in h\"\n'and? where go you\\nWith bats and clubs? The matter? speak, I pray you.\\n\\nFirst Citizen:\\nOur business is'\n\" not unknown to the senate; they have\\nhad inkling this fortnight what we intend to do,\\nwhich now we'l\"\n\"l show 'em in deeds. They say poor\\nsuitors have strong breaths: they shall know we\\nhave strong arms t\"\n'oo.\\n\\nMENENIUS:\\nWhy, masters, my good friends, mine honest neighbours,\\nWill you undo yourselves?\\n\\nFirs'\n't Citizen:\\nWe cannot, sir, we are undone already.\\n\\nMENENIUS:\\nI tell you, friends, most charitable car'\n'e\\nHave the patricians of you. For your wants,\\nYour suffering in this dearth, you may as well\\nStrike a'\n't the heaven with your staves as lift them\\nAgainst the Roman state, whose course will on\\nThe way it t'\n'akes, cracking ten thousand curbs\\nOf more strong link asunder than can ever\\nAppear in your impediment'\n'. For the dearth,\\nThe gods, not the patricians, make it, and\\nYour knees to them, not arms, must help.'\n\" Alack,\\nYou are transported by calamity\\nThither where more attends you, and you slander\\nThe helms o' \"\n'the state, who care for you like fathers,\\nWhen you curse them as enemies.\\n\\nFirst Citizen:\\nCare for us'\n\"! True, indeed! They ne'er cared for us\\nyet: suffer us to famish, and their store-houses\\ncrammed with\"\n' grain; make edicts for usury, to\\nsupport usurers; repeal daily any wholesome act\\nestablished against'\n' the rich, and provide more\\npiercing statutes daily, to chain up and restrain\\nthe poor. If the wars e'\n\"at us not up, they will; and\\nthere's all the love they bear us.\\n\\nMENENIUS:\\nEither you must\\nConfess yo\"\n'urselves wondrous malicious,\\nOr be accused of folly. I shall tell you\\nA pretty tale: it may be you ha'\n\"ve heard it;\\nBut, since it serves my purpose, I will venture\\nTo stale 't a little more.\\n\\nFirst Citize\"\n\"n:\\nWell, I'll hear it, sir: yet you must not think to\\nfob off our disgrace with a tale: but, an 't pl\"\n\"ease\\nyou, deliver.\\n\\nMENENIUS:\\nThere was a time when all the body's members\\nRebell'd against the belly\"\n\", thus accused it:\\nThat only like a gulf it did remain\\nI' the midst o' the body, idle and unactive,\\nS\"\n'till cupboarding the viand, never bearing\\nLike labour with the rest, where the other instruments\\nDid '\n'see and hear, devise, instruct, walk, feel,\\nAnd, mutually participate, did minister\\nUnto the appetite'\n\" and affection common\\nOf the whole body. The belly answer'd--\\n\\nFirst Citizen:\\nWell, sir, what answer \"\n\"made the belly?\\n\\nMENENIUS:\\nSir, I shall tell you. With a kind of smile,\\nWhich ne'er came from the lun\"\n'gs, but even thus--\\nFor, look you, I may make the belly smile\\nAs well as speak--it tauntingly replied'\n'\\nTo the discontented members, the mutinous parts\\nThat envied his receipt; even so most fitly\\nAs you m'\n\"align our senators for that\\nThey are not such as you.\\n\\nFirst Citizen:\\nYour belly's answer? What!\\nThe \"\n'kingly-crowned head, the vigilant eye,\\nThe counsellor heart, the arm our soldier,\\nOur steed the leg, '\n","output_type":"stream"}]},{"cell_type":"code","source":"def split_input_target(chunk):\n input_text = chunk[:-1]\n target_text = chunk[1:]\n return input_text, target_text\n\ndataset = sequences.map(split_input_target)","metadata":{"id":"ftr2kK3DzHub","execution":{"iopub.status.busy":"2023-01-23T09:37:10.884263Z","iopub.execute_input":"2023-01-23T09:37:10.885690Z","iopub.status.idle":"2023-01-23T09:37:10.952667Z","shell.execute_reply.started":"2023-01-23T09:37:10.885650Z","shell.execute_reply":"2023-01-23T09:37:10.951675Z"},"trusted":true},"execution_count":12,"outputs":[]},{"cell_type":"code","source":"for input_example, target_example in dataset.take(1):\n print('Input data: ', repr(''.join(idx2char[input_example.numpy()])))\n print('Target data:', repr(''.join(idx2char[target_example.numpy()])))","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"f-xcDQtkzWeR","outputId":"a5109e4b-ece7-48ab-e5d0-a1a245f97a9d","execution":{"iopub.status.busy":"2023-01-23T09:37:10.954874Z","iopub.execute_input":"2023-01-23T09:37:10.955149Z","iopub.status.idle":"2023-01-23T09:37:11.018779Z","shell.execute_reply.started":"2023-01-23T09:37:10.955114Z","shell.execute_reply":"2023-01-23T09:37:11.017892Z"},"trusted":true},"execution_count":13,"outputs":[{"name":"stdout","text":"Input data: 'First Citizen:\\nBefore we proceed any further, hear me speak.\\n\\nAll:\\nSpeak, speak.\\n\\nFirst Citizen:\\nYou'\nTarget data: 'irst Citizen:\\nBefore we proceed any further, hear me speak.\\n\\nAll:\\nSpeak, speak.\\n\\nFirst Citizen:\\nYou '\n","output_type":"stream"}]},{"cell_type":"code","source":"BATCH_SIZE = 64\nBUFFER_SIZE = 10000\n\ndataset = dataset.shuffle(BUFFER_SIZE).batch(BATCH_SIZE, drop_remainder=True)","metadata":{"id":"M3nYBNOPzZjB","execution":{"iopub.status.busy":"2023-01-23T09:37:11.020449Z","iopub.execute_input":"2023-01-23T09:37:11.020915Z","iopub.status.idle":"2023-01-23T09:37:11.028510Z","shell.execute_reply.started":"2023-01-23T09:37:11.020864Z","shell.execute_reply":"2023-01-23T09:37:11.027554Z"},"trusted":true},"execution_count":14,"outputs":[]},{"cell_type":"code","source":"vocab_size = 65 # len(vocab)\nembedding_dim = 256\nrnn_units = 1024\n\ndef build_model(vocab_size, embedding_dim, rnn_units, batch_size):\n model = tf.keras.Sequential()\n\n model.add(\n Embedding(\n vocab_size,\n embedding_dim,\n batch_input_shape = [batch_size, None]\n )\n )\n\n model.add(\n GRU(\n rnn_units,\n return_sequences=True,\n stateful=True,\n reset_after=False,\n recurrent_initializer='glorot_uniform'\n )\n )\n\n model.add(\n Dense(vocab_size)\n )\n \n return model\n\nmodel = build_model(\n vocab_size=len(vocab),\n embedding_dim=embedding_dim,\n rnn_units=rnn_units,\n batch_size=BATCH_SIZE\n)","metadata":{"id":"PUgMHiBAzkF6","execution":{"iopub.status.busy":"2023-01-23T09:37:11.030294Z","iopub.execute_input":"2023-01-23T09:37:11.030591Z","iopub.status.idle":"2023-01-23T09:37:11.483362Z","shell.execute_reply.started":"2023-01-23T09:37:11.030553Z","shell.execute_reply":"2023-01-23T09:37:11.482569Z"},"trusted":true},"execution_count":15,"outputs":[]},{"cell_type":"code","source":"for input_example_batch, target_example_batch in dataset.take(1):\n example_batch_predictions = model(input_example_batch)\n print(example_batch_predictions.shape, \"# (batch_size, sequence_length, vocab_size)\")","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"t3vhBlLo1CpR","outputId":"6cc43fa1-a79c-4252-ae73-13f591674eb8","execution":{"iopub.status.busy":"2023-01-23T09:37:11.484676Z","iopub.execute_input":"2023-01-23T09:37:11.484944Z","iopub.status.idle":"2023-01-23T09:37:14.908016Z","shell.execute_reply.started":"2023-01-23T09:37:11.484910Z","shell.execute_reply":"2023-01-23T09:37:14.906508Z"},"trusted":true},"execution_count":16,"outputs":[{"name":"stdout","text":"(64, 100, 65) # (batch_size, sequence_length, vocab_size)\n","output_type":"stream"}]},{"cell_type":"code","source":"model.summary()","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"IL1SWrFm1PzX","outputId":"be551056-289e-44c6-897f-49fb2b9aef67","execution":{"iopub.status.busy":"2023-01-23T09:37:14.909771Z","iopub.execute_input":"2023-01-23T09:37:14.910120Z","iopub.status.idle":"2023-01-23T09:37:14.918780Z","shell.execute_reply.started":"2023-01-23T09:37:14.910076Z","shell.execute_reply":"2023-01-23T09:37:14.917239Z"},"trusted":true},"execution_count":17,"outputs":[{"name":"stdout","text":"Model: \"sequential\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding (Embedding) (64, None, 256) 16640 \n_________________________________________________________________\ngru (GRU) (64, None, 1024) 3935232 \n_________________________________________________________________\ndense (Dense) (64, None, 65) 66625 \n=================================================================\nTotal params: 4,018,497\nTrainable params: 4,018,497\nNon-trainable params: 0\n_________________________________________________________________\n","output_type":"stream"}]},{"cell_type":"code","source":"sampled_indices = tf.random.categorical(example_batch_predictions[0], num_samples=1)\nsampled_indices = tf.squeeze(sampled_indices, axis=-1).numpy()\nsampled_indices","metadata":{"id":"0-gpYLMw1Sdm","execution":{"iopub.status.busy":"2023-01-23T09:37:14.920106Z","iopub.execute_input":"2023-01-23T09:37:14.920734Z","iopub.status.idle":"2023-01-23T09:37:14.933901Z","shell.execute_reply.started":"2023-01-23T09:37:14.920699Z","shell.execute_reply":"2023-01-23T09:37:14.932744Z"},"trusted":true},"execution_count":18,"outputs":[{"execution_count":18,"output_type":"execute_result","data":{"text/plain":"array([40, 9, 43, 50, 11, 22, 21, 31, 24, 32, 40, 64, 7, 7, 23, 45, 20,\n 10, 7, 18, 36, 19, 59, 15, 19, 58, 64, 0, 4, 10, 31, 36, 63, 41,\n 14, 32, 10, 54, 51, 20, 46, 61, 20, 9, 46, 11, 49, 37, 19, 60, 27,\n 35, 24, 9, 55, 47, 63, 2, 9, 11, 53, 24, 11, 43, 1, 57, 5, 8,\n 56, 60, 11, 32, 25, 8, 43, 35, 35, 0, 43, 18, 46, 48, 56, 47, 27,\n 42, 51, 19, 18, 7, 33, 52, 58, 56, 0, 26, 10, 10, 57, 49])"},"metadata":{}}]},{"cell_type":"code","source":"print(\"Input: \\n\", repr(\"\".join(idx2char[input_example_batch[0]])))\nprint()\nprint(\"Next Char Predictions: \\n\", repr(\"\".join(idx2char[sampled_indices ])))","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"g3XtOlwA1kAx","outputId":"3e162f3c-76c9-4aea-e01e-05be7ff89c68","execution":{"iopub.status.busy":"2023-01-23T09:37:14.935194Z","iopub.execute_input":"2023-01-23T09:37:14.935512Z","iopub.status.idle":"2023-01-23T09:37:14.943010Z","shell.execute_reply.started":"2023-01-23T09:37:14.935480Z","shell.execute_reply":"2023-01-23T09:37:14.942210Z"},"trusted":true},"execution_count":19,"outputs":[{"name":"stdout","text":"Input: \n 'ts advice.\\n\\nProvost:\\nHe will hear none: he hath evermore had the liberty\\nof the prison; give him lea'\n\nNext Char Predictions: \n \"b3el;JISLTbz--KgH:-FXGuCGtz\\n&:SXycBT:pmHhwH3h;kYGvOWL3qiy!3;oL;e s'.rv;TM.eWW\\neFhjriOdmGF-Untr\\nN::sk\"\n","output_type":"stream"}]},{"cell_type":"code","source":"def loss(labels, logits):\n return tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True)","metadata":{"id":"6CGV77qX1pVb","execution":{"iopub.status.busy":"2023-01-23T09:37:14.944035Z","iopub.execute_input":"2023-01-23T09:37:14.944872Z","iopub.status.idle":"2023-01-23T09:37:14.953337Z","shell.execute_reply.started":"2023-01-23T09:37:14.944830Z","shell.execute_reply":"2023-01-23T09:37:14.952527Z"},"trusted":true},"execution_count":20,"outputs":[]},{"cell_type":"code","source":"checkpoint_dir = './training_checkpoints'\ncheckpoint_prefix = os.path.join(checkpoint_dir, 'ckpt_{epoch}')\n\ncheckpoint_callback = tf.keras.callbacks.ModelCheckpoint(\n filepath=checkpoint_prefix,\n save_weights_only=True\n)","metadata":{"execution":{"iopub.status.busy":"2023-01-23T09:37:14.954477Z","iopub.execute_input":"2023-01-23T09:37:14.954798Z","iopub.status.idle":"2023-01-23T09:37:14.964647Z","shell.execute_reply.started":"2023-01-23T09:37:14.954766Z","shell.execute_reply":"2023-01-23T09:37:14.963928Z"},"trusted":true},"execution_count":21,"outputs":[]},{"cell_type":"code","source":"def loss(labels, logits):\n return tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True)","metadata":{"execution":{"iopub.status.busy":"2023-01-23T09:37:14.965789Z","iopub.execute_input":"2023-01-23T09:37:14.966097Z","iopub.status.idle":"2023-01-23T09:37:14.975979Z","shell.execute_reply.started":"2023-01-23T09:37:14.966065Z","shell.execute_reply":"2023-01-23T09:37:14.975158Z"},"trusted":true},"execution_count":22,"outputs":[]},{"cell_type":"code","source":"model.compile(\n optimizer='adam',\n loss=loss\n)","metadata":{"id":"d1J3AtaM11k-","execution":{"iopub.status.busy":"2023-01-23T09:37:14.977047Z","iopub.execute_input":"2023-01-23T09:37:14.977266Z","iopub.status.idle":"2023-01-23T09:37:14.994980Z","shell.execute_reply.started":"2023-01-23T09:37:14.977242Z","shell.execute_reply":"2023-01-23T09:37:14.994192Z"},"trusted":true},"execution_count":23,"outputs":[]},{"cell_type":"code","source":"EPOCHS = 100\nhistory = model.fit(dataset, epochs=EPOCHS, callbacks = [checkpoint_callback])","metadata":{"id":"z3ZPuTza168O","execution":{"iopub.status.busy":"2023-01-23T09:37:14.997202Z","iopub.execute_input":"2023-01-23T09:37:14.997733Z","iopub.status.idle":"2023-01-23T10:22:52.108867Z","shell.execute_reply.started":"2023-01-23T09:37:14.997686Z","shell.execute_reply":"2023-01-23T10:22:52.108031Z"},"trusted":true},"execution_count":24,"outputs":[{"name":"stdout","text":"Epoch 1/100\n172/172 [==============================] - 28s 149ms/step - loss: 3.2528\nEpoch 2/100\n172/172 [==============================] - 27s 149ms/step - loss: 2.0502\nEpoch 3/100\n172/172 [==============================] - 27s 147ms/step - loss: 1.7519\nEpoch 4/100\n172/172 [==============================] - 28s 149ms/step - loss: 1.5769\nEpoch 5/100\n172/172 [==============================] - 27s 150ms/step - loss: 1.4743\nEpoch 6/100\n172/172 [==============================] - 27s 151ms/step - loss: 1.4070\nEpoch 7/100\n172/172 [==============================] - 27s 151ms/step - loss: 1.3549\nEpoch 8/100\n172/172 [==============================] - 27s 150ms/step - loss: 1.3105\nEpoch 9/100\n172/172 [==============================] - 28s 152ms/step - loss: 1.2702\nEpoch 10/100\n172/172 [==============================] - 27s 151ms/step - loss: 1.2283\nEpoch 11/100\n172/172 [==============================] - 27s 150ms/step - loss: 1.1912\nEpoch 12/100\n172/172 [==============================] - 28s 150ms/step - loss: 1.1551\nEpoch 13/100\n172/172 [==============================] - 27s 150ms/step - loss: 1.1107\nEpoch 14/100\n172/172 [==============================] - 28s 152ms/step - loss: 1.0683\nEpoch 15/100\n172/172 [==============================] - 27s 151ms/step - loss: 1.0273\nEpoch 16/100\n172/172 [==============================] - 28s 151ms/step - loss: 0.9816\nEpoch 17/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.9342\nEpoch 18/100\n172/172 [==============================] - 28s 152ms/step - loss: 0.8905\nEpoch 19/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.8503\nEpoch 20/100\n172/172 [==============================] - 28s 151ms/step - loss: 0.8118\nEpoch 21/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.7790\nEpoch 22/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.7479\nEpoch 23/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.7277\nEpoch 24/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.7034\nEpoch 25/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.6863\nEpoch 26/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.6672\nEpoch 27/100\n172/172 [==============================] - 27s 147ms/step - loss: 0.6532\nEpoch 28/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.6417\nEpoch 29/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.6303\nEpoch 30/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.6182\nEpoch 31/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.6094\nEpoch 32/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.5996\nEpoch 33/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.5949\nEpoch 34/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5854\nEpoch 35/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5776\nEpoch 36/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.5734\nEpoch 37/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5657\nEpoch 38/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.5582\nEpoch 39/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5597\nEpoch 40/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5522\nEpoch 41/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5465\nEpoch 42/100\n172/172 [==============================] - 27s 147ms/step - loss: 0.5435\nEpoch 43/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5392\nEpoch 44/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5378\nEpoch 45/100\n172/172 [==============================] - 28s 150ms/step - loss: 0.5308\nEpoch 46/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5286\nEpoch 47/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5268\nEpoch 48/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5275\nEpoch 49/100\n172/172 [==============================] - 27s 147ms/step - loss: 0.5212\nEpoch 50/100\n172/172 [==============================] - 27s 147ms/step - loss: 0.5193\nEpoch 51/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5166\nEpoch 52/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5137\nEpoch 53/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.5111\nEpoch 54/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5116\nEpoch 55/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.5077\nEpoch 56/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.5061\nEpoch 57/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.5054\nEpoch 58/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.5026\nEpoch 59/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.5029\nEpoch 60/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.5021\nEpoch 61/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4982\nEpoch 62/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4984\nEpoch 63/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4972\nEpoch 64/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4969\nEpoch 65/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4952\nEpoch 66/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4900\nEpoch 67/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4915\nEpoch 68/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4940\nEpoch 69/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4929\nEpoch 70/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4867\nEpoch 71/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4874\nEpoch 72/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4868\nEpoch 73/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4832\nEpoch 74/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4843\nEpoch 75/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4814\nEpoch 76/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4821\nEpoch 77/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4817\nEpoch 78/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4821\nEpoch 79/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4831\nEpoch 80/100\n172/172 [==============================] - 28s 148ms/step - loss: 0.4828\nEpoch 81/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4784\nEpoch 82/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4804\nEpoch 83/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4803\nEpoch 84/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4773\nEpoch 85/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4750\nEpoch 86/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4726\nEpoch 87/100\n172/172 [==============================] - 27s 147ms/step - loss: 0.4746\nEpoch 88/100\n172/172 [==============================] - 27s 151ms/step - loss: 0.4727\nEpoch 89/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4734\nEpoch 90/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4738\nEpoch 91/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4733\nEpoch 92/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4723\nEpoch 93/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4715\nEpoch 94/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4705\nEpoch 95/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4723\nEpoch 96/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4717\nEpoch 97/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4693\nEpoch 98/100\n172/172 [==============================] - 27s 150ms/step - loss: 0.4689\nEpoch 99/100\n172/172 [==============================] - 27s 148ms/step - loss: 0.4666\nEpoch 100/100\n172/172 [==============================] - 27s 149ms/step - loss: 0.4667\n","output_type":"stream"}]},{"cell_type":"code","source":"lossPlot = pd.DataFrame(history.history)\nlossPlot.plot()","metadata":{"id":"ciJjklck2EME","execution":{"iopub.status.busy":"2023-01-23T10:22:52.110461Z","iopub.execute_input":"2023-01-23T10:22:52.110754Z","iopub.status.idle":"2023-01-23T10:22:52.436828Z","shell.execute_reply.started":"2023-01-23T10:22:52.110716Z","shell.execute_reply":"2023-01-23T10:22:52.436054Z"},"trusted":true},"execution_count":25,"outputs":[{"execution_count":25,"output_type":"execute_result","data":{"text/plain":"<AxesSubplot:>"},"metadata":{}},{"output_type":"display_data","data":{"text/plain":"<Figure size 432x288 with 1 Axes>","image/png":"iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAflElEQVR4nO3deXxddZ3/8dfnrllu1iZtadI2BcpSti6homjdFUU2UR6gAkUUF2Tcfs64zM8fOvoTwcERcGTYQQVxAAVlcVwYAYelaWlLpSylpTRd06ZJs+cu3/nj3pQQGpo0Nzk5576fj0ce3OUk53M48D7f8z3fc77mnENERPwv5HUBIiKSHwp0EZGAUKCLiASEAl1EJCAU6CIiARHxasU1NTWuoaHBq9WLiPjS8uXLdzrnavf1nWeB3tDQQFNTk1erFxHxJTPbON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2au3UbMM2rusbRvwH/CGRy76cAbc65VO590Pb5HKAFuDnXzXSDmZUS8H3tnNsM/Ah4hWyQtwPLCfa+Hmy4/TumjPNboBcUM0sAdwNfcs7tGfydy443DdSYUzP7ELDDObfc61omUARYCPzMObcA6GJI90pA93UV2dboHGAGUMrruyUKQj73r98CfTMwc9D7+txngWNmUbJh/kvn3D25j7cPnH7l/rnDq/rGyYnAqWb2MtnutHeR7V+uzJ2WQ/D2eTPQ7Jx7Mvf+LrIBH/R9/R5gg3OuxTmXBO4hu/+DvK8HG27/jinj/Bboy4C5uSvhMbIXUe7zuKa8y/Ub3wisdc5dOeir+4Dzc6/PB+6d6NrGk3PuG865eudcA9l9+xfn3MeBh4GP5BYL1HY757YBm8zs8NxH7waeJeD7mmxXywlmVpL7731guwO7r4cYbv/eB5yXG+1yAtA+qGtm/5xzvvoBPgi8ALwEfMvresZpG99K9hRsNbAy9/NBsv3JfwZeBP4EVHtd6zj+O3gH8Pvc64OBp4B1wH8Cca/ry/O2zgeacvv7t0BVIexr4DvAc8Aa4OdAPIj7GriD7HWCJNkzsguH27+AkR3J9xLwDNlRQCNel279FxEJCL91uYiIyDAU6CIiAaFAFxEJCAW6iEhAKNBFRAJCgS4iEhAKdBGRgPhfaA2xIFlwUqEAAAAASUVORK5CYII=\n"},"metadata":{"needs_background":"light"}}]},{"cell_type":"code","source":"tf.train.latest_checkpoint(checkpoint_dir)\n\nmodel = build_model(vocab_size, embedding_dim, rnn_units, batch_size=1)\n\nmodel.load_weights(tf.train.latest_checkpoint(checkpoint_dir))\n\nmodel.build(tf.TensorShape([1, None]))\n\nmodel.summary()","metadata":{"execution":{"iopub.status.busy":"2023-01-23T10:22:52.438383Z","iopub.execute_input":"2023-01-23T10:22:52.438644Z","iopub.status.idle":"2023-01-23T10:22:52.570871Z","shell.execute_reply.started":"2023-01-23T10:22:52.438609Z","shell.execute_reply":"2023-01-23T10:22:52.569391Z"},"trusted":true},"execution_count":26,"outputs":[{"name":"stdout","text":"Model: \"sequential_1\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding_1 (Embedding) (1, None, 256) 16640 \n_________________________________________________________________\ngru_1 (GRU) (1, None, 1024) 3935232 \n_________________________________________________________________\ndense_1 (Dense) (1, None, 65) 66625 \n=================================================================\nTotal params: 4,018,497\nTrainable params: 4,018,497\nNon-trainable params: 0\n_________________________________________________________________\n","output_type":"stream"}]},{"cell_type":"code","source":"model.save('model.h5')","metadata":{"execution":{"iopub.status.busy":"2023-01-23T10:22:52.572355Z","iopub.execute_input":"2023-01-23T10:22:52.572613Z","iopub.status.idle":"2023-01-23T10:22:52.644489Z","shell.execute_reply.started":"2023-01-23T10:22:52.572578Z","shell.execute_reply":"2023-01-23T10:22:52.643697Z"},"trusted":true},"execution_count":27,"outputs":[]},{"cell_type":"code","source":"model = tf.keras.models.load_model('model.h5')","metadata":{"execution":{"iopub.status.busy":"2023-01-23T10:22:52.648346Z","iopub.execute_input":"2023-01-23T10:22:52.648569Z","iopub.status.idle":"2023-01-23T10:22:52.760377Z","shell.execute_reply.started":"2023-01-23T10:22:52.648544Z","shell.execute_reply":"2023-01-23T10:22:52.758744Z"},"trusted":true},"execution_count":28,"outputs":[]},{"cell_type":"code","source":"def generate_text(model, start_string=u'ROMEO:', num_generate=1000, temperature=0.7):\n num_generate = 1000\n\n input_eval = [char2idx[s] for s in start_string]\n input_eval = tf.expand_dims(input_eval, 0)\n\n text_generated = []\n\n temperature = 0.1\n\n model.reset_states()\n for i in range(num_generate):\n predictions = model(input_eval)\n predictions = tf.squeeze(predictions, 0)\n predictions = predictions / temperature\n predicted_id = tf.random.categorical(predictions, num_samples=1)[-1,0].numpy()\n input_eval = tf.expand_dims([predicted_id], 0)\n text_generated.append(idx2char[predicted_id])\n\n return (start_string + ''.join(text_generated))","metadata":{"execution":{"iopub.status.busy":"2023-01-23T10:22:52.762097Z","iopub.execute_input":"2023-01-23T10:22:52.762461Z","iopub.status.idle":"2023-01-23T10:22:52.778389Z","shell.execute_reply.started":"2023-01-23T10:22:52.762418Z","shell.execute_reply":"2023-01-23T10:22:52.775893Z"},"trusted":true},"execution_count":29,"outputs":[]},{"cell_type":"code","source":"print(generate_text(model))","metadata":{"execution":{"iopub.status.busy":"2023-01-23T10:22:52.779708Z","iopub.execute_input":"2023-01-23T10:22:52.780045Z","iopub.status.idle":"2023-01-23T10:22:59.250032Z","shell.execute_reply.started":"2023-01-23T10:22:52.780007Z","shell.execute_reply":"2023-01-23T10:22:59.249270Z"},"trusted":true},"execution_count":30,"outputs":[{"name":"stdout","text":"ROMEO:\nO, welcome, Oxford! for thee, lords\nWith all your every name is king: then if I would not--and be gone.\n\nROMEO:\nGive me a torch: I am pale as fill the sky\nThe shederers of your daughter by your servant.\n\nCAMILLO:\nThe swifter is an answer.\n\nPOLIXENES:\nAnd this we pardon me.\n\nGLOUCESTER:\n\nKING EDWARD IV:\nNow tell me, madam, do you love the day.\nBrother, we done deeds be not a fliet, though being all too full of wretched by their hates\nOf death to my disease; carries and sleep as heaven,\nSpuke him to his rudely suffering stuff,\nThat seest it with the sword of heaven so fierce\n\nPETRUCHIO:\nWhy, there is time removed by humour with the stars:\nThere is a slave, whom we have put in prison,\nReports, the Volsces with two several powers\nAre specially to be a dishonest person?\n\nLUCIO:\n'Cucullus non facit monachum:' honest in nothing\nbut that I am not Lucentio.\n\nGREMIO:\nThe Emperor of Russia,\nWhen nights are longest the time and call it not\nUSTEL:\nNow to London, To this sin we begin to us.\n\nHENRY \n","output_type":"stream"}]}]}
\ No newline at end of file diff --git a/jsmodel/group1-shard1of4.bin b/jsmodel/group1-shard1of4.bin Binary files differindex 50f742e..e206161 100644 --- a/jsmodel/group1-shard1of4.bin +++ b/jsmodel/group1-shard1of4.bin diff --git a/jsmodel/group1-shard2of4.bin b/jsmodel/group1-shard2of4.bin Binary files differindex f60c458..3505996 100644 --- a/jsmodel/group1-shard2of4.bin +++ b/jsmodel/group1-shard2of4.bin diff --git a/jsmodel/group1-shard3of4.bin b/jsmodel/group1-shard3of4.bin Binary files differindex e682033..8613500 100644 --- a/jsmodel/group1-shard3of4.bin +++ b/jsmodel/group1-shard3of4.bin diff --git a/jsmodel/group1-shard4of4.bin b/jsmodel/group1-shard4of4.bin Binary files differBinary files differindex 200da57..e953467 100644 --- a/jsmodel/group1-shard4of4.bin +++ b/jsmodel/group1-shard4of4.bin diff --git a/web/jsmodel/group1-shard1of4.bin b/web/jsmodel/group1-shard1of4.bin Binary files differindex 50f742e..e206161 100644 --- a/web/jsmodel/group1-shard1of4.bin +++ b/web/jsmodel/group1-shard1of4.bin diff --git a/web/jsmodel/group1-shard2of4.bin b/web/jsmodel/group1-shard2of4.bin Binary files differindex f60c458..3505996 100644 --- a/web/jsmodel/group1-shard2of4.bin +++ b/web/jsmodel/group1-shard2of4.bin diff --git a/web/jsmodel/group1-shard3of4.bin b/web/jsmodel/group1-shard3of4.bin Binary files differindex e682033..8613500 100644 --- a/web/jsmodel/group1-shard3of4.bin +++ b/web/jsmodel/group1-shard3of4.bin diff --git a/web/jsmodel/group1-shard4of4.bin b/web/jsmodel/group1-shard4of4.bin Binary files differindex 200da57..e953467 100644 --- a/web/jsmodel/group1-shard4of4.bin +++ b/web/jsmodel/group1-shard4of4.bin |