In [11]:
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib import rnn  # rnn stuff temporarily in contrib, moving back to code in TF 1.1
import os
import time
import math
import numpy as np
import my_txtutils as txt
import sys

tf.set_random_seed(0)
tf.reset_default_graph()

SEQLEN = 30
BATCHSIZE = 20
ALPHABETSIZE = txt.ALPHASIZE
INTERNALSIZE = 128
NLAYERS = 1


keep_prob = 0.8    # some dropout


# Load Shakespeare Data
shakedir = "shakespeare/*.txt"
codetext, valitext, bookranges = txt.read_data_files(shakedir, validation=True)

# display some stats on the data
epoch_size = len(codetext) // (BATCHSIZE * SEQLEN)
txt.print_data_stats(len(codetext), len(valitext), epoch_size)

# DEFINE PLACEHOLDERS
keep_prob_placeholder = tf.placeholder(tf.float32, name='keep_prob')  # dropout parameter
batchsize = tf.placeholder(tf.int32, name='batchsize')


# inputs
X = tf.placeholder(tf.uint8, [None, None], name='X')    # [ BATCHSIZE, SEQLEN ]
Xo = tf.one_hot(X, ALPHABETSIZE, 1.0, 0.0)                 # [ BATCHSIZE, SEQLEN, ALPHASIZE ]

# expected outputs = same sequence shifted by 1 since we are trying to predict the next character
Y_ = tf.placeholder(tf.uint8, [None, None], name='Y_')  # [ BATCHSIZE, SEQLEN ]
Yo_ = tf.one_hot(Y_, ALPHABETSIZE, 1.0, 0.0)               # [ BATCHSIZE, SEQLEN, ALPHASIZE ]

# input state
Hin = tf.placeholder(tf.float32, [None, INTERNALSIZE*NLAYERS], name='Hin')  # [ BATCHSIZE, INTERNALSIZE * NLAYERS]

# using NLAYERS layers of GRU cells, unrolled SEQLEN=30 times
# dynamic_rnn infers SEQLEN from the size of the inputs Xo

cells = [rnn.GRUCell(INTERNALSIZE) for _ in range(NLAYERS)]

# "naive dropout" implementation
dropcells = [rnn.DropoutWrapper(cell,input_keep_prob=keep_prob_placeholder) for cell in cells]
multicell = rnn.MultiRNNCell(dropcells, state_is_tuple=False)
multicell = rnn.DropoutWrapper(multicell, output_keep_prob=keep_prob_placeholder)  # dropout for the softmax layer

Yr, H = tf.nn.dynamic_rnn(cell, Xo, dtype=tf.float32, initial_state=Hin)
# Yr: [ BATCHSIZE, SEQLEN, INTERNALSIZE ]
# H:  [ BATCHSIZE, INTERNALSIZE*NLAYERS ] # this is the last state in the sequence


# Softmax layer implementation:
# Flatten the first two dimension of the output [ BATCHSIZE, SEQLEN, ALPHASIZE ] => [ BATCHSIZE x SEQLEN, ALPHASIZE ]
# then apply softmax layer. This way, the weights and biases are shared across unrolled time steps.

W = tf.Variable(tf.random_normal([INTERNALSIZE, ALPHABETSIZE]))
B = tf.Variable(tf.random_normal([ALPHABETSIZE]))

Yflat = tf.reshape(Yr, [-1, INTERNALSIZE])    # [ BATCHSIZE x SEQLEN, INTERNALSIZE ]
Ylogits = tf.matmul(Yflat, W) + B     # [ BATCHSIZE x SEQLEN, ALPHASIZE ]

Yflat_ = tf.reshape(Yo_, [-1, ALPHABETSIZE])     # [ BATCHSIZE x SEQLEN, ALPHASIZE ]

loss = tf.nn.softmax_cross_entropy_with_logits(logits=Ylogits, labels=Yflat_)  # [ BATCHSIZE x SEQLEN ]
loss = tf.reshape(loss, [batchsize, -1])      # [ BATCHSIZE, SEQLEN ]

Yo = tf.nn.softmax(Ylogits, name='Yo')        # [ BATCHSIZE x SEQLEN, ALPHASIZE ]
Y = tf.argmax(Yo, 1)                          # [ BATCHSIZE x SEQLEN ]
Y = tf.reshape(Y, [batchsize, -1], name="Y")  # [ BATCHSIZE, SEQLEN ]

train_step = tf.train.AdamOptimizer(0.001).minimize(loss)

# stats for display
seqloss = tf.reduce_mean(loss, 1)
batchloss = tf.reduce_mean(seqloss)
accuracy = tf.reduce_mean(tf.cast(tf.equal(Y_, tf.cast(Y, tf.uint8)), tf.float32))

# for display: init the progress bar
DISPLAY_FREQ = 50
_50_BATCHES = DISPLAY_FREQ * BATCHSIZE * SEQLEN
progress = txt.Progress(DISPLAY_FREQ, size=111+2, msg="Training on next "+str(DISPLAY_FREQ)+" batches")

# init
istate = np.zeros([BATCHSIZE, INTERNALSIZE*NLAYERS])  # initial zero input state
init = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init)
step = 0

# training loop
for x, y_, epoch in txt.rnn_minibatch_sequencer(codetext, BATCHSIZE, SEQLEN, nb_epochs=2):

    # train on one minibatch
    feed_dict = {X: x, Y_: y_, Hin: istate, keep_prob_placeholder: keep_prob, batchsize: BATCHSIZE}
    _, y, ostate = sess.run([train_step, Y, H], feed_dict=feed_dict)

    # display a short text generated with the current weights and biases (every 150 batches)
    if step // 3 % _50_BATCHES == 0:
        print
        print "Generating some random text..."
        
        ry = np.array([[txt.convert_from_alphabet(ord("K"))]])
        rh = np.zeros([1, INTERNALSIZE * NLAYERS])

        for k in range(1000):
            ryo, rh = sess.run([Yo, H], feed_dict={X: ry, keep_prob_placeholder: 1.0, Hin: rh, batchsize: 1})
            rc = txt.sample_from_probabilities(ryo, topn=10 if epoch <= 1 else 2)
            sys.stdout.write(chr(txt.convert_to_alphabet(rc)))
            ry = np.array([[rc]])

        print
        print "FINISHED GENERATING RANDOM TEXT"
        print

    # display progress bar
    progress.step(reset=step % _50_BATCHES == 0)

    # loop state around
    istate = ostate
    step += BATCHSIZE * SEQLEN
    
print
print "-----FINISHED TRAINING-----"


Loading file shakespeare/various.txt
Loading file shakespeare/loverscomplaint.txt
Loading file shakespeare/asyoulikeit.txt
Loading file shakespeare/othello.txt
Loading file shakespeare/kingjohn.txt
Loading file shakespeare/2kinghenryvi.txt
Loading file shakespeare/sonnets.txt
Loading file shakespeare/merchantofvenice.txt
Loading file shakespeare/titusandronicus.txt
Loading file shakespeare/hamlet.txt
Training text size is 0.89MB with 178.29KB set aside for validation. There will be 1554 batches per epoch

Generating some random text...
IC&`!1!`k1!&191!U!W9!w99999999v9fDCD!C1C1C99991c9":DIiIE!`k!91`kkCu`UU!9!9uv9`fUf11!99D"C"u9Uc9f9D!C9DC!`uI9C19!!9`9`k```k!`U!I99D`9``U9f`119!kCf91`!k`kCUccc`!I1Ck99`!!1!999fEk11919!v99`9!U`Uk!1!`9Di`9Y1UDY9!!C99kf99uCu99v91C99D"C"9"9C9CkY"u9U!9f1C9v99111-CC!`!9u`!99uf9!D1f!9D999v!911"9D1CCCc!999c1""u9!I9DU9c9!999!Cf9999k9u"1C""DCuUI9Uf99E9kC"9uD9UD9fU9ECCCf91CCc11!U!99`9k!`9U!`19!!`UI(f9k!`YkY!II9DCc9`191U!91`9D`D!91kY19k!CU1CU!9k1!kIDC919!!u9!I!9D11!`1`k99DkYk``UI`1!C9!9`v`YIDU`fk!11U99`!99`D9!991!19"99DTUUCI`9DkcUU!``1UI`U!kfUIY!YDu!9!`D9D9kCY99vCuIU!DUU9DD"1Ik!9"99v91!D""!9!9CD999":TI9"99fI9C999u!9!99f9T999T9u!9I1D1!99D"C`C```kUk!Y1ID!911!"1kY11kYU9C99!f9C99!fC9Ck!!999911999fDk9!9!9f1991D1kCC"9!9"91kCkUUE9`Ii!D9!99`!9191k"YC"UC!!99v9`k!9!Ck1C!919"`D1DCU!1C9919"Cc9!999f9E999""D9uUUfUUk!9991C"991DC"99uUI9DfDDC9kY!k!C`k!99!9k19911!9"kDYC!999f91v!99vDCuI1!U999999991f"9999!v9f191!f1991D`!9fD9k9cf9k!9!99!C!w1D9k91!9!999D`C!9!9Cu!9"IuI9!99u919v!1"999u1UDC""CD9"""9uCC91uD199kD!k1C9
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I99DkCUCERRLENUO	LOEELII GOlltt, wihrond tous mot manedrino s al bod to mer noo ard
	As aon tha tor
	s at se  hat wil man as isll mas ond yon whe mor nced ronearndoro, ton d ain o odides nro toulst

Kseit thattea sund wllat ood me su drored wit  n lu s ble d mens aos ses mound anrofos forered theared me lo is be lond bur titordre to and ind bl aoud
	the douts the m lf he i tounrsu anr bou whar in to dean  ar ino, ta d dinrend aond the indsorede iest norr ar th mine and or be ougssitiss mour bou soullit tor
	ofserde t louerose ai it wele thanr toed se s od sorest ond torisn,
rude sr bod sor

	TEous aou me st aodif mo tur, alo tu ar tot oe  aser to weoure sain, t l lod are bood botoudo stoo whdo, wath ll oure, whtll mes bore fotus ou slll the mr arest this se my or ser mathe ar to mard thore thend miren toout in  to  aod d ins tor bea mo, aat s tlie sed and thitse indo mr
	ar iande b mo burdd
	Soul, thy sert ho dits on t is, whe sor myone in

HOLODEN	ASoter bet wid to to tot ooust irtles
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
99DUINDUECE	ESA	Th thit withive atll ar atlor cealllk howe he cane het wate an wath leas, llovene fof home purde s betlmandee,

ALINO I I llvesthe to the thel this bedrstin t bou pot me toulllo withe a singglly seatt,
Theat oulll sise, I the whou merl mirse wing le ail ancisthither ane sor mas ta dof wachatlllingstlof llan she mand tim my at my ur be songlith if ans love shthe masisting le solly,
	A sacllon.

RLASO	Whit sig to das ir t be aicloveingly inet oll asteed au l ande fard
	Sin chamed.

CERLAND	Tha wham stirld me mase, wie tat storien late tol wathes fome aiglled tis mo cont aice wit ondone poriggand tho sise mo andigloved sulllas atle wroud at ie shate withit, he livende shave pretathil fowall, augh thas ind mind fane paiste pithesseive chor thore ffaller, allks, lert thesto metsto sand to mised thot thais my shat have tarlled ane andeard mat of thert th him thad.,

	LiE, Ian th we whrer, al thit bued at shinglis deer beat mong lo meen tow to d alitse fing pirt that in there
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
9!`k ICHckigh wo tards walsthesedy way hirsh ith une there, ave ard.
The  has, ardy shis,'d sis fillondien sillles, these wills af on s aris the helsit wimes at an willen tooundeads.

Thet warthe sow thoul forrenidg iver, will fal make sarad, sheringe sinos hyou sallig t womy the d anth y unghed, and wen my a dorne whind hond me sord, in seaddise.

TURIA	Whay. 
	Oot thor ses w on hy tlears ais ase nofred sie stan whes ther arad forthen sasl medothyeng sean the shealf saleen; werow hear, hus hathente selongeas feroulss andst hest hres and has fold dust leat th mass ale, shead saly hid hithe hise as and sires
	Thee for dowhis arl,is to te le aus, maylur, her tondy sies ared my shandss meaked sule'sins and aing is ald, be thaly, I lo s me nowe mo this se the se weald sous wher tishis sarcke thou hireds ning, wend halis tht shel, wiren, forsu mf theastensore fit he co hir myour seas serseat sede, alllo, thas fare fired anching ande, and yrury ay takirs, an are anade sounstandy urar ates sp
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
`k!`
	FFZOrncclimmages,
	A am thourde s that hare colls anded wand t of menthas iver mardy shem aris my ther cadenstain werd; beer.

KINRESINGO	Willly forr madre that hement, to btore ffall
	I and on the tor m ofer swill y, mince tea thy have hine hase wiom.

STENIN	Heen trer twit on has one,
	I love wist om sur shand oo sherengres,
	heng roucomy.

ARTURE	Un that wor heats of th menes;

	OT me wort remenrting in buld sourd sh at ind chat auril.

	[Exit
	And hit om ith to same.

	Shom I chis clot hadle hes drowe doris,
	And burtand;
	And sherdor wion: satte croo ders,
CORDK	AND as leve th
	If llathe mone has mee will of wor with bofromes, hat the hery hear; tow ms himy,
CE
	Th up ave tit im shat is,
	HE was tho sere.

IA	The sto surcerish aicknore dodiston dowist west me meale prow whlt youn seat of an wothe pravend.

TEMURKIIUS	Yow ou thar to hat hisper, in the wishe s arking wor wnan ckntighas beitht yours:
	Th merdear thute thed frout sors
	Ang at mires ar trye on and oup thy htod ma
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I9DGES	Wait have tyou have sache pange bust ont
	That tho shy th he ay thee for that hay seely,
	Thea frather you sull.
	Ind and
	That and the blot hos the pour bile boot my, ain thy le sancensor wrast why sofele says,
	Sither peard still stertin tyee bour telle weat a ale then theed ato thene they may,


	The  I as an wate thet yould weld;
Therstofr and
	Or sure the wicher ave nierthy,
	Thy manglas: at somy seeareare fill hit alle,
When the teringhous
	Lor casenstine sishy steentirensenofee,
	Thtin te harde thy sor andseranded,
	Thare that hall the felllive tis the peayd of her him ar hean is samy
	hig the he teang s ave sare.
	An teallongst,
Thas mareatheen will ar ound yor ait dove ptor the wore.

	And lire hay stand ista thy she f ch and handse the she ay learll.


TUFNKCENGLIAG	Whtune, tho fatlen yougnt ath yell the my mou har atle seast at incedrast me will spprief
	The preetht y shick owe thoug, theed hes is th thy wally the hatis thau hte be the pallys. wordsing bat th thind m
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I9GL'G ETIRY	Whro, wny mese or mard ofearn,
	And you watce:

	[Tett I  I den the rofl and your thrererid;
	But, lo se a to head,
	Tid th my her st of m oree hat the concene hillld miss
	Tor far me cuise,
	I hore sould whot wer mothe thour thee tem spoff in them tit tere tour the day he witht an huseres; noll.

TAUS	And it ir aven this in helland youly tours malle they, I'swer twere, firndeer bree tee wher thy dely, a sialt oncous iow thor my nimugrthith,
	I hat on whe tour ther buth,
	That this fam on tine ame.

	[Entir wo ly hise trot, the tle frim to wirt, whe wille his thy brove bom thes the cumy
	I wall the somm sele they liet:
	Thall hand thie for chy loowe did tom meer tid wally, thy with yout list yore, wrod faty liss wrot the cullly tornos thinche, asd my shust tor ming tee thy mengen tarcelo fure thaly wo were shad wot, sporotent
	That to now the ptort the dove roved sulitht lowhel, and ole the wart, his chell'd whar ho wirt weld thy thysur ans the tiers th withe ster whall.


FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I	TIUch, my dustald forn,
	Be on wo ceril the came,
	Tut and he will dos to st a d ou day, fith shongst
	Bet me sperd tore conowny shourd, woll be of trun,
	The spoos deree. and and out;
That and sten to fore: wire ar is thy
	Incing illy and dinglond mene, tous dearner.

SITUB SALONEN	That she de shis cead, he then a she dong the stes the not ded.

TAUS	Thos of on mimn tot hase,
	And aro thit hit to moun,
	Whure wath thy gomise. my for heth nello,
BAttone humpent of our not minse, andye and witl he whou.

	[Enter sto shel of a mones,
And arilest noo fown thes and, maner whon, to dono wish heal, siof his;
	The hom hate hen, lost hase trou don.

CESILINUS	Wilf ald hear no hard thour with weid!

L[ATUE IAGOTETIT	Whom thou to shilf s of will
you fore willd hthe derdede have the fome htand diet
I'll be w il noth.

SANIO	I]

BUS	The sere on wors, hond dile s a mmen tontien. will the mand disther. and he wall this cangingay.

ITASD	Andor the sim how the thate hase had,
	And this theringis of 
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
IGO]U
	S|AS, As is oul sig the the chine in treain to sure ctenit,
	Han hin grond a mose she saning stea ins ase the comes
	Bet nightithou, thar ghat as bot,
	A mane, thin sith om hear man bot an yound davir stane boredse meachan,
The parted thy aight by toughon of or in in seres;
	IThand way the tam and of of theed ato hourend.

LIANI
	Whar hent to a sing and or are soup ise phat
	He shain bastade oreand dostigess corale bo heart of heresion.

	Wetlle im not har simy to bo ner be tilese foughe fat an the preasteer.

LICUSSAnd, in thas cim thoule s al your have hane shess.
	Whan anes thes ant mpeaning of and show harcing as in beren amos and is in the shall
	Wirl, If what I say, gavess bugh swy hightr o anames of hour the alyou,
	Whain so pance patimen sordout hat his deathinds note in.

ICUS	Wo lark, ala murd thos blite blood sued.

SMELLIANDRO	That she parse an yous thing it sie seath, thise ince,
	But hed mo now lave or and mood, the death
	Whatha gote. a farcel il of and of hereds 
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
! DUMER	NZOur there and brued bead
	Torsion oul mikenoled bofeng, theick,
	Hoven, in my sure fou a dound swor thinglo there mary
	Theat bo thas a bongaight offils; more forcout hear oo for
	For the hould and ane in of thy heres mist the full and
	Ino my ag on mosh then soon the fee moke miness.
	Him spee s my praves: weine bofer ig mo hid briand.
	Buepad, the kill where fill I so my whe to a woon thin ana ither andiciors
	The der of year hy bent of muce.

IAGO	Indo my have to heres is and forrown that heen suck?
Thar conese of then of onor by theie,
	Whal is im migringin ond stelough hin dom herse.
	Toor's to sark woll ond my bleases: to shourd, mo nom
	I came one, wom the wame:)

ARONIO	Leakenot I sempens afly sor my poord mouress.

DoKING JAQUEN	Yrupes, be poret of thesest ald bende
	Tion in as ar hte helled till thr eapon.
	But and bet thou men my frell wo highinst mart, It wiclly, anl benthis therest to lot ald heme;
I have I and in these fot I dos brovesthithinge
	Thee a draith on
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
!`Duk	Howhens;
	Thereartun's lotane wial.
	Youk, I thy lother. Dedomed that mondur, and thy comess,
	Mare, or hard thail home to nowers,
	And of these't luck in a ald peist they farit do but is and
	But woor sordains have my have,
What selld weard wos and a despeecay
	And heel hay of mokn full be and wite: my waul.

DUK	He to lfor a mare, and of ill in tollow,
	Ty tommer shan or of thiter is mandele mo the ray?

BUSATA	Shain a are, hem I had niss looke.
	Withen in alothich ithire. LUSHYLOUCESTAR	Aas, in that muncare, thinke,
	O, the hurloting of yound,
	Yours on thy gaved in, speery fich,
	By lood dears the wither offerite:
	Wer haind stay, I mmeat sie must lirs to allitite;
	Wither hire ancreacimst of ateach, swamy nomen, govery,
	That thy gordoot to not oncllather be thare wath mutan.

BASSALO	That sump is have murt a hreen thanced
	Buckent thou wall. I am ale way in a fathour's amm
	That I sore, a for hom hing,
	I will he hat atthe priam of is in ir hen
	Wht live are trourned: with 
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
II0, IL I I laves. mpording bund
	Whol hale whou alls home, I shall to thee spay bothal;
	I hemperd, bruch bulist may have wead dightel of orten ounde.

SITIARONDI	Ay, I wonlld pear and han mosell wood
	But in are moner, the compang it will aglakn waun
	How howed ont him are thuce. sighir hay noblard of toung.

OTHELLLO, VESDENICE	Sul, bigano in me buthing;
	Fillod othenso dading our for o herefit, the eed and ablly.

	[Entuner to merount ments, teen tom of thing to spellys,
	Woll'd he faily tay benour theer
	To a dowe, and mut, and out is buin,
	I will bretand your wills with be whrade on so homest,
	With spook and thou sublither byon seng, and of that lord
	Hame nit old sheary.

IAGO	A lave thy sompids not leep sees in age and hoppan mither.

CASDORIN	What, to sowill bence foon thyee will.

CETII.

	I thouk byuther, and miglest nith wink. Howrell wink's my not
	Butingee formy; frother hend, not toury forse, and bo harne to half
	thir wind.
CEnI go brumblioun'd toune my scaine hord an
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
	9vit he, shil
	Andongrive of and my
	theil spoor my llake,
BE trmincores the meckeet hea, bo faser'd frim to as trught.

PHENZO	I word in the mare? of forliture;
	And ald with se peaces the myold truge owe this food in wait
	to sorentisin's agam he are the sheaced on yours.
	This take anathruse breat on the door our waur
	And whuls as wat wwild;
	Marken as is a the fay mightrand blessen thions, semblore fille,
	And mall is thyee farmse a brood,
	And me in thime and me to and you heredont.

RESELIA	By shem to but what so tome a beatton' a mastelt,
I as at is flot to lees in witle thould to my,
And mstithy at hancon or berion,
	Tor wo hen the privice is not aname hare the me thath whon,
	Andon brace, besorngan's broughing it
	Whe soll wo thouss troy?
	Seispon'd mithare of the cooth sigh as in ore.

TAUBIAGO	Hear he seen anceraning to thee to the cruck mould: form,
	Se ceider my ween a frothtere, would frell' my neemiles ber manch
	Most a welate's a merater are it my blyol?
	So sie no fo
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I	Way'd fite here
	But the sitines ted his nove atrert you hemon with a did is and
	He tory be steerers dive mishers,
	Than wello be ar mention is pillest by muter,
	By llyse strunstr sare, I daugh to sart bently mysele?
	Whom some to sered of sor he brind.
	You arm when drey.

ROCASIN	O, thou mudy diding,

SILIAUS have I cunter will bus; and thay dreed bwind a but the
	It mu andottar' lostere in well, not,
	Whry wad and werts in thou do poos ofred to such the theit shall stelt:
	I peare it bud bed mush mitht.
	You tord,--per woul nsomen dige, thims wreet himentore.

CARDICO, a farth, mady tand hen would scome.
Why surndided be net more fort wered,
	That me me mith me thee, no gut a dome inte swolad hever.

DEWICHET	A to, wetls weltiduet to selly hind;
That heves my lote.

	[Exeung MERGKE MERESTARO	As son whal firentelt spees it his lides will?

DESSANDERID	Shere sur pleasse as hores.
	That him wored! in prome not Indis all the cutrng with all beay.

	[Enter]
 O	Lort wat with herover m
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I	NI If aly waup,
	We mont hes laven's ale nage he speatty hind: for thath;
	Hathy of here de in you wandery a stack of yet?

Then I houp it tho grove a clayf, berdy, both wour, ho touthan.

PORTANA	[Dusionco, if in wost to bere, now, that bastay
	Of fairun, to to here sere hin;
	This ablotion a cimply:--lake,: but thee wicl.

	[liekn thearing in batter thy hear.

AQUERIIN	Sheapon'd for som in thisk that be bustayou,
	Then of all there my swill thre fairn thich ale the coon,
	Or atast not tale and with mine, and wort;
	Mer sore the wighiflis hare have her ond
	And here bust, we loveds thee wonds, he winder here,
I samy twere it ate see thee swar holothod thee frive:
	Ay, beidife home all to kingent be chater ateress: my my lead;
	Withe hear on my: thenefouth he reaged.

To IAGLO	A my lose, supprorn but frough oon of are;
	Aspy such he wind the dry wist blover's but not thou bay
	Butcher a writs of the evill a dinds.

KING HENRYIN
	All the eart sand hear not for ond to thengen in ploun

FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
EE	IG pave thy ming madeen
	Shall's thims, wet so laving thee theee wildss,
	If my loode, be om hee the wimm,
	Him and in beest ploct his hoube, a gow dake, he dasele; and your hath
	Thy wase a heard will ase and beathing thank and hin are ham,
	A gone, not may, you duld you this brow sord, be shealted mearud
	Becoins, chouplone in theilf himagatious as and the sance
	I have wlath, a may inds teringe. O frell's tye cis;
	Fienot of hompune if the king.

CESBEMA	A by frient are and hise swee bounter am that bere.
Hencestert on ther with he trouser in agien.

TOUCELING A	Doven my agading hive to hin thaught wifeless:
	Tusile breadaning make and hearunts: thy clamper.
	Ther, he hearin's his dearth all thean bersersong ef comest shelfe,
	On, hear them boun a grion meseave tompeling:

That my lother bead wher, I have that thould to down other me confooters,
	Is a bound shom, will am irnothert whally age abow you pleate

SALING And Some our that bimy wall had bes stain
	Tir are and to bowore 
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
inngul;
And such is to timess. I prow and for meel,
Tinst of mester'd hate say the witly, men sere,
	But mis that sood had brivir alt and then their get; the boous.
	Well wo love this hast the will sered hid have they with myeade
	They forlden, his deep in the fall nath ang it; tid a speet
	Why beart sund, armay,
	The fom wood I wo love a full fur mus and hath and whe hid say
	Thes fill my speas heavout a fuch thes,
	Won howen that some say, and to to the bate thal for

IAGO	Het the with that I alt of call fith mast of my lows.

BRENETA	I stank, hor deat to nair a hand on hours my lowd?

CXXXII.

ORTIA	O, y urpony they laggue this bead;
	Tho clonting has me meres all of this are the have.
	Nor mande to the sace the mors in than makn;
	That fouch tas, thou mane thou dist to thy mars an pay wreme the sir.

LIANO	O, from dis, in the cut fam ale my mard
	I  will is dead ne condot shees of in thou hath said.

PEMINA	Andow your thos we bris irseds applecto.

SALIA	And stord.  fre trey her, w
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
I	Why furtong in brother the hur,
	Hawnon hoplese then thou aslait and of that why, and me, all and cantentor
	Bownot morased for owh light is tree and his;
ThMOLI'd moty this secture so, manis.

OTHELLO	I curtay strucher troncourdiclds wind.
	Searter then ast in that to marsurnich,
	Tostand birs in warking a swears, whath himesting, in mectarion all art for
And of thou broubart,-lyse.

OTHELLO	Why, I love't wis in herrestare dace more's dear are hee

	That shrisenter freenour to my them as I pansither, what my tool
I' wo him or ass, in the sefticl caur the withich,
	Trather hirn ophounds ast his sight cooph, mantime, that meass:
I' hin I lad I purs crincl, and his home than amainss has of mere of face
	Way, ham that I and morese mere whome more
	Then the surt, liver froils affelt.

JAQUES	That fore o teen atricils for sweel bren comeseds a pare
	And have that my fore what hour asseck of there creave.

JAQUES	and drance in blooks arvelt to comentst charedire?
	And my and him shall beti
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
icknicch.
	If shill is almate a stand, be of thou whoce maule a cunerter and so mace,
	Forty oncissere this calet and beak say's fallor'd my
	tain buckind hadoul biciles tall an a allate,
O  ARINA, and thou geisling, baturest take turst most,
	I, that strince his dow I did where by burt will spook wo them.

TITUS ANDRONICU]


	A  IT I  I  BiR Sear, what he they think in oubart my
	badanter. Or mone, to my
	That trown tleatt, nob thou as thome,
	The beat anot hat heneyst to me but bead,
	As thought of subut to home beatien metersor shour dither that
	To that I to the caurseroves may;
	Be to all me htid, now, shall, he the doothy welt is calt beat,
	There out the dosile's ator'd allan time a counted; that wat thisk,
	Shalf am mint when a faumsting and mead waid nim,
	Where, bo this hur of the counts of tyee fait thus a peass
	Art, a goont to and blyed all tere,
	Suce, I am west what those a fothing mery more a trought?

	[Enter this curpor of is is there by swiet a mo,
	To to dose. O, f
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
ike!
	IThen hast now, and so waund,
Mons when sumald but hand hears hose of. O,
LONDEve I seen ling and thou suse;
Byan of much must old, tone athendose as to do wo see

	[Exitut of Shill our sagain thee wilis to you manter,
	And shownot tull what thou asay have in hid my heath,
	The day and wo sang wher will as me all you, be and agily me not sure
	And have to haves as sweet of menars;
	And herell' meth midruchore, so desed will at thee sheed wich to berd.
	Bussen we this hen shose beantower more hempens onvents
	That sheetseefor your onen self, I so and the
	To the rest are their to thou herefome hime;
	And whan that homs of ar thie sweeld.

IAGO	Wauchore.
	Of my are heals of thee beard, and allonion you and ambang to lave so weach.

OTHELLO	Whllestity he shound whenstered;
	The eave me ser at a to so do dedace?
	Thour bearding is wrunds hall bown and of makest sweet,
This to the reather, I wander a withing;
	Fir heave some trould there andine and in trinklin.

SITUE RONITUS RISDEMIG
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================
Generating some random text...
9I	Thathe, I diself, alt;
	In a these hall neven.'
Than the weat weich thy fairyst anay,
	Shoperifanif, have thee my plecer, in
	Thick have heaves taing thyee; Is
	Thy firse then that fothert a steers
	Aspove thou cilfucked of head
	Is hand have the washing of mory sout,
	And it for sumperas sighingly so.

CUSAR	Beading haves my my lood we chiresenof,
	And sour simpure as moreso'ling of the sifes,
	I like with see, be more sonthe
	As ore booth, the would have by shell.

OTHELLO	That I at as the heves o succe of swees,
	And perolian, shall in that in thy saifents.

	I cull fell me wis made mer mould, and plains of fliens me seap,
	This thou am heaving so well'n of cloore.

	And shath on the wife whick hous, a soncrost to dee,
	Beet as she passeathe my but weash of the cless
	All the desenge, handerin, a sace as my llath arder
	The rayfur whelf free tyee.

OLINGLO]



	[ESIONE Shelt of the dead; wirst triefes myss
	To words, thus, but, ashart frother subthy lurse werither sut,
	Thou mast
FINISHED GENERATING RANDOM TEXT

()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
=================================================================================================================()
0%                                        Training on next 50 batches                                        100%
==================
-----FINISHED TRAINING-----