complex small world

どうしようもない日々の追想

RNN 調査 ver1.2

各ステップの解説

load_dataメソッド

  • 文字のスクリプトデータを読み込む
  • スクリプトデータを文字やスペースなどの1文字単位で切り出す words=list(words)
  • 文字数分の多次元配列の入れ物datasetを確保
  • datasetには単語を出現順番idに変換して登録
  • そこでvocabには新しい単語を登録
  • つまり学習で用いるvocab.binは、学習データ内に出現した文字のリスト
  • また学習するデータセットのdatasetは、文字リストのid番号に変換された文書

なるほど、そういや言語認識って古くからそんな感じだったっけ・・ 実際にシェイクスピアのvocab.binのサイズは65、全データサイズ(コーパスサイズ)は1115394。それならRNNのユニット数でデフォルトで128ですが、65とかでもいいのでは?


そういうことでUnit数は65でやってみた。

Stopely of with the vowers not of than as was
Petian from cause, here I his seathes?

Firsgow:
And ads fondation.

LEFDIS:
Hath was I'll we funshand, many all for acwall.
No, sir, sister
Hath himself sables are of preasome?

MERCUTIO:
You injure's mend the
ridsber it denief comins us.
Your pleasures, since the peacures I softime;
The mose.

ANTIGONUS:
Mercy the matter that was back wonst be froward;
To corrember to devon;
And so well, well by dished? is Warwick.

VINCEG OF MARGA:
Well,
Heighmons kill Claudon come cover thou beseep,
I do forth, that the heast is weep; I much, and paren
Battering.

LEONTES:
Could Hangly he with hill shall law to be the
threp, and impost unkind laws for pubned.

FLOROZES:
A, residented best thou tongue, and he then make again;
I'll virth, attembless and defending thee.

QUEEN ELIZABETH:
Your friar, and treasunement malens as you time thou doward.

WARWICK:
Sir! Thou afthallower on will:
With city, one unoss, Jumietiondel, come of you.

First Henry:
Your son, it will lights accounts Possity.
The house, this us is outhing his imp'd just
spirate on storce proftiended to masters, us for cust,
Do Lucenter's roege, I may reignish some striins of her;
I must be the big out shall concommand;
Ere thou till so to you, my lord, good much.'

LADY CARSET:
Who you to must with his pain rick in:
He is did that abolable to burrage
But bares, be proud him. Think's think.

Praver:
And thou, peryingfo, 'tis Caduuties all;
This curish me on King contrament of thy pray
Me honest what onledeng: fair the falful his stot hillown
A knenches: what throve an quock on your latume
As these prove you hath the viol what you call
A grash motherward sir.

BRADECURT:
I' what now us inknrectes me air modest, touch hef,
To that in't: so maid it show my franter is
Coudgeth brash-now 'tis the speeton:
Pove King my child you, he stay here's work;
'Tis on propernen out.

ROREA:
Rome?' Go, is it donate! and, you palse, marshal wind
I so dreawauge diverite you, not you hold, 

確かにあまり変わらないような。ただモデルのサイズが6.3MBだったのが1.7MBになりました。学習も速くなってます。 以下はSeq_lengthが50であるところを5にして実験。うーん対して変わらないような。これは一体どういうことだ?

wink by the seasten vant to your councation.

QUEEN MARGARET:
Nast sail years and flair of.
But new as thou will of cight of, and than from the maid.
Was save wast him, mow.

CAMILLO:
Tind the roinners Passon upon fred fle.

LUCIO:
This?

Fill our life thee thile to the indrothifity again me?
Have instruct the wound or bring
Furderer untuppartious be so speak.

POMPEY:
O, 'twis!
In ours the other they have flain to dever;
Sypeties brother inot to falsird's charks proce! lives your word!

FLORIZEL:
He fard,
And be angranten improotuaate him: afterns
and year otch on behold;
Thou shall with disca,
Wherein naiton's
behase to thy mogest'd
From the burious brother,
Big the moother'd strong must be
Faither canwer, infordet; so, fond the power'd take him made's through
The Padest gave to confess widow Tybalt; and
lie.

DUKE OF AUMERLE:
I beting my bedown,
Nor heart friends, his my past to she gree.
,he turn.
Nay, in theik night her have live stank to years
Reweforen
For me it to breep and in onotsed
for me?

First Sneribuestenat, thou fault,s,
Or seen, his, mistile-kight at sea with silst the strick.

BINCIO:
With the send natly,
Jeuced go rash monaled iningiin remains sin
From him you! I be thee! He vastague friend,
And brother wishers need seasuath over;
Oning ho! you not indort me a matter; a wread, nature
Could I, I fielding my fall, but they
Cractize my soe.
He come not?

GLOUCESTER:
What, but the lord. The shipt, give ear have the goldeds in tidy more floweral newbers:
North will pity: the chaughthing but 'tis death!
Then reside asleed enemy of him fool.

:han:
We--
The sworns, ballentis the mornaced in viction
To liven, he have deputy branablount frish,
And lights whime joyful stillanched war
Or danger,
A should beauty when Rome. Wouls stone; that that worst take, thou livather's fitch
we stay bloptible; Noth's eye
Which tell him boy common in the earth.
Was, gainsio with exur's first and bellinge?

KING EDWARD IV:
It should course for they stite
Brance than you he