Upgrade to Pro — share decks privately, control downloads, hide ads and more …

EMNLP2018読み会 - Speed Reading: Learning to Read ...

y_yammt
December 09, 2018
1.6k

EMNLP2018読み会 - Speed Reading: Learning to Read ForBackward via Shuttle

y_yammt

December 09, 2018
Tweet

Transcript

  1. ൃදͷߏ੒ • લఏ: • ࿦จதͰऔΓѻ͍ͬͯΔλεΫ • ී௨ͷLSTM(Vanilla LSTM)ͰͷϞσϧԽ • ఏҊख๏:

    • χϡʔϥϧωοτϫʔΫͷߏ଄ • ύϥϝʔλߋ৽ͷ֓ཁ • ࣮ݧ: • ݁Ռ 3
  2. ࿦จதͰऔΓѻ͍ͬͯΔλεΫ • ςΩετΛೖྗͱ͠ɺ༩͑ΒΕͨީิͷத͔Βਖ਼͍͠΋ͷ Λબ୒͢Δɻ 1. ײ৘෼ੳ (ϙδωΨ൑ఆ) 2. χϡʔεهࣄ෼ྨ 3.

    ۭॴิॆ • ࣍ϖʔδʹ֤λεΫͷྫΛࣔ͠·͢ɻ • จॻͷҰ෦ΛಡΉ͚ͩͰ΋ճ౴Ͱ͖ͦ͏ͩͱ͍͏ײ֮Λ ͔ͭΜͰ͍͚ͨͩΕ͹ͱࢥ͍·͢ɻ 5 બ୒͢Δީิ͕ͲͷࣄྫͰ΋ಉ͡ (Ϋϥε෼ྨ) બ୒͢Δީิ͕ࣄྫ͝ͱʹมΘΔ
  3. ײ৘෼ੳ (ϙδωΨ൑ఆ) • өըͷϨϏϡʔจΛݩʹPositive, NegativeΛ൑ఆ 6 Lars Von Triers Europa

    is an extremely good film. How's that? Von Trier has a very stylized way to tell a story, at least he did have with Europa. To me the whole film was like an experience even if I did see it on a small television screen. Even with all the tricks, in my opinion, this film is the most complete, REAL and moving piece of cinema then most of the films on the top 250 list. I also think it is perhaps the scariest, the most gothic and complete film around. All right there are other good ones too, but this one is my favorite. The final scene is one of the most harrowing scenes ever. (*) ϨϏϡʔจॻ͸ IMDB dataset ͷ 107_10.txt ΑΓҾ༻
 http://ai.stanford.edu/~amaas/data/sentiment/index.html Positive
  4. χϡʔεهࣄ෼ྨ • χϡʔεهࣄΛݩʹτϐοΫ(ࠃࡍ, εϙʔπ, Ϗδωε, Պֶٕज़) Λ൑ఆ • ར༻͍ͯ͠Δσʔληοτ(AG Dataset)ͷΞϊςʔγϣϯͰ͸


    ෳ਺τϐοΫΛׂΓ౰ͯΔ͜ͱ͸͍ͯ͠ͳ͍ɻ
 (ͭ·Γଟϥϕϧ໰୊Ͱ͸ͳ͍) 7 Enterprise Security Adobe Patches Acrobat Vulnerabilities Adobe has issued a patch for Acrobat Reader to correct a vulnerability that could allow an atacker to take over a user #39;s system with an infected PDF file. Պֶٕज़ (*) χϡʔεهࣄ͸ mhjabreel/CharCNN ʹ͋Δσʔληοτ͔ΒҾ༻ https://github.com/mhjabreel/CharCNN
  5. ۭॴิॆ • จॻ, ࣭໰, ճ౴ީิΛݩʹద੾ͳճ౴Λબ୒ 8 … 5 `` Thank

    you , " said Alice , `` it 's very interesting . 6 I never knew so much about a whiting before . " 7 `` I can tell you more than that , if you like , " said the Gryphon . 8 `` Do you know why it 's called a whiting ? " 9 `` I never thought about it , " said Alice . 10 `` Why ? “ 11 `` IT DOES THE BOOTS AND SHOES . ‘ 12 the Gryphon replied very solemnly . 13 Alice was thoroughly puzzled . … Query: `` Boots and shoes under the sea , " the XXXXX went on in a deep voice , `` are done with a whiting ". Candidates: Alice|BOOTS|Gryphon|SHOES|answer|fall|mouths|tone|way|whiting Gryphon (*) https://research.fb.com/downloads/babi/
  6. LSTMΛ͓ܰ͘͞Β͍ 10 ht , ct = LSTM(xt , ht−1 ,

    ct−1 ) xt ∈ ℝd×1 ht ∈ ℝh×1 ct ∈ ℝh×1 it = σ(Wii xt + bii + Whi ht−1 + bhi ) ft = σ(Wif xt + bif + Whf ht−1 + bhf ) gt = tanh(Wig xt + big + Whg ht−1 + bhg ) ot = σ(Wio xt + bio + Who ht−1 + bho ) ct = ft ∘ ct−1 + it ∘ gt ht = ot ∘ tanh(ct ) -45. xt ht−1 ct−1 ht ct torch.nn.LSTMCellͰॻ͔Ε͍ͯΔఆٛΛ WikipediaͷLSTMͷϖʔδʹ߹Θͤͯॻ͖௚ͨ͠ Wii ∈ ℝh×d, Wif ∈ ℝh×d, Wig ∈ ℝh×d, Wio ∈ ℝh×d bii ∈ ℝh×1, bif ∈ ℝh×1, big ∈ ℝh×1, bio ∈ ℝh×1 Whi ∈ ℝh×h, Whf ∈ ℝh×h, Whg ∈ ℝh×h, Who ∈ ℝh×h bhi ∈ ℝh×1, bhf ∈ ℝh×1, bhg ∈ ℝh×1, bho ∈ ℝh×1 t࣌఺ͷೖྗ t࣌఺ͷӅΕঢ়ଶ t࣌఺ͷηϧঢ়ଶ ୯७RNNϢχοτΛվྑͯ͠௕ظґଘΛֶशͰ͖ΔΑ͏ʹͨ͠΋ͷ
  7. ී௨ͷLSTMͰͷϞσϧԽ (Ϋϥε෼ྨฤ) 11 Lars Von Triers Europa is an extremely

    good film. … The final scene is one of the most harrowing scenes ever. -45. h0 Lars -45. Von … -45. ever -45. . softmax(Wh0 ) W ∈ ℝ2×h Positive, Negative ͷ2Ϋϥε Positive ຤ඌͷӅΕঢ়ଶΛઢܗม׵ͯ͠SoftmaxΛ͔͚Ε͹Α͍ɻ
  8. ී௨ͷLSTMͰͷϞσϧԽ (ۭॴิॆฤ) 12 … 7 `` I can tell you

    more than that , if you like , " said the Gryphon . 8 `` Do you know why it 's called a whiting ? " … Query: `` Boots and shoes under the sea , " the XXXXX went on in a deep voice , `` are done with a whiting ". Candidates: Alice|BOOTS|Gryphon|SHOES|answer|fall|mouths|tone|way|whiting Gryphon • จॻͱQueryΛ࿈݁ͨ͠΋ͷΛೖྗͱ͢Δɻ • ӅΕঢ়ଶΛ୯ޠຒΊࠐΈϕΫτϧͷۭؒʹઢܗม׵ͯ͠ɺ΋ͬͱ΋͍ۙީิΛ બ୒͢Δɻ -45. h0 … -45. -45. softmax(CWh0 ) ∈ ℝ10 C ∈ ℝ10×d 10ݸͷճ౴ީิͷ୯ޠຒΊࠐΈϕΫτϧΛฒ΂ͨ΋ͷ
  9. ԿΛ͢Δ΋ͷ͔? • ͻͱ͜ͱͰݴ͏ͱʮಡΈඈ͹͠ɺಡΈฦ͕͠Ͱ͖ΔLSTMʯɻ • ಡΈඈ͹͠Ͱ(ಡΈͷ)ޮ཰ੑΛ࣮ݱ͠ɺ • ಡΈฦ͠Ͱམͱͨ͠৘ใΛऔΓ໭ͦ͏ͱ͢Δ • LSTMͷӅΕঢ়ଶΛར༻ͯ͠ɺͲΕ͚ͩτʔΫϯ(=୯ޠ or

    จࣈ or จ)Λ
 ಡΈඈ͹͢(or ಡΈฦ͢)͔ΛܾΊΔɻ 14 -45. xt ht−1 ct−1 ht ct softmax(Ws ht ) ͜ͷΑ͏ͳsoftmaxΛ༻ҙ͢Ε͹ಡΈඈ͹͠ɺ ಡΈฦ͠ͷࢦࣔΛग़͢͜ͱ͕Ͱ͖Δɻ
 (Ws ͷߦྻαΠζ͸ޙͰࣔ͢)
  10. ه߸ͷఆٛ • N: ಡΈඈ͹͠/ಡΈฦ͠ΛԿճڐ͔͢ • R: ಡΈඈ͹͠/ಡΈฦ͢͠ΔલʹԿτʔΫϯ(ॱํ޲ʹ)ಡΈࠐΉ͔ • K: ࠷େԿτʔΫϯඈ͹͔͢

    • ޙΖʹKτʔΫϯɺલKτʔΫϯͣΒ͢͜ͱ͕Ͱ͖Δɻ • ͞ΒʹɺͣΒ͞ͳ͍ͱ͍͏બ୒ࢶ΋ೖΕΔ(ಡΈࠐΈऴྃΛද͢)ͱɺ2K+1௨Γ
 ͷಡΈඈ͹͠ɺಡΈฦ͠ࢦ͕ࣔ͋Γ͑Δɻ 15 -45. xt ht−1 ct−1 ht ct softmax(Ws ht ) Ws ∈ ℝ(2K+1)×h
  11. ಡΈฦ͠ʹ͍ͭͯͷิ଍ • N: ಡΈඈ͹͠/ಡΈฦ͠ΛԿճڐ͔͢ • R: ಡΈඈ͹͠/ಡΈฦ͢͠ΔલʹԿτʔΫϯ(ॱํ޲ʹ)ಡΈࠐΉ͔ • K: ࠷େԿτʔΫϯඈ͹͔͢

    16 R=2, K = 10ͷ৔߹ (ਤ͸࿦จ Figure 1͔ΒҾ༻) • softmaxͰಘΒΕͨಡΈฦ͠ͷτʔΫϯ਺ + R ͨ͠τʔΫϯ਺Λ໭͢
 (Լਤͷ -3 ͷ෦෼Λࢀর) • ಉ͡ͱ͜ΖΛԿ౓΋ಡ·ͤͳ͍Α͏ʹ͢ΔͨΊ? • ઌ಄ΑΓલʹ໭͞ͳ͍ͱ͍͚ͳ͍৔߹͸Ͳ͏͢ΔͷͩΖ͏?
 ઌ಄͔Β࢝ΊΔ͜ͱʹ͢Δͷ͔ͳ?
  12. τʔΫϯಡΈࠐΈͷऴྃ৚݅ • N: ಡΈඈ͹͠/ಡΈฦ͠ΛԿճڐ͔͢ • R: ಡΈඈ͹͠/ಡΈฦ͢͠ΔલʹԿτʔΫϯ(ॱํ޲ʹ)ಡΈࠐΉ͔ • K: ࠷େԿτʔΫϯඈ͹͔͢

    17 • ҎԼͷͲΕ͔ɻ • softmaxͰ0ͱग़ྗ͞Εͨɻ • ಡΈඈ͹͠/ಡΈฦ͠ճ਺͕NΛ௒͑ͨɻ • ࠷ޙͷτʔΫϯʹ౸ୡͨ͠ɻ • ౸ୡ͔ͯ͠ΒಡΈฦ͢ͱ͍͏͜ͱ͸ͳ͍ɻ
  13. ύϥϝʔλֶशͷཁ఺ (1/2) • Ϟσϧ͔Β௚઀ޯ഑Λܭࢉ͢Δ͜ͱͰύϥϝʔλߋ৽Ͱ͖Δ΋ͷ ͱͰ͖ͳ͍΋ͷ͕͋Δ • Ͱ͖Δ΋ͷ (θR ) →

    ී௨ͷLSTM(Vanilla LSTM)ͷϞσϧԽͰग़ ͯདྷͨύϥϝʔλ܈ • Ͱ͖ͳ͍΋ͷ (θU ) → ಡΈඈ͹͠/ಡΈฦ͠ͷࢦࣔΛग़ͨ͢Ίͷ ύϥϝʔλ (ࢀরͰ͖Δਖ਼ղ͕ͳ͍ͨΊ) 18 -45. xt ht−1 ct−1 ht ct softmax( Ws ht ) θR θU
  14. ύϥϝʔλֶशͷཁ఺ (2/2) • Ϟσϧ͔Β௚઀ޯ഑Λܭࢉ͢Δ͜ͱͰύϥϝʔλߋ৽Ͱ͖Δ΋ ͷͱͰ͖ͳ͍΋ͷ͕͋Δ • Ͱ͖ͳ͍΋ͷ (θU ) →

    ಡΈඈ͹͠/ಡΈฦ͠ͷࢦࣔΛग़ͨ͢Ί ͷύϥϝʔλ • ͨͩ͠ɺͳΔ΂͘औΓѻ͏λεΫͷਖ਼ղ͕ଟ͘ͳΔΑ͏ʹ θU ΛܾΊ͍ͨ → ڧԽֶश • ࿦จதͰ͸REINFORCEΞϧΰϦζϜΛద༻ͯ͠ɺ
 ۙࣅతʹ θU ͷޯ഑ΛٻΊ͍ͯΔɻ 19
  15. ײ৘෼ੳ(ϙδωΨ൑ఆ)ͷ࣮ݧ݁Ռ - Rotten Tomatoes 24 • LSTM-ShuttleͰ͸ɺ
 ઌ಄ → ࠷ޙͷ΄͏

    → ਅΜதʹ໭Δ ͷॱͰಡ΋͏ͱ͢ΔͷͰ
 Backward ratio͕ߴ͘ͳͬͨɻ