09.05.2023 Views

pdfcoffee

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8

Alice, make there some that in at the shills distringulf out to the

Froge, and very mind to it were it?' the King was set telm, what's the

old all reads talking a minuse. "Where ream put find growned his so," _

you 'Fust to t

After 50 epochs of training, the model still has trouble expressing coherent thought,

but has learned to spell reasonably well. What is amazing here is that the model is

character-based and has no knowledge of words, yet it learns to spell words that

look like they might have come from the original text:

Alice Vex her," he prope of the very managed by this thill deceed. I will

ear she a much daid. "I sha?' Nets: "Woll, I should shutpelf, and now

and then, cried, How them yetains, a tround her about in a shy time, I

pashng round the sandle, droug" shrees went on what he seting that," said

Alice. "Was this will resant again. Alice stook of in a faid.' 'It's ale.

So they wentle shall kneeltie-and which herfer--the about the heald in

pum little each the UKECE P@TTRUST GITE Ever been my hever pertanced to

becristrdphariok, and your pringing that why the King as I to the King

remark, but very only all Project Grizly: thentiused about doment,' Alice

with go ould, are wayings for handsn't replied as mave about to LISTE!'

(If the UULE 'TARY-HAVE BUY DIMADEANGNE'G THING NOOT,' be this plam round

an any bar here! No, you're alard to be a good aftered of the sam--I

canon't?" said Alice. 'It's one eye of the olleations. Which saw do it

just opened hardly deat, we hastowe. 'Of coum, is tried try slowing

Generating the next character or next word in the text isn't the only thing you can

do with this sort of model. Similar models have been built to make stock price

predictions [3] or generate classical music [4]. Andrej Karpathy covers a few other

fun examples, such as generating fake Wikipedia pages, algebraic geometry proofs,

and Linux source code in his blog post [5].

The full code for this example is available in alice_text_generator.py in the

source code folder for this chapter. It can be run from the command line using the

following command:

$ python alice_text_generator.py

Our next example will show an implementation of a many-to-one network for

sentiment analysis.

[ 299 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!