{"id":11012,"date":"2024-11-29T18:47:43","date_gmt":"2024-11-29T09:47:43","guid":{"rendered":"https:\/\/www.stechstar.com\/user\/wordpress\/?p=11012"},"modified":"2024-11-29T18:47:43","modified_gmt":"2024-11-29T09:47:43","slug":"deeplearning-learning-to-generate-lyrics-and-music-with-recurrent-neural-networks-%ec%88%9c%ed%99%98-%ec%8b%a0%ea%b2%bd%eb%a7%9d%ec%9d%84-%ec%82%ac%ec%9a%a9%ed%95%98%ec%97%ac-%ea%b0%80%ec%82%ac","status":"publish","type":"post","link":"https:\/\/www.stechstar.com\/user\/wordpress\/deeplearning-learning-to-generate-lyrics-and-music-with-recurrent-neural-networks-%ec%88%9c%ed%99%98-%ec%8b%a0%ea%b2%bd%eb%a7%9d%ec%9d%84-%ec%82%ac%ec%9a%a9%ed%95%98%ec%97%ac-%ea%b0%80%ec%82%ac\/","title":{"rendered":"[DeepLearning] Learning to generate lyrics and music with Recurrent Neural Networks : \uc21c\ud658 \uc2e0\uacbd\ub9dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uac00\uc0ac\uc640 \uc74c\uc545\uc744 \uc0dd\uc131\ud558\ub294 \ubc29\ubc95 \ubc30\uc6b0\uae30"},"content":{"rendered":"<h1>[DeepLearning] Learning to generate lyrics and music with Recurrent Neural Networks : \uc21c\ud658 \uc2e0\uacbd\ub9dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uac00\uc0ac\uc640 \uc74c\uc545\uc744 \uc0dd\uc131\ud558\ub294 \ubc29\ubc95 \ubc30\uc6b0\uae30<\/h1>\n<h1 class=\"js-evernote-checked\" data-evernote-id=\"16\"><span>\uc21c\ud658 \uc2e0\uacbd\ub9dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uac00\uc0ac\uc640 \uc74c\uc545\uc744 \uc0dd\uc131\ud558\ub294 \ubc29\ubc95 \ubc30\uc6b0\uae30<\/span><\/h1>\n<p class=\"post-meta js-evernote-checked\" data-evernote-id=\"17\"><span class=\"categories js-evernote-checked\" data-evernote-id=\"18\">Pytorch\uc640 rnns&nbsp;<\/span><span>|&nbsp;<\/span><span class=\"post-date js-evernote-checked\" data-evernote-id=\"19\">2018\ub144 1\uc6d4 27\uc77c<\/span><\/p>\n<div class=\"post js-evernote-checked\" data-evernote-id=\"20\">\n<p class=\"js-evernote-checked\" data-evernote-id=\"21\"><span>RNN \uae30\ubc18 \uc0dd\uc131 \ubaa8\ub378\uc744 \uac00\uc0ac\uc640 \ud53c\uc544\ub178 \uc74c\uc545 \uc0dd\uc131\uc5d0 \uc801\uc6a9\ud55c \uc0ac\ub840\ub97c \ubcf4\uc5ec\uc8fc\ub294 \uac8c\uc2dc\ubb3c\uc785\ub2c8\ub2e4.<\/span><\/p>\n<hr class=\"js-evernote-checked\" data-evernote-id=\"415\">\n<h3 id=\"introduction\" class=\"js-evernote-checked\" data-evernote-id=\"22\"><span>\uc18c\uac1c<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"23\"><span>\uc774 \uac8c\uc2dc\ubb3c\uc5d0\uc11c\ub294 \uac00\uc7a5 \uc778\uae30 \uc788\ub294\/\ucd5c\uadfc \uc544\ud2f0\uc2a4\ud2b8\uc758 \uac00\uc0ac \ub370\uc774\ud130 \uc138\ud2b8\uc5d0\uc11c RNN \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378\uc744 \ud559\uc2b5\ud569\ub2c8\ub2e4. \ud559\uc2b5\ub41c \ubaa8\ub378\uc744 \uac00\uc9c0\uace0 \ub2e4\uc591\ud55c \uc544\ud2f0\uc2a4\ud2b8\uc758 \ub2e4\uc591\ud55c \uc2a4\ud0c0\uc77c\uc744 \uc7ac\ubc0c\uac8c \uc11e\uc740 \uba87 \uace1\uc744 \uc0d8\ud50c\ub9c1\ud569\ub2c8\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c \ubaa8\ub378\uc744 \uc5c5\ub370\uc774\ud2b8\ud558\uc5ec \uc870\uac74\ubd80 \ubb38\uc790 \uc218\uc900 RNN\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \uc544\ud2f0\uc2a4\ud2b8\uc5d0 \ub530\ub77c \ub178\ub798\ub97c \uc0d8\ud50c\ub9c1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub9c8\uc9c0\ub9c9\uc73c\ub85c \ud53c\uc544\ub178 \uace1\uc758 \ubbf8\ub514 \ub370\uc774\ud130 \uc138\ud2b8\uc5d0\uc11c \ubaa8\ub378\uc744 \ud559\uc2b5\ud558\uc5ec \ub9c8\ubb34\ub9ac\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ubaa8\ub4e0 \uc791\uc5c5\uc744 \ud574\uacb0\ud558\ub294 \ub3d9\uc548 \ubb38\uc790 \uc218\uc900 RNN, \uc870\uac74\ubd80 \ubb38\uc790 \uc218\uc900 RNN, RNN \uc0d8\ud50c\ub9c1, \uc2dc\uac04\uc5d0 \ub530\ub978 \uc808\ub2e8\ub41c \uc5ed\uc804\ud30c \ubc0f \uadf8\ub798\ub514\uc5b8\ud2b8 \uccb4\ud06c\ud3ec\uc778\ud305\uacfc \uac19\uc740 RNN \ud559\uc2b5 \ubc0f \ucd94\ub860\uacfc \uad00\ub828\ub41c \uba87 \uac00\uc9c0 \ud765\ubbf8\ub85c\uc6b4 \uac1c\ub150\uc744 \uac04\ub7b5\ud558\uac8c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ubaa8\ub4e0 \ucf54\ub4dc\uc640 \ud559\uc2b5\ub41c \ubaa8\ub378\uc740&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\" data-evernote-id=\"24\" data-cke-saved-href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\"><span>github\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc73c\uba70&nbsp;<\/span><\/a><a class=\"js-evernote-checked\" href=\"http:\/\/pytorch.org\/\" data-evernote-id=\"25\" data-cke-saved-href=\"http:\/\/pytorch.org\/\"><span>Pytorch<\/span><\/a><span>&nbsp;\ub85c \uad6c\ud604\ub418\uc5c8\uc2b5\ub2c8\ub2e4&nbsp;. \ube14\ub85c\uadf8 \uac8c\uc2dc\ubb3c\uc740&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\/blob\/master\/blog_post.ipynb\" data-evernote-id=\"26\" data-cke-saved-href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\/blob\/master\/blog_post.ipynb\"><span>jupyter notebook \ud615\uc2dd\uc73c\ub85c\ub3c4 \ubcfc<\/span><\/a><span>&nbsp;\uc218 \uc788\uc2b5\ub2c8\ub2e4 . \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378\uacfc \uc21c\ud658 \uc2e0\uacbd\ub9dd\uc5d0 \uc775\uc219\ud558\ub2e4\uba74 \ud574\ub2f9 \uc139\uc158\uc744 \uac74\ub108\ub6f0\uac70\ub098 \uacb0\uacfc \uc139\uc158\uc73c\ub85c \ubc14\ub85c \uc774\ub3d9\ud558\uc138\uc694.<\/span><\/p>\n<h3 id=\"character-level-language-model\" class=\"js-evernote-checked\" data-evernote-id=\"27\"><span>\ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"28\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/abe3eb1f57373aabdf1ba69a0968471b.jpg\" alt=\"PNG \ud30c\uc77c\" width=\"594\" height=\"95\" data-autoattach=\"success\" data-evernote-id=\"29\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/abe3eb1f57373aabdf1ba69a0968471b.jpg\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/abe3eb1f57373aabdf1ba69a0968471b.jpg\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"30\"><span>\ubaa8\ub378\uc744 \uc120\ud0dd\ud558\uae30 \uc804\uc5d0, \uc6b0\ub9ac\uc758 \uacfc\uc81c\ub97c \uc790\uc138\ud788 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud604\uc7ac \ubb38\uc790\uc640 \uc774\uc804\uc758 \ubaa8\ub4e0 \ubb38\uc790\uac00 \uc8fc\uc5b4\uc84c\uc744 \ub54c, \uc6b0\ub9ac\ub294 \ub2e4\uc74c \ubb38\uc790\ub97c \uc608\uce21\ud574 \ubcfc \uac83\uc785\ub2c8\ub2e4. \ud6c8\ub828\ud558\ub294 \ub3d9\uc548 \uc6b0\ub9ac\ub294 \uc2dc\ud000\uc2a4\ub97c \ucde8\ud558\uace0, \ub9c8\uc9c0\ub9c9 \ubb38\uc790\ub97c \uc81c\uc678\ud55c \ubaa8\ub4e0 \ubb38\uc790\ub97c \uc785\ub825\uc73c\ub85c \uc0ac\uc6a9\ud558\uace0, \ub450 \ubc88\uc9f8 \ubb38\uc790\uc5d0\uc11c \uc2dc\uc791\ud558\ub294 \ub3d9\uc77c\ud55c \uc2dc\ud000\uc2a4\ub97c \uae30\uc900 \uc9c4\uc2e4\ub85c \uc0ac\uc6a9\ud560 \uac83\uc785\ub2c8\ub2e4(\uc704\uc758 \uadf8\ub9bc \ucc38\uc870;&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\" data-evernote-id=\"31\" data-cke-saved-href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\"><span>\ucd9c\ucc98<\/span><\/a><span>&nbsp;). \uc6b0\ub9ac\ub294 \uc608\uce21\uc744 \ud560 \ub54c \uc774\uc804\uc758 \ubaa8\ub4e0 \ubb38\uc790\ub97c \ubb34\uc2dc\ud558\ub294 \uac00\uc7a5 \uac04\ub2e8\ud55c \ubaa8\ub378\uc5d0\uc11c \uc2dc\uc791\ud558\uc5ec, \uc774 \ubaa8\ub378\uc744 \uac1c\uc120\ud558\uc5ec \ud2b9\uc815 \uc218\uc758 \uc774\uc804 \ubb38\uc790\ub9cc \uace0\ub824\ud558\ub3c4\ub85d \ud558\uace0, \uc608\uce21\uc744 \ud560 \ub54c \uc774\uc804\uc758 \ubaa8\ub4e0 \ubb38\uc790\ub97c \uace0\ub824\ud558\ub294 \ubaa8\ub378\ub85c \uacb0\ub860\uc9c0\uc744 \uac83\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"32\"><span>\uc6b0\ub9ac\uc758 \uc5b8\uc5b4 \ubaa8\ub378\uc740 \ubb38\uc790 \uc218\uc900\uc5d0\uc11c \uc815\uc758\ub429\ub2c8\ub2e4. \uc6b0\ub9ac\ub294 \ubaa8\ub4e0 \uc601\uc5b4 \ubb38\uc790\uc640 \ub9c8\uce68\ud45c, \uc27c\ud45c, \uc904 \ub05d \uae30\ud638\uc640 \uac19\uc740 \uc77c\ubd80 \ud2b9\uc218 \uae30\ud638\ub97c \ud3ec\ud568\ud558\ub294 \uc0ac\uc804\uc744 \ub9cc\ub4e4 \uac83\uc785\ub2c8\ub2e4. \uac01 \ubb38\uc790\ub294 one-hot-encoded \ud150\uc11c\ub85c \ud45c\ud604\ub429\ub2c8\ub2e4. \ubb38\uc790 \uc218\uc900 \ubaa8\ub378\uacfc \uc608\uc81c\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub0b4\uc6a9\uc740&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/spro\/practical-pytorch\" data-evernote-id=\"33\" data-cke-saved-href=\"https:\/\/github.com\/spro\/practical-pytorch\"><span>\uc774 \ub9ac\uc18c\uc2a4\ub97c<\/span><\/a><span>&nbsp;\ucd94\ucc9c\ud569\ub2c8\ub2e4 .<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"34\"><span>\ubb38\uc790\ub97c \uac00\uc9c0\uace0 \uc788\uc73c\ubbc0\ub85c \uc774\uc81c \ubb38\uc790 \uc2dc\ud000\uc2a4\ub97c \ud615\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc9c0\uae08\ub3c4 \uace0\uc815\ub41c \ud655\ub960\ub85c \ubb38\uc790\ub97c \ubb34\uc791\uc704\ub85c \uc0d8\ud50c\ub9c1\ud558\uc5ec \ubb38\uc7a5\uc744 \uc0dd\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4&nbsp;<\/span><span>. \uc774\uac83\uc774 \uac00\uc7a5 \uac04\ub2e8\ud55c \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378\uc785\ub2c8\ub2e4. \uc774\uac83\ubcf4\ub2e4 \ub354 \ub098\uc740 \ubc29\ubc95\uc740 \uc5c6\uc744\uae4c\uc694? \uadf8\ub807\uc2b5\ub2c8\ub2e4. \ud6c8\ub828 \ucf54\ud37c\uc2a4\uc5d0\uc11c \uac01 \ubb38\uc790\uc758 \ubc1c\uc0dd \ud655\ub960(\ubb38\uc790\uac00 \ubc1c\uc0dd\ud558\ub294 \ud69f\uc218\ub97c \ub370\uc774\ud130 \uc138\ud2b8 \ud06c\uae30\ub85c \ub098\ub208 \uac12)\uc744 \uacc4\uc0b0\ud558\uace0 \uc774\ub7ec\ud55c \ud655\ub960\uc744 \uc0ac\uc6a9\ud558\uc5ec \ubb38\uc790\ub97c \ubb34\uc791\uc704\ub85c \uc0d8\ud50c\ub9c1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \ubaa8\ub378\uc740 \ub354 \uc88b\uc9c0\ub9cc \uac01 \ubb38\uc790\uc758 \uc0c1\ub300\uc801\uc778 \uc704\uce58\uc801 \uce21\uba74\uc744 \uc644\uc804\ud788 \ubb34\uc2dc\ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \ub2e8\uc5b4\ub97c \uc77d\ub294 \ubc29\ubc95\uc5d0 \uc8fc\uc758\ud558\uc138\uc694. \uccab \ubc88\uc9f8 \ubb38\uc790\ubd80\ud130 \uc2dc\uc791\ud558\ub294\ub370, \uc774\ub294 \uc77c\ubc18\uc801\uc73c\ub85c \uc608\uce21\ud558\uae30 \uc5b4\ub835\uc9c0\ub9cc \ub2e8\uc5b4\uc758 \ub05d\uc5d0 \ub3c4\ub2ec\ud558\uba74 \ub54c\ub54c\ub85c \ub2e4\uc74c \ubb38\uc790\ub97c \ucd94\uce21\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e8\uc5b4\ub97c \uc77d\uc744 \ub54c \ub2e4\ub978 \ud14d\uc2a4\ud2b8\ub97c \uc77d\uace0 \ubc30\uc6b4 \uc77c\ubd80 \uaddc\uce59\uc744 \uc554\ubb35\uc801\uc73c\ub85c \uc0ac\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \ub2e8\uc5b4\uc5d0\uc11c \uc77d\ub294 \ubb38\uc790\uac00 \ud558\ub098 \ub354 \ucd94\uac00\ub420 \ub54c\ub9c8\ub2e4 \uacf5\ubc31 \ubb38\uc790\uc758 \ud655\ub960\uc774 \uc99d\uac00\ud558\uac70\ub098(\uc815\ub9d0 \uae34 \ub2e8\uc5b4\ub294 \ub4dc\ubb45\ub2c8\ub2e4) \ubb38\uc790 &#8220;r&#8221; \ub4a4\uc5d0 \uc790\uc74c\uc774 \uc62c \ud655\ub960\uc740 \uc77c\ubc18\uc801\uc73c\ub85c \ubaa8\uc74c \ub4a4\uc5d0 \uc624\uae30 \ub54c\ubb38\uc5d0 \ub0ae\uc2b5\ub2c8\ub2e4. \ube44\uc2b7\ud55c \uaddc\uce59\uc774 \ub9ce\uc774 \uc788\uace0, \uc6b0\ub9ac \ubaa8\ub378\uc774 \ub370\uc774\ud130\ub85c\ubd80\ud130 \uc774\ub97c \ud559\uc2b5\ud560 \uc218 \uc788\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. \uc6b0\ub9ac \ubaa8\ub378\uc774 \uc774\ub7ec\ud55c \uaddc\uce59\uc744 \ud559\uc2b5\ud560 \uc218 \uc788\ub294 \uae30\ud68c\ub97c \uc8fc\uae30 \uc704\ud574 \ubaa8\ub378\uc744 \ud655\uc7a5\ud574\uc57c \ud569\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"35\"><span>\ubaa8\ub378\uc744 \uc870\uae08\uc529 \uc810\uc9c4\uc801\uc73c\ub85c \uac1c\uc120\ud558\uace0 \uac01 \ubb38\uc790\uc758 \ud655\ub960\uc744 \uc774\uc804\uc5d0 \ubc1c\uc0dd\ud55c \ubb38\uc790\uc5d0\ub9cc \uc758\uc874\ud558\ub3c4\ub85d \ud569\uc2dc\ub2e4(&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_property\" data-evernote-id=\"36\" data-cke-saved-href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_property\"><span>\ub9c8\ub974\ucf54\ud504 \uac00\uc815<\/span><\/a><span>&nbsp;). \ub530\ub77c\uc11c \uae30\ubcf8\uc801\uc73c\ub85c&nbsp;<\/span><span>. \uc774\uac83\uc740&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\" data-evernote-id=\"37\" data-cke-saved-href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\"><span>\ub9c8\ub974\ucf54\ud504 \uc5f0\uc1c4 \ubaa8\ub378<\/span><\/a><span>&nbsp;\uc785\ub2c8\ub2e4( \uc775\uc219\ud558\uc9c0 \uc54a\ub2e4\uba74&nbsp;\uc774\ub7ec\ud55c&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"http:\/\/setosa.io\/ev\/markov-chains\/\" data-evernote-id=\"38\" data-cke-saved-href=\"http:\/\/setosa.io\/ev\/markov-chains\/\"><span>\ub300\ud654\ud615 \uc2dc\uac01\ud654<\/span><\/a><span>&nbsp;\ub3c4 \uc2dc\ub3c4\ud574 \ubcf4\uc138\uc694). \ub610\ud55c \ud6c8\ub828 \ub370\uc774\ud130 \uc138\ud2b8\uc5d0\uc11c \ud655\ub960 \ubd84\ud3ec\ub97c \ucd94\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \ubaa8\ub378\uc740 \ub300\ubd80\ubd84\uc758 \uacbd\uc6b0 \ud604\uc7ac \ubb38\uc790\uc758 \ud655\ub960\uc774 \uc774\uc804 \ubb38\uc790\uc5d0\ub9cc \uc758\uc874\ud558\uc9c0 \uc54a\uae30 \ub54c\ubb38\uc5d0 \uc81c\ud55c\uc801\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"39\"><span>\uc6b0\ub9ac\uac00 \ubaa8\ub378\ub9c1\ud558\uace0\uc790 \ud558\ub294 \uac83\uc740 \uc2e4\uc81c\ub85c&nbsp;<\/span><span>. \ucc98\uc74c\uc5d0\ub294 \uc774\uc804 \ubb38\uc790\uc758 \uc218\uac00 \uac00\ubcc0\uc801\uc774\uace0 \uae34 \uc2dc\ud000\uc2a4\uc758 \uacbd\uc6b0 \uc815\ub9d0 \ucee4\uc9c8 \uc218 \uc788\uae30 \ub54c\ubb38\uc5d0 \uc791\uc5c5\uc774 \ub09c\ud574\ud574 \ubcf4\uc785\ub2c8\ub2e4. Reccurent Neural Netoworks\ub294 \uacf5\uc720 \uac00\uc911\uce58\uc640 \uace0\uc815 \ud06c\uae30 \uc228\uaca8\uc9c4 \uc0c1\ud0dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc5b4\ub290 \uc815\ub3c4 \uc774 \ubb38\uc81c\ub97c \ud574\uacb0\ud560 \uc218 \uc788\ub294 \uac83\uc73c\ub85c \ubc1d\ud600\uc84c\uc2b5\ub2c8\ub2e4. \uc774\ub294 RNN\uc5d0 \uc804\ub150\ud558\ub294 \ub2e4\uc74c \uc139\uc158\uc73c\ub85c \uc774\uc5b4\uc9d1\ub2c8\ub2e4.<\/span><\/p>\n<h3 id=\"recurrent-neural-networks\" class=\"js-evernote-checked\" data-evernote-id=\"40\"><span>\uc21c\ud658 \uc2e0\uacbd\ub9dd<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"41\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/1b387166ef74af40cc791e6b62f98c2e.jpg\" alt=\"PNG \ud30c\uc77c\" width=\"768\" height=\"308\" data-autoattach=\"success\" data-evernote-id=\"42\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/1b387166ef74af40cc791e6b62f98c2e.jpg\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/1b387166ef74af40cc791e6b62f98c2e.jpg\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"43\"><span>\uc21c\ud658 \uc2e0\uacbd\ub9dd\uc740 \uc21c\ucc28\uc801 \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\uae30 \uc704\ud55c \uc2e0\uacbd\ub9dd \uacc4\uc5f4\uc785\ub2c8\ub2e4. \ud53c\ub4dc\ud3ec\uc6cc\ub4dc \uc2e0\uacbd\ub9dd\uacfc \ub2ec\ub9ac RNN\uc740 \ub0b4\ubd80 \uba54\ubaa8\ub9ac\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc784\uc758\uc758 \uc785\ub825 \uc2dc\ud000\uc2a4\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc784\uc758\uc758 \ud06c\uae30\uc758 \uc785\ub825 \uc2dc\ud000\uc2a4\ub85c \uc778\ud574 \uc0ac\uc774\ud074\uc774 \uc788\ub294 \uadf8\ub798\ud504\ub85c \uac04\uacb0\ud558\uac8c \ud45c\ud604\ub429\ub2c8\ub2e4(\uadf8\ub9bc \ucc38\uc870;&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\" data-evernote-id=\"44\" data-cke-saved-href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\"><span>\ucd9c\ucc98<\/span><\/a><span>&nbsp;). \ud558\uc9c0\ub9cc \uc785\ub825 \uc2dc\ud000\uc2a4\uc758 \ud06c\uae30\ub97c \uc54c\uba74 &#8220;\ud3bc\uccd0\uc9c8&#8221; \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud604\uc7ac \uc785\ub825 \uacfc \uc774\uc804 \uc228\uaca8\uc9c4 \uc0c1\ud0dc \uc5d0\uc11c&nbsp;<\/span><span>\ucd9c\ub825&nbsp;<\/span><span>\uacfc \ud604\uc7ac \uc228\uaca8\uc9c4 \uc0c1\ud0dc \ub85c\uc758&nbsp;\ube44\uc120\ud615 \ub9e4\ud551\uc744 \uc815\uc758\ud569\ub2c8\ub2e4&nbsp;<\/span><span>. \uc228\uaca8\uc9c4 \uc0c1\ud0dc \ud06c\uae30\ub294 \ubbf8\ub9ac \uc815\uc758\ub41c \ud06c\uae30\ub97c \uac00\uc9c0\uba70 \uac01 \ub2e8\uacc4\uc5d0\uc11c \uc5c5\ub370\uc774\ud2b8\ub418\uace0 \ub9e4\ud551 \uacb0\uacfc\uc5d0 \uc601\ud5a5\uc744 \ubbf8\uce58\ub294 \uae30\ub2a5\uc744 \uc800\uc7a5\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"45\"><span>\uc774\uc81c \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378\uc758 \uc774\uc804 \uadf8\ub9bc\uacfc \uc811\ud78c RNN \uadf8\ub9bc\uc744 \ub9de\ucdb0\uc11c RNN \ubaa8\ub378\uc744 \uc0ac\uc6a9\ud558\uc5ec \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378\uc744 \uc5b4\ub5bb\uac8c \ud559\uc2b5\ud558\ub294\uc9c0 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"46\"><span>\uadf8\ub9bc\uc5d0\uc11c\ub294 Vanilla RNN\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\uc9c0\ub9cc, \uc6b0\ub9ac\uc758 \uc791\uc5c5\uc5d0\uc11c\ub294 LSTM\uc744 \uc0ac\uc6a9\ud560 \uac83\uc785\ub2c8\ub2e4. \uc65c\ub0d0\ud558\uba74 \ud6c8\ub828\uc774 \ub354 \uc27d\uace0 \ubcf4\ud1b5 \ub354 \ub098\uc740 \uacb0\uacfc\ub97c \uc5bb\uc744 \uc218 \uc788\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"47\"><a class=\"js-evernote-checked\" href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\" data-evernote-id=\"48\" data-cke-saved-href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\"><span>RNN\uc5d0 \ub300\ud55c \ub354 \uc790\uc138\ud55c \uc18c\uac1c\ub294 \ub2e4\uc74c \uc790\ub8cc<\/span><\/a><span>&nbsp;\ub97c \ucc38\uc870\ud558\uc138\uc694&nbsp;.<\/span><\/p>\n<h3 id=\"lyrics-dataset\" class=\"js-evernote-checked\" data-evernote-id=\"49\"><span>\uac00\uc0ac \ub370\uc774\ud130 \uc138\ud2b8<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"50\"><span>\uc2e4\ud5d8\uc744 \uc704\ud574 \uc6b0\ub9ac\ub294 \ub2e4\uc591\ud55c \ucd5c\uc2e0 \uc544\ud2f0\uc2a4\ud2b8\uc640 \ub354 \uc624\ub798\ub41c \uc544\ud2f0\uc2a4\ud2b8\ub97c \ud3ec\ud568\ud558\ub294&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.kaggle.com\/mousehead\/songlyrics\" data-evernote-id=\"51\" data-cke-saved-href=\"https:\/\/www.kaggle.com\/mousehead\/songlyrics\"><span>55,000\uac1c \uc774\uc0c1\uc758 \ub178\ub798 \uac00\uc0ac Kaggle \ub370\uc774\ud130 \uc138\ud2b8\ub97c<\/span><\/a><span>&nbsp;\uc120\ud0dd\ud588\uc2b5\ub2c8\ub2e4 . \uc774\ub294 \ud310\ub2e4\uc2a4 \ud30c\uc77c\ub85c \uc800\uc7a5\ub418\uba70, \ud6c8\ub828 \ubaa9\uc801\uc73c\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ud30c\uc774\uc36c \ub798\ud37c\ub97c \uc791\uc131\ud588\uc2b5\ub2c8\ub2e4. \ucf54\ub4dc\ub97c \uc0ac\uc6a9\ud558\ub824\uba74 \uc9c1\uc811 \ub2e4\uc6b4\ub85c\ub4dc\ud574\uc57c \ud569\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"52\"><span>\uacb0\uacfc\ub97c \ub354 \uc798 \ud574\uc11d\ud558\uae30 \uc704\ud574, \ub098\ub294 \ub0b4\uac00 \uc5b4\ub290 \uc815\ub3c4 \uc54c\uace0 \uc788\ub294 \uc544\ud2f0\uc2a4\ud2b8 \ud558\uc704 \uc9d1\ud569\uc744 \uc120\ud0dd\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<div class=\"language-python highlighter-rouge js-evernote-checked\" data-evernote-id=\"53\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"54\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"55\"><code class=\"js-evernote-checked\" data-evernote-id=\"56\"><span class=\"n js-evernote-checked\" data-evernote-id=\"57\">artists<\/span> <span class=\"o js-evernote-checked\" data-evernote-id=\"58\">=<\/span> <span class=\"p js-evernote-checked\" data-evernote-id=\"59\">[<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"60\">'ABBA'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"61\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"62\">'Ace Of Base'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"63\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"64\">'Aerosmith'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"65\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"66\">'Avril Lavigne'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"67\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"68\">'Backstreet Boys'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"69\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"70\">'Bob Marley'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"71\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"72\">'Bon Jovi'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"73\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"74\">'Britney Spears'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"75\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"76\">'Bruno Mars'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"77\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"78\">'Coldplay'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"79\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"80\">'Def Leppard'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"81\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"82\">'Depeche Mode'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"83\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"84\">'Ed Sheeran'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"85\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"86\">'Elton John'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"87\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"88\">'Elvis Presley'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"89\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"90\">'Eminem'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"91\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"92\">'Enrique Iglesias'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"93\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"94\">'Evanescence'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"95\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"96\">'Fall Out Boy'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"97\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"98\">'Foo Fighters'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"99\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"100\">'Green Day'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"101\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"102\">'HIM'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"103\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"104\">'Imagine Dragons'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"105\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"106\">'Incubus'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"107\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"108\">'Jimi Hendrix'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"109\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"110\">'Justin Bieber'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"111\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"112\">'Justin Timberlake'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"113\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"114\">'Kanye West'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"115\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"116\">'Katy Perry'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"117\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"118\">'The Killers'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"119\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"120\">'Kiss'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"121\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"122\">'Lady Gaga'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"123\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"124\">'Lana Del Rey'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"125\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"126\">'Linkin Park'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"127\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"128\">'Madonna'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"129\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"130\">'Marilyn Manson'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"131\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"132\">'Maroon 5'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"133\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"134\">'Metallica'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"135\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"136\">'Michael Bolton'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"137\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"138\">'Michael Jackson'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"139\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"140\">'Miley Cyrus'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"141\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"142\">'Nickelback'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"143\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"144\">'Nightwish'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"145\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"146\">'Nirvana'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"147\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"148\">'Oasis'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"149\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"150\">'Offspring'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"151\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"152\">'One Direction'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"153\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"154\">'Ozzy Osbourne'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"155\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"156\">'P!nk'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"157\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"158\">'Queen'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"159\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"160\">'Radiohead'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"161\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"162\">'Red Hot Chili Peppers'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"163\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"164\">'Rihanna'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"165\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"166\">'Robbie Williams'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"167\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"168\">'Rolling Stones'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"169\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"170\">'Roxette'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"171\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"172\">'Scorpions'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"173\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"174\">'Snoop Dogg'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"175\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"176\">'Sting'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"177\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"178\">'The Script'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"179\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"180\">'U2'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"181\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"182\">'Weezer'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"183\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"184\">'Yellowcard'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"185\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"186\">'ZZ Top'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"187\">]<\/span>\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<h3 id=\"training-unconditional-character-level-language-model\" class=\"js-evernote-checked\" data-evernote-id=\"188\"><span>\ubb34\uc870\uac74 \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378 \ud6c8\ub828<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"189\"><span>\uc6b0\ub9ac\uc758 \uccab \ubc88\uc9f8 \uc2e4\ud5d8\uc740 \uc804\uccb4 \ucf54\ud37c\uc2a4\uc5d0\uc11c \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378 RNN\uc744 \ud6c8\ub828\ud558\ub294 \uac83\uc73c\ub85c \uad6c\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ud6c8\ub828\ud558\ub294 \ub3d9\uc548 \uc544\ud2f0\uc2a4\ud2b8 \uc815\ubcf4\ub294 \uace0\ub824\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<h3 id=\"sampling-from-rnn\" class=\"js-evernote-checked\" data-evernote-id=\"190\"><span>RNN\uc5d0\uc11c \uc0d8\ud50c\ub9c1<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"191\"><span>\ubaa8\ub378\uc744 \ud6c8\ub828\ud55c \ud6c4 \uba87 \uace1\uc744 \uc0d8\ud50c\ub9c1\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uae30\ubcf8\uc801\uc73c\ub85c RNN\uc740 \uac01 \ub2e8\uacc4\uc5d0\uc11c \ub85c\uc9d3\uc744 \ucd9c\ub825\ud558\uace0 \uc774\ub97c \uc18c\ud504\ud2b8\ub9e5\uc2a4\ud558\uc5ec \ud574\ub2f9 \ubd84\ud3ec\uc5d0\uc11c \uc0d8\ud50c\ub9c1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub610\ub294 Gumble-Max \ud2b8\ub9ad\uc744 \uc0ac\uc6a9\ud558\uc5ec&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/hips.seas.harvard.edu\/blog\/2013\/04\/06\/the-gumbel-max-trick-for-discrete-distributions\/\" data-evernote-id=\"192\" data-cke-saved-href=\"https:\/\/hips.seas.harvard.edu\/blog\/2013\/04\/06\/the-gumbel-max-trick-for-discrete-distributions\/\"><span>\ub85c\uc9d3\uc744 \uc9c1\uc811 \uc0d8\ud50c\ub9c1<\/span><\/a><span>&nbsp;\ud560 \uc218\ub3c4 \uc788\ub294\ub370 \uc774\ub294 \ub3d9\uc77c\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"193\"><span>\uc0d8\ud50c\ub9c1\uc5d0 \ub300\ud55c \ud765\ubbf8\ub85c\uc6b4 \uc810 \ud558\ub098\ub294 \uc6b0\ub9ac\uac00 \uc785\ub825 \uc2dc\ud000\uc2a4\ub97c \ubd80\ubd84\uc801\uc73c\ub85c \uc2a4\uc2a4\ub85c \uc815\uc758\ud558\uace0 \uadf8 \ucd08\uae30 \uc870\uac74\uc73c\ub85c \uc0d8\ud50c\ub9c1\uc744 \uc2dc\uc791\ud560 \uc218 \uc788\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, &#8220;Why&#8221;\ub85c \uc2dc\uc791\ud558\ub294 \ub178\ub798\ub97c \uc0d8\ud50c\ub9c1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"194\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"195\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"196\"><code class=\"js-evernote-checked\" data-evernote-id=\"197\">Why do you have to leave me?  \r\nI think I know I'm not the only one  \r\nI don't know if I'm gonna stay awake  \r\nI don't know why I go along  \r\n  \r\nI don't know why I can't go on  \r\nI don't know why I don't know  \r\nI don't know why I don't know  \r\nI don't know why I keep on dreaming of you   \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"198\"><span>\uc74c, \uadf8\ub7f4 \ubc95\ud55c \ub178\ub798\ub124\uc694 \ud83d\ude00<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"199\"><span>\u201cWell\u201d\ub85c \uc2dc\uc791\ud558\ub294 \ub178\ub798\ub85c \uc0d8\ud50c\ub9c1\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"200\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"201\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"202\"><code class=\"js-evernote-checked\" data-evernote-id=\"203\">Well, I was a real good time  \r\nI was a rolling stone  \r\nI was a rock and roller  \r\nWell, I never had a rock and roll  \r\nThere were times I had to do it  \r\nI had a feeling that I was found  \r\nI was the one who had to go  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"204\"><span>\uc0d8\ud50c\ub9c1 \uc911\uc5d0 \uc0ac\uc6a9\ub418\ub294 &#8220;\uc628\ub3c4&#8221; \ub9e4\uac1c\ubcc0\uc218\uac00 \uc788\ub294\ub370, \uc774\ub294 \uc0d8\ud50c\ub9c1 \ud504\ub85c\uc138\uc2a4\uc758 \ubb34\uc791\uc704\uc131\uc744 \uc81c\uc5b4\ud569\ub2c8\ub2e4. \uc774 \ub9e4\uac1c\ubcc0\uc218\uac00 0\uc5d0 \uac00\uae4c\uc6cc\uc9c0\uba74 \uc0d8\ud50c\ub9c1\uc740 argmax\uc640 \ub3d9\uc77c\ud558\uace0 \ubb34\ud55c\ub300\uc5d0 \uac00\uae4c\uc6cc\uc9c0\uba74 \uc0d8\ud50c\ub9c1\uc740 \uade0\uc77c\ud55c \ubd84\ud3ec\uc5d0\uc11c \uc0d8\ud50c\ub9c1\ud558\ub294 \uac83\uacfc \ub3d9\uc77c\ud569\ub2c8\ub2e4.&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/arxiv.org\/pdf\/1611.01144.pdf\" data-evernote-id=\"205\" data-cke-saved-href=\"https:\/\/arxiv.org\/pdf\/1611.01144.pdf\"><span>Jang et al.\uc758 \uad00\ub828 \ub17c\ubb38<\/span><\/a><span>&nbsp;\uc5d0\uc11c \uadf8\ub9bc\uc744 \uc0b4\ud3b4\ubcf4\uc138\uc694 .<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"206\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/2ab8b692c3c9bfe5e30b15ac4d35dcdc.png\" alt=\"PNG \ud30c\uc77c\" width=\"443\" height=\"95\" data-autoattach=\"success\" data-evernote-id=\"207\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/2ab8b692c3c9bfe5e30b15ac4d35dcdc.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/2ab8b692c3c9bfe5e30b15ac4d35dcdc.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"208\"><span>, \ubd84\ud3ec\ub294 \uc601\ud5a5\uc744 \ubc1b\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \ub97c \uac10\uc18c\uc2dc\ud0a4\uba74&nbsp;<\/span><span>\ubd84\ud3ec\uac00 \ub354 \ub450\ub4dc\ub7ec\uc9c0\uac8c \ub418\uba70, \uc774\ub294 \ub354 \ud070 \ud655\ub960 \uc9c8\ub7c9\uc744 \uac00\uc9c4 \uac12\uc774 \uc99d\uac00\ud55c\ub2e4\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \ub97c 0\uc5d0 \uac00\uae4c\uc6cc\uc9c0\uba74&nbsp;\uc0d8\ud50c\ub9c1&nbsp;<\/span><span>\uc740 armax\uc640 \ub3d9\uc77c\ud574\uc9c0\ubbc0\ub85c \ud574\ub2f9 \uac12\uc758 \ud655\ub960\uc774 1\uc5d0 \uac00\uae4c\uc6cc\uc9d1\ub2c8\ub2e4. \ub97c \uc99d\uac00\uc2dc\ud0a4\uae30 \uc2dc\uc791\ud558\uba74&nbsp;<\/span><span>\ubd84\ud3ec\uac00 \uc810\uc810 \ub354 \uade0\uc77c\ud574\uc9d1\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"209\"><span>\uc774\uc804 \uc0d8\ud50c\uc740 \uc628\ub3c4 \ub9e4\uac1c\ubcc0\uc218\uac00&nbsp;<\/span><span>. \uc640 \uac19\ub3c4\ub85d \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. . \ub85c \ub298\ub9ac\uba74 \uc5b4\ub5bb\uac8c \ub418\ub294\uc9c0 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4&nbsp;<\/span><span>. \uc0d8\ud50c:<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"210\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"211\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"212\"><code class=\"js-evernote-checked\" data-evernote-id=\"213\">Why can't we drop out of time?  \r\nWe were born for words to see.  \r\nWon't you love this. You're still so amazing.  \r\nThis could be that down on Sunday Time.  \r\nOh, Caroline, a lady floor.  \r\nI thought of love, oh baby.  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"214\"><span>\uc880\ub354 \ub298\ub824\ubcf4\ub3c4\ub85d \ud558\uc8e0.<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"215\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"216\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"217\"><code class=\"js-evernote-checked\" data-evernote-id=\"218\">Why - won't we grow up naked?  \r\nWe went quietly what we would've still give  \r\nThat girl you walked before our bedroom room  \r\nI see your mind is so small to a freak  \r\nStretching for a cold white-heart of crashing  \r\nTruth in the universal daughter  \r\n  \r\nI lose more and more hard  \r\nI love you anytime at all  \r\nAh come let your help remind me  \r\nNow I've wanted waste and never noticed  \r\n  \r\nI swear I saw you today  \r\nYou needed to get by  \r\nBut you sold a hurricane  \r\nWell out whispered in store\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"219\"><span>\uc0ac\uc2e4, \uc65c \uc6b0\ub9ac\ub294 \ubc8c\uac70\ubc97\uace0 \uc790\ub77c\uc9c0 \uc54a\uc744\uae4c\uc694? \ud83d\ude00 \uc628\ub3c4\uac00 \ub192\uc544\uc9c8\uc218\ub85d \uc0d8\ud50c\ub9c1\ub41c \ubb38\uc7a5\uc774 \uc810\uc810 \ub354 \ubb34\uc791\uc704\uc801\uc774 \ub418\ub294 \ucd94\uc138\ub97c \ubcfc \uc218 \uc788\uc8e0.<\/span><\/p>\n<h3 id=\"training-conditional-character-level-language-model\" class=\"js-evernote-checked\" data-evernote-id=\"220\"><span>\uc870\uac74\ubd80 \ubb38\uc790 \uc218\uc900 \uc5b8\uc5b4 \ubaa8\ub378 \ud6c8\ub828<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"221\"><span>\ud2b9\uc815 \uc544\ud2f0\uc2a4\ud2b8\uc758 \uc2a4\ud0c0\uc77c\ub85c \uac00\uc0ac\ub97c \uc0dd\uc131\ud560 \uc218 \uc788\ub2e4\uace0 \uc0c1\uc0c1\ud574\ubcf4\uc138\uc694. \ubaa8\ub378\uc744 \ubcc0\uacbd\ud558\uc5ec \ud6c8\ub828 \uc911\uc5d0 \uc774 \uc815\ubcf4\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ud569\uc2dc\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"222\"><span>\uc6b0\ub9ac\ub294 RNN\uc5d0 \ucd94\uac00 \uc785\ub825\uc744 \ucd94\uac00\ud558\uc5ec \uc774\ub97c \uc218\ud589\ud560 \uac83\uc785\ub2c8\ub2e4. \uc9c0\uae08\uae4c\uc9c0 \uc6b0\ub9ac\uc758 RNN \ubaa8\ub378\uc740 \uac01 \ub2e8\uacc4\uc5d0\uc11c \uc6d0\ud56b \uc778\ucf54\ub529\ub41c \ubb38\uc790\uac00 \ud3ec\ud568\ub41c \ud150\uc11c\ub9cc \ud5c8\uc6a9\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"223\"><span>\uc6b0\ub9ac \ubaa8\ub378\uc758 \ud655\uc7a5\uc740 \ub9e4\uc6b0 \uac04\ub2e8\ud560 \uac83\uc785\ub2c8\ub2e4. \uc544\ud2f0\uc2a4\ud2b8\ub97c \ub098\ud0c0\ub0b4\ub294 \ucd94\uac00 \uc6d0\ud56b \uc778\ucf54\ub529 \ud150\uc11c\uac00 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4. \ub530\ub77c\uc11c \uac01 \ub2e8\uacc4\uc5d0\uc11c RNN\uc740 \uce90\ub9ad\ud130\uc640 \uc544\ud2f0\uc2a4\ud2b8\ub97c \ub098\ud0c0\ub0b4\ub294 \uc5f0\uacb0\ub41c \ud150\uc11c\ub85c \uad6c\uc131\ub418\ub294 \ud150\uc11c \ud558\ub098\ub97c \ud5c8\uc6a9\ud569\ub2c8\ub2e4.&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\" data-evernote-id=\"224\" data-cke-saved-href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\"><span>\uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \uc5ec\uae30\ub97c<\/span><\/a><span>&nbsp;\ucc38\uc870\ud558\uc138\uc694 .<\/span><\/p>\n<h3 id=\"sampling-from-conditional-language-model-rnn\" class=\"js-evernote-checked\" data-evernote-id=\"225\"><span>\uc870\uac74 \uc5b8\uc5b4 \ubaa8\ub378 RNN\uc5d0\uc11c \uc0d8\ud50c\ub9c1<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"226\"><span>\ud6c8\ub828 \ud6c4, \uc6b0\ub9ac\ub294 \uc544\ud2f0\uc2a4\ud2b8\uc5d0 \ub530\ub77c \uba87 \uace1\uc744 \uc0d8\ud50c\ub9c1\ud588\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc5d0\uc11c \uba87 \uac00\uc9c0 \uacb0\uacfc\ub97c \ucc3e\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"227\"><span>\uadf8\ub97c:<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"228\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"229\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"230\"><code class=\"js-evernote-checked\" data-evernote-id=\"231\">My fears  \r\nAnd the moment don't make me sing  \r\nSo free from you  \r\nThe pain you love me yeah  \r\n  \r\nWhatever caused the warmth  \r\nYou smile you're happy  \r\nYou sit away  \r\nYou say it's all in vain  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"232\"><span>\uc2e4\uc81c\ub85c \uac00\ub2a5\ud574 \ubcf4\uc774\ub294\ub370, \ud2b9\ud788 &#8216;\uace0\ud1b5&#8217;\uc774\ub77c\ub294 \ub2e8\uc5b4\uac00 \uc0ac\uc6a9\ub410\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4. \uc774 \ub2e8\uc5b4\ub294 \uc544\ud2f0\uc2a4\ud2b8\uc758 \uac00\uc0ac\uc5d0\uc11c \ub9e4\uc6b0 \ud754\ud558\uac8c \uc4f0\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"233\"><span>\uc544\ubc14:<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"234\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"235\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"236\"><code class=\"js-evernote-checked\" data-evernote-id=\"237\">Oh, my love it makes me close a thing  \r\nYou've been heard, I must have waited  \r\nI hear you  \r\nSo I say  \r\nThank you for the music, that makes me cry  \r\n  \r\nAnd you moving my bad as me, ah-hang wind in the hell  \r\nI was meant to be with you, I'll never be playing up\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"238\"><span>\ubc25 \ub9d0\ub9ac:<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"239\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"240\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"241\"><code class=\"js-evernote-checked\" data-evernote-id=\"242\">Mercy on judgment, we got so much  \r\n  \r\nAlcohol, cry, cry, cry  \r\nWhy don't try to find our own  \r\nI want to know, Lord, I wanna give you  \r\nJust saving it, learned  \r\nIs there any more?  \r\n  \r\nAll that damage done  \r\nThat's all reason, don't worry  \r\nNeed a hammer  \r\nI need you more and more  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"243\"><span>\ucf5c\ub4dc\ud50c\ub808\uc774:<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"244\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"245\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"246\"><code class=\"js-evernote-checked\" data-evernote-id=\"247\">Look at the stars  \r\nInto life matter where you lay  \r\nSaying no doubt  \r\nI don't want to fly  \r\nIn my dreams and fight today\r\n\r\nI will fall for you  \r\n  \r\nAll I know  \r\nAnd I want you to stay  \r\nInto the night  \r\n  \r\nI want to live waiting  \r\nWith my love and always  \r\nHave I wouldn't wasted  \r\nWould it hurt you\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"248\"><span>\uce74\ub2c8\uc608 \uc6e8\uc2a4\ud2b8:<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"249\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"250\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"251\"><code class=\"js-evernote-checked\" data-evernote-id=\"252\">I'm everywhere for you  \r\nThe way that it couldn't stop  \r\nI mean it too late and love I made in the world  \r\nI told you so I took the studs full cold-stop  \r\nThe hardest stressed growin'  \r\nThe hustler raisin' on my tears  \r\nI know I'm true, one of your love\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"253\"><span>\uaf64 \uba4b\uc838 \ubcf4\uc774\uc9c0\ub9cc \uac80\uc99d \uc815\ud655\ub3c4\ub97c \ucd94\uc801\ud558\uc9c0 \uc54a\uc558\uae30 \ub54c\ubb38\uc5d0 \uc77c\ubd80 \uc0d8\ud50c\ub9c1\ub41c \ub77c\uc778\uc740 rnn\uc5d0\uc11c \uae30\uc5b5\ud588\uc744 \uc218\ub3c4 \uc788\ub2e4\ub294 \uc810\uc744 \uba85\uc2ec\ud558\uc138\uc694.\ub354 \ub098\uc740 \ubc29\ubc95\uc740 \ud6c8\ub828 \uc911\uc5d0 \uac00\uc7a5 \uc88b\uc740 \uac80\uc99d \uc810\uc218\ub97c \uc81c\uacf5\ud558\ub294 \ubaa8\ub378\uc744 \uc120\ud0dd\ud558\ub294 \uac83\uc785\ub2c8\ub2e4(\uc774\ub7f0 \ubc29\uc2dd\uc73c\ub85c \ud6c8\ub828\uc744 \uc218\ud589\ud55c \ub2e4\uc74c \uc139\uc158\uc758 \ucf54\ub4dc \ucc38\uc870).\ub610\ud55c \ud765\ubbf8\ub85c\uc6b4 \uc0ac\uc2e4 \u200b\u200b\ud558\ub098\ub97c \ubc1c\uacac\ud588\uc2b5\ub2c8\ub2e4.\ubb34\uc870\uac74 \ubaa8\ub378\uc740 \uc77c\ubc18\uc801\uc73c\ub85c \uc9c0\uc815\ub41c \uc2dc\uc791 \ubb38\uc790\uc5f4\ub85c \uc0d8\ud50c\ub9c1\ud560 \ub54c \ub354 \ub098\uc740 \uc131\ub2a5\uc744 \ubcf4\uc785\ub2c8\ub2e4.\uc9c0\uc815\ub41c \uc2dc\uc791 \ubb38\uc790\uc5f4\ub85c \uc870\uac74\ubd80 \ubaa8\ub378\uc5d0\uc11c \uc0d8\ud50c\ub9c1\ud560 \ub54c \uc2e4\uc81c\ub85c \ubaa8\ub378\uc5d0 \ub450 \uac00\uc9c0 \uc870\uac74(\uc2dc\uc791 \ubb38\uc790\uc5f4\uacfc \uc544\ud2f0\uc2a4\ud2b8)\uc744 \uc801\uc6a9\ud55c \ubc18\uba74, \uc774\uc804\uc5d0 \ud0d0\uc0c9\ud55c \ubaa8\ub378\uc758 \uacbd\uc6b0 \ud558\ub098\uc758 \uc870\uac74\ub9cc \uc801\uc6a9\ud588\uc2b5\ub2c8\ub2e4.\uadf8\ub9ac\uace0 \uadf8 \uc870\uac74\ubd80 \ubd84\ud3ec\ub97c \uc798 \ubaa8\ub378\ub9c1\ud560 \ub9cc\ud07c \ucda9\ubd84\ud55c \ub370\uc774\ud130\uac00 \uc5c6\uc5c8\uc2b5\ub2c8\ub2e4(\ubaa8\ub4e0 \uc544\ud2f0\uc2a4\ud2b8\uac00 \ube44\uad50\uc801 \uc81c\ud55c\ub41c \uc218\uc758 \ub178\ub798\ub97c \uac00\uc9c0\uace0 \uc788\uc74c).<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"254\"><span>\uc6b0\ub9ac\ub294 \ucf54\ub4dc\uc640 \ubaa8\ub378\uc744 \uacf5\uac1c\ud558\uace0 \uc788\uc73c\uba70, GPU \uc5c6\uc774\ub3c4 \ud6c8\ub828\ub41c \ubaa8\ub378\uc5d0\uc11c \ub178\ub798\ub97c \uc0d8\ud50c\ub9c1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \uc2e4\uc81c\ub85c \ucef4\ud4e8\ud305 \uce21\uba74\uc5d0\uc11c \ub9ce\uc740 \uc694\uad6c\uac00 \uc5c6\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4.<\/span><\/p>\n<h3 id=\"midi-dataset\" class=\"js-evernote-checked\" data-evernote-id=\"255\"><span>\ubbf8\ub514 \ub370\uc774\ud130 \uc138\ud2b8<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"256\"><span>\ub2e4\uc74c\uc73c\ub85c, \uc6b0\ub9ac\ub294 \ub300\ub7b5 \ud53c\uc544\ub178 \uace1\uc73c\ub85c \uad6c\uc131\ub41c&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"http:\/\/www-etud.iro.umontreal.ca\/~boulanni\/icml2012\" data-evernote-id=\"257\" data-cke-saved-href=\"http:\/\/www-etud.iro.umontreal.ca\/~boulanni\/icml2012\"><span>\uc791\uc740 \ubbf8\ub514 \ub370\uc774\ud130\uc138\ud2b8<\/span><\/a><span>&nbsp;\ub85c \uc791\uc5c5\ud560 \uac83\uc785\ub2c8\ub2e4 . \uc6b0\ub9ac\ub294&nbsp;\ud53c\uc544\ub178 \ub370\uc774\ud130\uc138\ud2b8(\ud2b8\ub808\uc774\ub2dd \ubd84\ud560\ub9cc)\ub97c&nbsp;<\/span><span>\uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4 .<\/span><code class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"258\">Nottingam<\/code><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"259\"><a class=\"js-evernote-checked\" href=\"http:\/\/nbviewer.jupyter.org\/github\/craffel\/pretty-midi\/blob\/master\/Tutorial.ipynb\" data-evernote-id=\"260\" data-cke-saved-href=\"http:\/\/nbviewer.jupyter.org\/github\/craffel\/pretty-midi\/blob\/master\/Tutorial.ipynb\"><span>\ubaa8\ub4e0 \ubbf8\ub514 \ud30c\uc77c\uc744 \ud53c\uc544\ub178 \ub864\ub85c \ubcc0\ud658<\/span><\/a><span>&nbsp;\ud560 \uc218 \uc788\ub2e4\ub294 \uac83\uc774 \ubc1d\ud600\uc84c\uc2b5\ub2c8\ub2e4.&nbsp;\ud53c\uc544\ub178 \ub864\uc740 \uac01 \ud589\uc774 \ub2e4\ub978 \ubbf8\ub514 \ud53c\uce58\uc774\uace0 \uac01 \uc5f4\uc774 \uc2dc\uac04\uc801\uc73c\ub85c \ub2e4\ub978 \uc2ac\ub77c\uc774\uc2a4\uc778 \uc2dc\uac04-\uc8fc\ud30c\uc218 \ud589\ub82c\uc785\ub2c8\ub2e4. \ub530\ub77c\uc11c \ub370\uc774\ud130 \uc138\ud2b8\uc758 \uac01 \ud53c\uc544\ub178 \uace1\uc740 \ud06c\uae30\uc758 \ud589\ub82c\ub85c \ud45c\ud604\ub418\uba70&nbsp;<\/span><span>, \uc5ec\uae30\uc11c \ub294&nbsp;<\/span><span>\ud53c\uc544\ub178\uc758 \ud53c\uce58 \uc218\uc785\ub2c8\ub2e4. \ud53c\uc544\ub178 \ub864 \ud589\ub82c\uc758 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"261\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/68e9df9f67aceb5d8ee14dec872d94d4.png\" alt=\"PNG \ud30c\uc77c\" width=\"424\" height=\"193\" data-autoattach=\"success\" data-evernote-id=\"262\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/68e9df9f67aceb5d8ee14dec872d94d4.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/68e9df9f67aceb5d8ee14dec872d94d4.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"263\"><span>\uc774 \ud45c\ud604\uc740 \uc74c\uc545 \uc774\ub860\uc5d0 \uc775\uc219\ud558\uc9c0 \uc54a\uc740 \uc0ac\ub78c\uc774\ub77c\ub3c4 \ub9e4\uc6b0 \uc9c1\uad00\uc801\uc774\uace0 \ud574\uc11d\ud558\uae30 \uc27d\uc2b5\ub2c8\ub2e4. \uac01 \ud589\uc740 \ud53c\uce58\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4. \uc704\ucabd \ud589\uc740 \uc800\uc8fc\ud30c \ud53c\uce58\ub97c \ub098\ud0c0\ub0b4\uace0 \uc544\ub798\ucabd \ud589\uc740 \uace0\uc8fc\ud30c \ud53c\uce58\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4. \uac8c\ub2e4\uac00 \uc2dc\uac04\uc744 \ub098\ud0c0\ub0b4\ub294 \uc218\ud3c9\ucd95\uc774 \uc788\uc2b5\ub2c8\ub2e4. \ub530\ub77c\uc11c \ud2b9\uc815 \ud53c\uce58\uc758 \uc0ac\uc6b4\ub4dc\ub97c \ud2b9\uc815 \uc2dc\uac04 \ub3d9\uc548 \uc5f0\uc8fc\ud558\uba74 \uc218\ud3c9\uc120\uc774 \ud45c\uc2dc\ub429\ub2c8\ub2e4. \uc804\ubc18\uc801\uc73c\ub85c \uc774\ub294&nbsp;<\/span><a class=\"js-evernote-checked\" title=\"\ub85c\uace0 \ud0c0\uc774\ud2c0 \ud14d\uc2a4\ud2b8 1\" href=\"https:\/\/warmspringwinds.github.io\/pytorch\/rnns\/2018\/01\/27\/learning-to-generate-lyrics-and-music-with-recurrent-neural-networks\/![alt%20text](sampling_temperature.png\" data-evernote-id=\"264\" data-cke-saved-href=\"https:\/\/warmspringwinds.github.io\/pytorch\/rnns\/2018\/01\/27\/learning-to-generate-lyrics-and-music-with-recurrent-neural-networks\/![alt%20text](sampling_temperature.png\"><span>\uc720\ud29c\ube0c\uc758 \ud53c\uc544\ub178 \ud29c\ud1a0\ub9ac\uc5bc<\/span><\/a><span>&nbsp;\uacfc \ub9e4\uc6b0 \uc720\uc0ac\ud569\ub2c8\ub2e4 .<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"265\"><span>\uc774\uc81c \ubb38\uc790 \uc218\uc900 \ubaa8\ub378\uacfc \uc0c8\ub85c\uc6b4 \uc791\uc5c5\uc758 \uc720\uc0ac\uc810\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud604\uc7ac\uc758 \uacbd\uc6b0 \uc774\uc804\uc5d0 \uc5f0\uc8fc\ub41c \ubaa8\ub4e0 \ud53c\uce58\ub97c \uace0\ub824\ud558\uc5ec \ub2e4\uc74c \ud0c0\uc784\uc2a4\ud15d\uc5d0\uc11c \uc5f0\uc8fc\ub420 \ud53c\uce58\ub97c \uc608\uce21\ud574\uc57c \ud569\ub2c8\ub2e4. \ud53c\uc544\ub178 \ub864 \uadf8\ub9bc\uc744 \ubcf4\uba74 \uac01 \uc5f4\uc740 \uc5b4\ub5a4 \uc885\ub958\uc758 \uc74c\uc545\uc801 \uce90\ub9ad\ud130\ub97c \ub098\ud0c0\ub0b4\uba70 \uc774\uc804\uc758 \ubaa8\ub4e0 \uc74c\uc545\uc801 \uce90\ub9ad\ud130\ub97c \uace0\ub824\ud558\uc5ec \ub2e4\uc74c \uc74c\uc545\uc744 \uc608\uce21\ud558\ub824\uace0 \ud569\ub2c8\ub2e4. \ud14d\uc2a4\ud2b8 \ubb38\uc790\uc640 \uc74c\uc545\uc801 \uce90\ub9ad\ud130\uc758 \ucc28\uc774\uc810\uc5d0 \uc8fc\uc758\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uae30\uc5b5\ud558\uc2dc\uaca0\uc9c0\ub9cc \uc5b8\uc5b4 \ubaa8\ub378\uc758 \uac01 \uce90\ub9ad\ud130\ub294 \uc6d0\ud56b \ubca1\ud130\ub85c \ud45c\ud604\ub418\uc5c8\uc2b5\ub2c8\ub2e4(\uc989, \ubca1\ud130\uc5d0\uc11c \ud558\ub098\uc758 \uac12\ub9cc&nbsp;<\/span><span>\uc774\uace0 \ub2e4\ub978 \uac12\uc740 \uc785\ub2c8\ub2e4&nbsp;<\/span><span>). \uc74c\uc545\uc801 \uce90\ub9ad\ud130\uc758 \uacbd\uc6b0 \ud55c \ud0c0\uc784\uc2a4\ud15d\uc5d0\uc11c \uc5ec\ub7ec \ud0a4\ub97c \ub204\ub97c \uc218 \uc788\uc2b5\ub2c8\ub2e4(\ub2e4\uc131\uc74c \ub370\uc774\ud130 \uc138\ud2b8\ub85c \uc791\uc5c5\ud558\uace0 \uc788\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4). \uc774 \uacbd\uc6b0 \uac01 \ud0c0\uc784\uc2a4\ud15d\uc740 \ub450 \uac1c \uc774\uc0c1\uc758 \ub97c \ud3ec\ud568\ud560 \uc218 \uc788\ub294 \ubca1\ud130\ub85c \ud45c\ud604\ub429\ub2c8\ub2e4&nbsp;<\/span><span>.<\/span><\/p>\n<h3 id=\"training-pitch-level-piano-music-model\" class=\"js-evernote-checked\" data-evernote-id=\"266\"><span>\ud53c\uce58 \ub808\ubca8 \ud53c\uc544\ub178 \uc74c\uc545 \ubaa8\ub378 \ud6c8\ub828<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"267\"><span>\ud559\uc2b5\uc744 \uc2dc\uc791\ud558\uae30 \uc804\uc5d0, \uc774\uc804 \uc139\uc158\uc5d0\uc11c \ub17c\uc758\ud55c \ub2e4\uc591\ud55c \uc785\ub825\uc744 \uc124\uba85\ud558\uae30 \uc704\ud574 \uc5b8\uc5b4 \ubaa8\ub378\uc5d0 \uc0ac\uc6a9\ud55c \uc190\uc2e4\uc744 \uc870\uc815\ud574\uc57c \ud569\ub2c8\ub2e4. \uc5b8\uc5b4 \ubaa8\ub378\uc5d0\uc11c, \uac01 \ud0c0\uc784\uc2a4\ud15d\uc5d0 \ub300\ud55c \uc785\ub825\uc73c\ub85c \uc6d0-\ud56b \uc778\ucf54\ub529\ub41c \ud150\uc11c(\ubb38\uc790)\ub97c \uc0ac\uc6a9\ud588\uace0, \ucd9c\ub825(\uc608\uce21\ub41c \ub2e4\uc74c \ubb38\uc790)\uc73c\ub85c \uc6d0-\ud56b \uc778\ucf54\ub529\ub41c \ud150\uc11c\ub97c \uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4. \uc608\uce21\ub41c \ub2e4\uc74c \ubb38\uc790\uc5d0 \ub300\ud574 \ub2e8\uc77c \ubc30\ud0c0\uc801 \uc120\ud0dd\uc744 \ud574\uc57c \ud588\uae30 \ub54c\ubb38\uc5d0,&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/rdipietro.github.io\/friendly-intro-to-cross-entropy-loss\/\" data-evernote-id=\"268\" data-cke-saved-href=\"https:\/\/rdipietro.github.io\/friendly-intro-to-cross-entropy-loss\/\"><span>\uad50\ucc28 \uc5d4\ud2b8\ub85c\ud53c \uc190\uc2e4\uc744<\/span><\/a><span>&nbsp;\uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4 .<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"269\"><span>\ud558\uc9c0\ub9cc \uc774\uc81c \uc6b0\ub9ac \ubaa8\ub378\uc740 \ub354 \uc774\uc0c1 \uc6d0\ud56b \uc778\ucf54\ub529(\uc5ec\ub7ec \ud0a4\ub97c \ub204\ub97c \uc218 \uc788\uc74c)\uc774 \uc544\ub2cc \ubca1\ud130\ub97c \ucd9c\ub825\ud569\ub2c8\ub2e4. \ubb3c\ub860, \ub20c\ub9b0 \ud0a4\uc758 \ubaa8\ub4e0 \uac00\ub2a5\ud55c \uc870\ud569\uc744 \ubcc4\ub3c4\uc758 \ud074\ub798\uc2a4\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\uc9c0\ub9cc, \uc774\ub294 \uc5b4\ub835\uc2b5\ub2c8\ub2e4. \ub300\uc2e0 \ucd9c\ub825 \ubca1\ud130\uc758 \uac01 \uc694\uc18c\ub97c \uc774\uc9c4 \ubcc0\uc218(&nbsp;<\/span><span>&#8211; \ub204\ub984,&nbsp;<\/span><span>&#8211; \ud0a4\ub97c \ub204\ub974\uc9c0 \uc54a\uc74c)\ub85c \ucc98\ub9ac\ud569\ub2c8\ub2e4. \ucd9c\ub825 \ubca1\ud130\uc758 \uac01 \uc694\uc18c\uc5d0 \ub300\ud55c \ubcc4\ub3c4\uc758 \uc190\uc2e4\uc744 \uc774\uc9c4 \uad50\ucc28 \uc5d4\ud2b8\ub85c\ud53c\ub85c \uc815\uc758\ud569\ub2c8\ub2e4. \uadf8\ub9ac\uace0 \ucd5c\uc885 \uc190\uc2e4\uc740 \uc774\ub7ec\ud55c \uc774\uc9c4 \uad50\ucc28 \uc5d4\ud2b8\ub85c\ud53c\uc758 \ud3c9\uade0 \ud569\uacc4\uac00 \ub429\ub2c8\ub2e4. \ub354 \uc798 \uc774\ud574\ud558\uae30 \uc704\ud574 \ucf54\ub4dc\ub97c \uc77d\uc744 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"270\"><span>\uc55e\uc11c \uc5b8\uae09\ud55c \ubcc0\uacbd \uc0ac\ud56d\uc744 \uc801\uc6a9\ud55c \ud6c4, \uc6b0\ub9ac\ub294 \ubaa8\ub378\uc744 \ud6c8\ub828\ud588\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c \uc139\uc158\uc5d0\uc11c\ub294 \uc0d8\ud50c\ub9c1\uc744 \uc218\ud589\ud558\uace0 \uacb0\uacfc\ub97c \uac80\uc0ac\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3 id=\"sampling-from-pitch-level-rnn\" class=\"js-evernote-checked\" data-evernote-id=\"271\"><span>\ud53c\uce58 \ub808\ubca8 RNN\uc5d0\uc11c \uc0d8\ud50c\ub9c1<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"272\"><span>\uc6b0\ub9ac\ub294 \ucd5c\uc801\ud654 \ucd08\uae30 \ub2e8\uacc4\uc5d0\uc11c \ud53c\uc544\ub178 \ub864\uc744 \uc0d8\ud50c\ub9c1\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"273\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/5ad1d8f913bee7a28df907334543c7d5.png\" alt=\"PNG \ud30c\uc77c\" width=\"424\" height=\"189\" data-autoattach=\"success\" data-evernote-id=\"274\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/5ad1d8f913bee7a28df907334543c7d5.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/5ad1d8f913bee7a28df907334543c7d5.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"275\"><span>\uc6b0\ub9ac \ubaa8\ub378\uc774 \ub370\uc774\ud130 \uc138\ud2b8\uc758 \ub178\ub798\uc5d0\uc11c \uacf5\ud1b5\uc801\uc73c\ub85c \ub098\ud0c0\ub098\ub294 \ud558\ub098\uc758 \uacf5\ud1b5 \ud328\ud134\uc744 \ud559\uc2b5\ud558\uae30 \uc2dc\uc791\ud55c \uac83\uc744 \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac01 \ub178\ub798\ub294 \ub450 \uac1c\uc758 \ub2e4\ub978 \ubd80\ubd84\uc73c\ub85c \uad6c\uc131\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. \uccab \ubc88\uc9f8 \ubd80\ubd84\uc5d0\ub294 \ubcc4\ub3c4\ub85c \uc5f0\uc8fc\ub418\uace0 \ub9e4\uc6b0&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.didjshop.com\/BasicMusicalHarmony.html\" data-evernote-id=\"276\" data-cke-saved-href=\"https:\/\/www.didjshop.com\/BasicMusicalHarmony.html\"><span>\uad6c\ubcc4\ub418\uba70 \uc885\uc885 \ubd80\ub97c \uc218 \uc788\ub294<\/span><\/a><span>&nbsp;\ud53c\uce58 \uc2dc\ud000\uc2a4\uac00 \u200b\u200b\ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4 (\uba5c\ub85c\ub514\ub77c\uace0\ub3c4 \ud568). \uc0d8\ud50c\ub9c1\ub41c \ud53c\uc544\ub178 \ub864\uc744 \ubcf4\uba74 \uc774 \ubd80\ubd84\uc774 \ud558\ub2e8\uc5d0\uc11c \uba85\ud655\ud558\uac8c \ubcf4\uc785\ub2c8\ub2e4. \ud53c\uc544\ub178 \ub864\uc758 \uc0c1\ub2e8\ub3c4 \ubcf4\uba74 \uc77c\ubc18\uc801\uc73c\ub85c \ud568\uaed8 \uc5f0\uc8fc\ub418\ub294 \ud53c\uce58 \uadf8\ub8f9\uc774 \ubcf4\uc785\ub2c8\ub2e4. \uc774\uac83\uc740 \uba5c\ub85c\ub514\ub97c \ub3d9\ubc18\ud558\ub294 \ud654\uc74c(\ub178\ub798 \uc804\uccb4\uc5d0\uc11c \ud568\uaed8 \uc5f0\uc8fc\ub418\ub294 \ud53c\uce58)\uc758 \uc9c4\ud589 \ub610\ub294 \ud558\ubaa8\ub2c8\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"277\"><span>\ud6c8\ub828\uc774 \ub05d\ub0a0 \ubb34\ub835 \uc6b0\ub9ac \ubaa8\ub378\uc5d0\uc11c \ucd94\ucd9c\ud55c \uc0d8\ud50c\uc740 \ub2e4\uc74c\uacfc \uac19\uc774 \ubcf4\uc774\uae30 \uc2dc\uc791\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"278\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/f3aa28265f4b650d3011c611ed6f6f58.png\" alt=\"PNG \ud30c\uc77c\" width=\"424\" height=\"189\" data-autoattach=\"success\" data-evernote-id=\"279\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/f3aa28265f4b650d3011c611ed6f6f58.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/f3aa28265f4b650d3011c611ed6f6f58.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"280\"><span>\ubcf4\uc2dc\ub2e4\uc2dc\ud53c \uc774\ub294 \uc774\uc804 \uc139\uc158\uc5d0\uc11c \ubcf4\uc5ec\ub4dc\ub9b0 \uc2e4\uc81c \ud53c\uc544\ub178 \ub864 \uc0ac\uc9c4\uacfc \ub354\uc6b1 \uc720\uc0ac\ud574 \ubcf4\uc774\uae30 \uc2dc\uc791\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"281\"><span>\ud6c8\ub828 \ud6c4, \uc6b0\ub9ac\ub294 \ub178\ub798\ub97c \uc0d8\ud50c\ub9c1\ud558\uace0 \ubd84\uc11d\ud588\uc2b5\ub2c8\ub2e4.&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\" data-evernote-id=\"282\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\"><span>\ud765\ubbf8\ub85c\uc6b4 \uc18c\uac1c\uac00<\/span><\/a><span>&nbsp;\uc788\ub294 \uc0d8\ud50c \ud558\ub098\ub97c \uc5bb\uc5c8\uc2b5\ub2c8\ub2e4 . \ub2e4\ub978 \uc0d8\ud50c\uc740&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=fUdsWVIOeeU&amp;feature=youtu.be&amp;t=15s\" data-evernote-id=\"283\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=fUdsWVIOeeU&amp;feature=youtu.be&amp;t=15s\"><span>\uba4b\uc9c4 \uc2a4\ud0c0\uc77c \uc804\ud658\uc744<\/span><\/a><span>&nbsp;\ud2b9\uc9d5\uc73c\ub85c \ud569\ub2c8\ub2e4 . \ub3d9\uc2dc\uc5d0 \ub0ae\uc740 \uc628\ub3c4 \ub9e4\uac1c\ubcc0\uc218\ub97c \uac00\uc9c4 \uba87 \uac00\uc9c0 \uc608\ub97c \uc0dd\uc131\ud558\uc5ec \ub290\ub9b0 \ud15c\ud3ec\uc758 \ub178\ub798\ub97c \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4.&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=UoLyeauBsNk\" data-evernote-id=\"284\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=UoLyeauBsNk\"><span>\uccab \ubc88\uc9f8<\/span><\/a><span>&nbsp;\uc640&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\" data-evernote-id=\"285\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\"><span>\ub450 \ubc88\uc9f8\ub294 \uc5ec\uae30 \uc788\uc2b5\ub2c8\ub2e4<\/span><\/a><span>&nbsp;. \uc804\uccb4 \uc7ac\uc0dd \ubaa9\ub85d\uc740&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=EOQQOQYvGnw&amp;list=PLJkMX36nfYD000TG-T59hmEgJ3ojkOlBp\" data-evernote-id=\"286\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=EOQQOQYvGnw&amp;list=PLJkMX36nfYD000TG-T59hmEgJ3ojkOlBp\"><span>\uc5ec\uae30 \uc5d0\uc11c<\/span><\/a><span>&nbsp;\ucc3e\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4 .<\/span><\/p>\n<h3 id=\"sequence-length-and-related-problems\" class=\"js-evernote-checked\" data-evernote-id=\"287\"><span>\uc2dc\ud000\uc2a4 \uae38\uc774 \ubc0f \uad00\ub828 \ubb38\uc81c<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"288\"><span>\uc774\uc81c GPU \uba54\ubaa8\ub9ac \uc18c\ube44\uc640 \uc18d\ub3c4 \uad00\uc810\uc5d0\uc11c \ubb38\uc81c\ub97c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"289\"><span>\uc6b0\ub9ac\ub294 \ubc30\uce58\ub85c \uc2dc\ud000\uc2a4\ub97c \ucc98\ub9ac\ud568\uc73c\ub85c\uc368 \uacc4\uc0b0 \uc18d\ub3c4\ub97c \ud06c\uac8c \ub192\uc600\uc2b5\ub2c8\ub2e4. \ub3d9\uc2dc\uc5d0, \uc2dc\ud000\uc2a4\uac00 \u200b\u200b\uae38\uc5b4\uc9c8\uc218\ub85d(\ub370\uc774\ud130 \uc138\ud2b8\uc5d0 \ub530\ub77c \ub2e4\ub984) \ucd5c\ub300 \ubc30\uce58 \ud06c\uae30\uac00 \uac10\uc18c\ud558\uae30 \uc2dc\uc791\ud569\ub2c8\ub2e4. \uc65c \uadf8\ub7f4\uae4c\uc694? \uc5ed\uc804\ud30c\ub97c \uc0ac\uc6a9\ud558\uc5ec \uae30\uc6b8\uae30\ub97c \uacc4\uc0b0\ud560 \ub54c, \uba54\ubaa8\ub9ac \uc18c\ube44\uc5d0 \uac00\uc7a5 \ud070 \uc601\ud5a5\uc744 \ubbf8\uce58\ub294 \ubaa8\ub4e0 \uc911\uac04 \ud65c\ub3d9\uc744 \uc800\uc7a5\ud574\uc57c \ud569\ub2c8\ub2e4. \uc2dc\ud000\uc2a4\uac00 \u200b\u200b\uae38\uc5b4\uc9c8\uc218\ub85d \ub354 \ub9ce\uc740 \ud65c\uc131\ud654\ub97c \uc800\uc7a5\ud574\uc57c \ud558\ubbc0\ub85c \ubc30\uce58\uc5d0 \ub354 \uc801\uc740 \uc608\uc81c\ub97c \ub123\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"290\"><span>\ub54c\ub85c\ub294 \uc815\ub9d0 \uae34 \uc2dc\ud000\uc2a4\ub85c \uc791\uc5c5\ud574\uc57c \ud558\uac70\ub098 \ubc30\uce58 \ud06c\uae30\ub97c \ub298\ub9ac\uac70\ub098, \uc544\ub2c8\uba74 \uc0ac\uc6a9 \uac00\ub2a5\ud55c \uba54\ubaa8\ub9ac \uc591\uc774 \uc801\uc740 GPU\uac00 \ud544\uc694\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uacbd\uc6b0 \uba54\ubaa8\ub9ac \uc18c\ubaa8\ub97c \uc904\uc774\ub294 \uc5ec\ub7ec \uac00\uc9c0 \uac00\ub2a5\ud55c \uc194\ub8e8\uc158\uc774 \uc788\uc9c0\ub9cc, \uc11c\ub85c \ub2e4\ub978 \uc0c1\ucda9 \uad00\uacc4\uac00 \uc788\ub294 \ub450 \uac00\uc9c0\ub97c \uc5b8\uae09\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"291\"><span>\uccab \ubc88\uc9f8\ub294&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.quora.com\/Whats-the-key-difference-between-backprop-and-truncated-backprop-through-time#sLRGO\" data-evernote-id=\"292\" data-cke-saved-href=\"https:\/\/www.quora.com\/Whats-the-key-difference-between-backprop-and-truncated-backprop-through-time#sLRGO\"><span>\uc798\ub9b0 \uc5ed\uc804\ud30c<\/span><\/a><span>&nbsp;\uc785\ub2c8\ub2e4 . \uc544\uc774\ub514\uc5b4\ub294 \uc804\uccb4 \uc2dc\ud000\uc2a4\ub97c \ud558\uc704 \uc2dc\ud000\uc2a4\ub85c \ubd84\ud560\ud558\uace0 \uc774\ub97c \ubcc4\ub3c4\uc758 \ubc30\uce58\ub85c \ucc98\ub9ac\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \ub2e8, \uc774\ub7ec\ud55c \ubc30\uce58\ub97c \ubd84\ud560 \uc21c\uc11c\ub300\ub85c \ucc98\ub9ac\ud558\uace0 \ubaa8\ub4e0 \ub2e4\uc74c \ubc30\uce58\ub294 \uc774\uc804 \ubc30\uce58\uc758 \uc228\uaca8\uc9c4 \uc0c1\ud0dc\ub97c \ucd08\uae30 \uc228\uaca8\uc9c4 \uc0c1\ud0dc\ub85c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \ub610\ud55c \uc774 \uc811\uadfc \ubc29\uc2dd\uc758 \uad6c\ud604\uc744 \uc81c\uacf5\ud558\uc5ec \ub354 \uc798 \uc774\ud574\ud560 \uc218 \uc788\ub3c4\ub85d \ud569\ub2c8\ub2e4. \uc774 \uc811\uadfc \ubc29\uc2dd\uc740 \ubd84\uba85\ud788 \uc804\uccb4 \uc2dc\ud000\uc2a4\ub97c \ucc98\ub9ac\ud558\ub294 \uac83\uacfc \uc815\ud655\ud788 \ub3d9\uc77c\ud558\uc9c0\ub294 \uc54a\uc9c0\ub9cc \ub354 \uc790\uc8fc \uc5c5\ub370\uc774\ud2b8\ud558\uace0 \uba54\ubaa8\ub9ac\ub97c \ub35c \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \ubc18\uba74\uc5d0 \ud55c \ud558\uc704 \uc2dc\ud000\uc2a4\uc758 \uae38\uc774\ub97c \ub118\uc5b4\uc11c\ub294 \uc7a5\uae30 \uc885\uc18d\uc131\uc744 \ud3ec\ucc29\ud558\uc9c0 \ubabb\ud560 \uac00\ub2a5\uc131\uc774 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"293\"><span>\ub450 \ubc88\uc9f8\ub294&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/medium.com\/@yaroslavvb\/fitting-larger-networks-into-memory-583e3c758ff9\" data-evernote-id=\"294\" data-cke-saved-href=\"https:\/\/medium.com\/@yaroslavvb\/fitting-larger-networks-into-memory-583e3c758ff9\"><span>\uadf8\ub798\ub514\uc5b8\ud2b8 \uccb4\ud06c\ud3ec\uc778\ud305<\/span><\/a><span>&nbsp;\uc785\ub2c8\ub2e4 . \uc774 \ubc29\ubc95\uc740 \ub354 \ub9ce\uc740 \uacc4\uc0b0\uc744 \uc218\ud589\ud558\ub294 \ub300\uac00\ub85c \uc804\uccb4 \uc2dc\ud000\uc2a4\uc5d0\uc11c \ubaa8\ub378\uc744 \ud559\uc2b5\ud558\ub294 \ub3d9\uc548 \ub354 \uc801\uc740 \uba54\ubaa8\ub9ac\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uac00\ub2a5\uc131\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \uae30\uc5b5\ud558\uc2dc\uaca0\uc9c0\ub9cc, \uc774\uc804\uc5d0 \ud559\uc2b5\ud558\ub294 \ub3d9\uc548 \uac00\uc7a5 \ub9ce\uc740 \uba54\ubaa8\ub9ac\uac00 \ud65c\uc131\ud654\uc5d0 \uc758\ud574 \ucc28\uc9c0\ub41c\ub2e4\uace0 \uc5b8\uae09\ud588\uc2b5\ub2c8\ub2e4. \uadf8\ub798\ub514\uc5b8\ud2b8 \uccb4\ud06c\ud3ec\uc778\ud305\uc758 \uc544\uc774\ub514\uc5b4\ub294 \ubaa8\ub4e0&nbsp;<\/span><span>-\ubc88\uc9f8 \ud65c\uc131\ud654\ub9cc \uc800\uc7a5\ud558\uace0 \ub098\uc911\uc5d0 \uc800\uc7a5\ub418\uc9c0 \uc54a\uc740 \ud65c\uc131\ud654\ub97c \ub2e4\uc2dc \uacc4\uc0b0\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uc774 \ubc29\ubc95\uc740 \uc774\ubbf8&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/openai\/gradient-checkpointing\" data-evernote-id=\"295\" data-cke-saved-href=\"https:\/\/github.com\/openai\/gradient-checkpointing\"><span>Tensorflow\uc5d0 \uad6c\ud604\ub418\uc5b4<\/span><\/a><span>&nbsp;\uc788\uc73c\uba70&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/pytorch\/pytorch\/pull\/4594\" data-evernote-id=\"296\" data-cke-saved-href=\"https:\/\/github.com\/pytorch\/pytorch\/pull\/4594\"><span>Pytorch\uc5d0 \uad6c\ud604\ub418\uace0 \uc788\uc2b5\ub2c8\ub2e4<\/span><\/a><span>&nbsp;.<\/span><\/p>\n<h3 id=\"conclusion-and-future-work\" class=\"js-evernote-checked\" data-evernote-id=\"297\"><span>\uacb0\ub860 \ubc0f \ud5a5\ud6c4 \uc791\uc5c5<\/span><\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"298\"><span>\uc800\ud76c\uc758 \uc791\uc5c5\uc5d0\uc11c\ub294 \ud14d\uc2a4\ud2b8\uc5d0 \ub300\ud55c \uac04\ub2e8\ud55c \uc0dd\uc131 \ubaa8\ub378\uc744 \ud6c8\ub828\ud558\uace0, \ub2e4\uc131\uc74c\uc545\uc5d0 \ub9de\ucdb0 \ubaa8\ub378\uc744 \ud655\uc7a5\ud588\uc73c\uba70, \uc0d8\ud50c\ub9c1\uc774 \uc791\ub3d9\ud558\ub294 \ubc29\uc2dd\uacfc \uc628\ub3c4 \ub9e4\uac1c\ubcc0\uc218\uac00 \ud14d\uc2a4\ud2b8\uc640 \uc74c\uc545 \uc0d8\ud50c\uc5d0 \uc5b4\ub5a4 \uc601\ud5a5\uc744 \ubbf8\uce58\ub294\uc9c0 \uac04\ub7b5\ud788 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \ub0ae\uc740 \uc628\ub3c4\ub294 \ub354 \uc548\uc815\uc801\uc778 \uacb0\uacfc\ub97c \uc81c\uacf5\ud558\ub294 \ubc18\uba74, \ub192\uc740 \uc628\ub3c4\ub294 \ub354 \ub9ce\uc740 \ubb34\uc791\uc704\uc131\uc744 \ucd94\uac00\ud558\uc5ec \ub54c\ub85c\ub294 \ub9e4\uc6b0 \ud765\ubbf8\ub85c\uc6b4 \uc0d8\ud50c\uc774 \uc0dd\uc131\ub429\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"299\"><span>\ud5a5\ud6c4 \uc791\uc5c5\uc5d0\ub294 \ub450 \uac00\uc9c0 \ubc29\ud5a5\uc774 \ud3ec\ud568\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub354 \ub9ce\uc740 \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8 \ub610\ub294 \uc774\ubbf8 \ud6c8\ub828\ub41c \ubaa8\ub378\uc5d0 \ub300\ud55c \uc2ec\uce35 \ubd84\uc11d\uc785\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \ub3d9\uc77c\ud55c \ubaa8\ub378\uc744 Spotify \uccad\ucde8 \uae30\ub85d\uc5d0 \uc801\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uccad\ucde8 \uae30\ub85d \ub370\uc774\ud130\uc5d0 \ub300\ud55c \ud559\uc2b5\uc774 \ub05d\ub098\uba74 \uc774\uc804 1\uc2dc\uac04 \uc815\ub3c4 \ub3d9\uc548 \ub4e4\uc5c8\ub358 \ub178\ub798 \uc2dc\ud000\uc2a4\ub97c \uc81c\uacf5\ud558\uba74 \ud558\ub8e8 \uc885\uc77c \uc7ac\uc0dd \ubaa9\ub85d\uc744 \uc0d8\ud50c\ub9c1\ud569\ub2c8\ub2e4. \ud0d0\uc0c9 \uae30\ub85d\uc5d0\ub3c4 \ub3d9\uc77c\ud55c \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc788\uc73c\uba70, \ud0d0\uc0c9 \ud589\ub3d9 \ud328\ud134\uc744 \ubd84\uc11d\ud558\ub294 \uba4b\uc9c4 \ub3c4\uad6c\uac00 \ub429\ub2c8\ub2e4. \ub2e4\uc591\ud55c \ud65c\ub3d9(\ud5ec\uc2a4\uc7a5\uc5d0\uc11c \uc6b4\ub3d9, \uc0ac\ubb34\uc2e4\uc5d0\uc11c \uc77c\ud558\uae30, \uc218\uba74)\uc744 \uc218\ud589\ud558\ub294 \ub3d9\uc548 \ud734\ub300\ud3f0\uc5d0\uc11c&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.kaggle.com\/uciml\/human-activity-recognition-with-smartphones\" data-evernote-id=\"300\" data-cke-saved-href=\"https:\/\/www.kaggle.com\/uciml\/human-activity-recognition-with-smartphones\"><span>\uac00\uc18d\ub3c4\uacc4 \ubc0f \uc790\uc774\ub85c\uc2a4\ucf54\ud504 \ub370\uc774\ud130\ub97c \uc218\uc9d1<\/span><\/a><span>&nbsp;\ud558\uace0 \uc774\ub7ec\ud55c \ud65c\ub3d9 \ub2e8\uacc4\ub97c \ubd84\ub958\ud558\ub294 \ubc29\ubc95\uc744 \ud559\uc2b5\ud569\ub2c8\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c \ud65c\ub3d9\uc5d0 \ub530\ub77c \uc74c\uc545 \uc7ac\uc0dd \ubaa9\ub85d\uc744 \uc790\ub3d9\uc73c\ub85c \ubcc0\uacbd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4(\uc218\uba74 &#8211; \ube44 \uc624\ub294 \ucc28\ubd84\ud55c \uc74c\uc545, \ud5ec\uc2a4\uc7a5\uc5d0\uc11c \uc6b4\ub3d9 &#8211; \uace0\uac15\ub3c4 \uc74c\uc545). \uc758\ub8cc \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8\uc758 \uacbd\uc6b0&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC5391725\/\" data-evernote-id=\"301\" data-cke-saved-href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC5391725\/\"><span>\uc774 \uc791\uc5c5<\/span><\/a><span>&nbsp;\uacfc \uc720\uc0ac\ud558\uac8c \ubaa8\ub378\uc744 \uc801\uc6a9\ud558\uc5ec \ub9e5\ubc15 \ubc0f \uae30\ud0c0 \ub370\uc774\ud130\ub97c \uae30\ubc18\uc73c\ub85c \uc2ec\uc7a5 \ubb38\uc81c\ub97c \uac10\uc9c0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4 .<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"302\"><span>\uc74c\uc545 \uc0dd\uc131\uc744 \uc704\ud574 \ud6c8\ub828\ub41c RNN\uc5d0\uc11c \ub274\ub7f0 \ubc1c\ud654\ub97c \ubd84\uc11d\ud558\ub294 \uac83\uc740 \ub9e4\uc6b0 \ud765\ubbf8\ub85c\uc6b8 \uac83\uc785\ub2c8\ub2e4&nbsp;<\/span><a class=\"js-evernote-checked\" href=\"http:\/\/karpathy.github.io\/2015\/05\/21\/rnn-effectiveness\/\" data-evernote-id=\"303\" data-cke-saved-href=\"http:\/\/karpathy.github.io\/2015\/05\/21\/rnn-effectiveness\/\"><span>.<\/span><\/a><span>&nbsp;\ubaa8\ub378\uc774 \uba87 \uac00\uc9c0 \uac04\ub2e8\ud55c \uc74c\uc545 \uac1c\ub150(\ud654\uc131\uacfc \uba5c\ub85c\ub514\uc5d0 \ub300\ud55c \ub17c\uc758\uc640 \uac19\uc740)\uc744 \uc554\ubb35\uc801\uc73c\ub85c \ubc30\uc6e0\ub294\uc9c0 \ud655\uc778\ud558\uae30 \uc704\ud574\uc11c\uc785\ub2c8\ub2e4. RNN\uc758 \uc228\uaca8\uc9c4 \ud45c\ud604\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc74c\uc545 \ub370\uc774\ud130 \uc138\ud2b8\ub97c \ud074\ub7ec\uc2a4\ud130\ub9c1\ud558\uc5ec \uc720\uc0ac\ud55c \ub178\ub798\ub97c \ucc3e\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"304\"><span>\uc774 \uae00\uc744 \ub9c8\ubb34\ub9ac\ud558\uae30 \uc704\ud574 \ubb34\uc870\uac74 \ubaa8\ub378\uc758 \ub9c8\uc9c0\ub9c9 \uac00\uc0ac\ub97c \uc0d8\ud50c\ub9c1\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4 \ud83d\ude00 :<\/span><\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"305\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"306\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"307\"><code class=\"js-evernote-checked\" data-evernote-id=\"308\">The story ends  \r\nThe sound of the blue  \r\nThe tears were shining  \r\nThe story of my life  \r\nI still believe  \r\nThe story of my life <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>[\ucd9c\ucc98]&nbsp;https:\/\/warmspringwinds.github.io\/pytorch\/rnns\/2018\/01\/27\/learning-to-generate-lyrics-and-music-with-recurrent-neural-networks\/<\/p>\n<h1 class=\"js-evernote-checked\" data-evernote-id=\"16\">Learning to generate lyrics and music with Recurrent Neural Networks<\/h1>\n<p class=\"post-meta js-evernote-checked\" data-evernote-id=\"17\"><span class=\"categories js-evernote-checked\" data-evernote-id=\"18\">Pytorch and rnns&nbsp;<\/span>|&nbsp;<span class=\"post-date js-evernote-checked\" data-evernote-id=\"19\">Jan 27, 2018<\/span><\/p>\n<div class=\"post js-evernote-checked\" data-evernote-id=\"20\">\n<p class=\"js-evernote-checked\" data-evernote-id=\"21\">A post showing an application of RNN-based generative models for lyrics and piano music generation.<\/p>\n<hr class=\"js-evernote-checked\" data-evernote-id=\"415\">\n<h3 id=\"introduction\" class=\"js-evernote-checked\" data-evernote-id=\"22\">Introduction<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"23\">In this post we will train RNN character-level language model on lyrics dataset of most popular\/recent artists. Having a trained model, we will sample a couple of songs which will be a funny mixture of different styles of different artists. After that we will update our model to become a conditional character-level RNN, making it possible for us to sample songs conditioned on artist. And finally, we conclude by training our model on midi dataset of piano songs. While solving all these tasks, we will briefly explore some interesting concepts related to RNN training and inference like character-level RNN, conditional character-level RNN, sampling from RNN, truncated backpropagation through time and gradient checkpointing. All the code and trained models are&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\" data-evernote-id=\"24\" data-cke-saved-href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\">available on github<\/a>&nbsp;and were implemented in&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/pytorch.org\/\" data-evernote-id=\"25\" data-cke-saved-href=\"http:\/\/pytorch.org\/\">Pytorch<\/a>. The blog post can also&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\/blob\/master\/blog_post.ipynb\" data-evernote-id=\"26\" data-cke-saved-href=\"https:\/\/github.com\/warmspringwinds\/pytorch-rnn-sequence-generation-classification\/blob\/master\/blog_post.ipynb\">be viewed in a jupyter notebook format<\/a>. If you are already familiar with the character-level language model and recurrent neural networks, feel free to skip respective sections or go directly to the results section.<\/p>\n<h3 id=\"character-level-language-model\" class=\"js-evernote-checked\" data-evernote-id=\"27\">Character-Level language model<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"28\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/abe3eb1f57373aabdf1ba69a0968471b.jpg\" alt=\"png\" width=\"594\" height=\"95\" data-autoattach=\"success\" data-evernote-id=\"29\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/abe3eb1f57373aabdf1ba69a0968471b.jpg\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/abe3eb1f57373aabdf1ba69a0968471b.jpg\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"30\">Before choosing a model, let\u2019s have a closer look at our task. Given current letter and all previous letters, we will try to predict the next character. During training we will just take a sequence, and use all its characters except the last one as an input and the same sequence starting from the second character as groundtruth (see the picture above;&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\" data-evernote-id=\"31\" data-cke-saved-href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\">Source<\/a>). We will start from the simplest model that ignores all the previous characters while making a prediction, improve this model to make it take only a certain number of previous characters into account, and conclude with a model that takes all the previous characters into consideration while making a prediction.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"32\">Our language model is defined on a character level. We will create a dictionary which will contain all English characters plus some special symbols, like period, comma, and end-of-line symbol. Each charecter will be represented as one-hot-encoded tensor. For more information about character-level models and examples, I recommend&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/spro\/practical-pytorch\" data-evernote-id=\"33\" data-cke-saved-href=\"https:\/\/github.com\/spro\/practical-pytorch\">this resource<\/a>.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"34\">Having characters, we can now form sequences of characters. We can generate sentences even now just by randomly sampling character after character with a fixed probability&nbsp;. That\u2019s the most simple character level language model. Can we do better than this? Yes, we can compute the probabily of occurance of each letter from our training corpus (number of times a letter occures divided by the size of our dataset) and randomly sample letter using these probabilities. This model is better but it totally ignores the relative positional aspect of each letter. For example, pay attention on how you read any word: you start with the first letter, which is usually hard to predict, but as you reach the end of a word you can sometimes guess the next letter. When you read any word you are implicitly using some rules which you learned by reading other texts: for example, with each additional letter that you read from a word, the probability of a space character increases (really long words are rare) or the probability of any consonant after the letter \u201cr\u201d is low as it usually followed by vowel. There are lot of similar rules and we hope that our model will be able to learn them from data. To give our model a chance to learn these rules we need to extend it.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"35\">Let\u2019s make a small gradual improvement of our model and let probability of each letter depend only on the previously occured letter (<a class=\"js-evernote-checked\" href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_property\" data-evernote-id=\"36\" data-cke-saved-href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_property\">markov assumption<\/a>). So, basically we will have&nbsp;. This is a&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\" data-evernote-id=\"37\" data-cke-saved-href=\"https:\/\/en.wikipedia.org\/wiki\/Markov_chain\">Markov chain model<\/a>&nbsp;(also try these&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/setosa.io\/ev\/markov-chains\/\" data-evernote-id=\"38\" data-cke-saved-href=\"http:\/\/setosa.io\/ev\/markov-chains\/\">interactive visualizations<\/a>&nbsp;if you are not familiar with it). We can also estimate the probability distribution&nbsp;from our training dataset. This model is limited because in most cases the probability of the current letter depends not only on the previous letter.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"39\">What we would like to model is actually&nbsp;. At first, the task seems intractable as the number of previous letters is variable and it might become really large in case of long sequences. Turns out Reccurent Neural Netoworks can tackle this problem to a certain extent by using shared weights and fixed size hidden state. This leads us to a next section dedicated to RNNs.<\/p>\n<h3 id=\"recurrent-neural-networks\" class=\"js-evernote-checked\" data-evernote-id=\"40\">Recurrent Neural Networks<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"41\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/1b387166ef74af40cc791e6b62f98c2e.jpg\" alt=\"png\" width=\"768\" height=\"308\" data-autoattach=\"success\" data-evernote-id=\"42\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/1b387166ef74af40cc791e6b62f98c2e.jpg\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/1b387166ef74af40cc791e6b62f98c2e.jpg\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"43\">Recurrent neural networks are a family of neural networks for processing sequential data. Unlike feedforward neural networks, RNNs can use their internal memory to process arbitrary sequences of inputs. Because of arbitrary size input sequences, they are concisely depicted as a graph with a cycle (see the picture;&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\" data-evernote-id=\"44\" data-cke-saved-href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\">Source<\/a>). But they can be \u201cunfolded\u201d if the size of input sequence is known. They define a non-linear mapping from a current input&nbsp;and previous hidden state&nbsp;to the output&nbsp;and current hidden state&nbsp;. Hidden state size has a predefined size and stores features which are updated on each step and affect the result of mapping.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"45\">Now align the previous picture of the character-level language model and the ufolded RNN picture to see how we are using the RNN model to learn a character level language model.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"46\">While the picture depicts the Vanilla RNN, we will use LSTM in our work as it is easier to train usually achieves better results.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"47\">For a more elaborate introduction to RNNs, we refer reader to the&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\" data-evernote-id=\"48\" data-cke-saved-href=\"http:\/\/www.wildml.com\/2015\/09\/recurrent-neural-networks-tutorial-part-1-introduction-to-rnns\/\">following resource<\/a>.<\/p>\n<h3 id=\"lyrics-dataset\" class=\"js-evernote-checked\" data-evernote-id=\"49\">Lyrics dataset<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"50\">For our experiments we have chosen&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.kaggle.com\/mousehead\/songlyrics\" data-evernote-id=\"51\" data-cke-saved-href=\"https:\/\/www.kaggle.com\/mousehead\/songlyrics\">55000+ Song Lyrics Kaggle dataset<\/a>&nbsp;which contains good variety of recent artists and more older ones. It is stored as a pandas file and we wrote a python wrapper around it to be able to use it for training purposes. You will have to download it yourself in order to be able to use our code.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"52\">In order to be able to interpret the results better, I have chosen a subset of artists which I am more or less familiar with:<\/p>\n<div class=\"language-python highlighter-rouge js-evernote-checked\" data-evernote-id=\"53\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"54\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"55\"><code class=\"js-evernote-checked\" data-evernote-id=\"56\"><span class=\"n js-evernote-checked\" data-evernote-id=\"57\">artists<\/span> <span class=\"o js-evernote-checked\" data-evernote-id=\"58\">=<\/span> <span class=\"p js-evernote-checked\" data-evernote-id=\"59\">[<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"60\">'ABBA'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"61\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"62\">'Ace Of Base'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"63\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"64\">'Aerosmith'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"65\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"66\">'Avril Lavigne'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"67\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"68\">'Backstreet Boys'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"69\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"70\">'Bob Marley'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"71\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"72\">'Bon Jovi'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"73\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"74\">'Britney Spears'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"75\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"76\">'Bruno Mars'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"77\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"78\">'Coldplay'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"79\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"80\">'Def Leppard'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"81\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"82\">'Depeche Mode'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"83\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"84\">'Ed Sheeran'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"85\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"86\">'Elton John'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"87\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"88\">'Elvis Presley'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"89\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"90\">'Eminem'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"91\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"92\">'Enrique Iglesias'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"93\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"94\">'Evanescence'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"95\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"96\">'Fall Out Boy'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"97\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"98\">'Foo Fighters'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"99\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"100\">'Green Day'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"101\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"102\">'HIM'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"103\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"104\">'Imagine Dragons'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"105\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"106\">'Incubus'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"107\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"108\">'Jimi Hendrix'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"109\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"110\">'Justin Bieber'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"111\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"112\">'Justin Timberlake'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"113\">,<\/span>\r\n<span class=\"s js-evernote-checked\" data-evernote-id=\"114\">'Kanye West'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"115\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"116\">'Katy Perry'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"117\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"118\">'The Killers'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"119\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"120\">'Kiss'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"121\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"122\">'Lady Gaga'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"123\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"124\">'Lana Del Rey'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"125\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"126\">'Linkin Park'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"127\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"128\">'Madonna'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"129\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"130\">'Marilyn Manson'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"131\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"132\">'Maroon 5'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"133\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"134\">'Metallica'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"135\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"136\">'Michael Bolton'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"137\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"138\">'Michael Jackson'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"139\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"140\">'Miley Cyrus'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"141\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"142\">'Nickelback'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"143\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"144\">'Nightwish'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"145\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"146\">'Nirvana'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"147\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"148\">'Oasis'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"149\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"150\">'Offspring'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"151\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"152\">'One Direction'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"153\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"154\">'Ozzy Osbourne'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"155\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"156\">'P!nk'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"157\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"158\">'Queen'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"159\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"160\">'Radiohead'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"161\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"162\">'Red Hot Chili Peppers'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"163\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"164\">'Rihanna'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"165\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"166\">'Robbie Williams'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"167\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"168\">'Rolling Stones'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"169\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"170\">'Roxette'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"171\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"172\">'Scorpions'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"173\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"174\">'Snoop Dogg'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"175\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"176\">'Sting'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"177\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"178\">'The Script'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"179\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"180\">'U2'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"181\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"182\">'Weezer'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"183\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"184\">'Yellowcard'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"185\">,<\/span>\r\n <span class=\"s js-evernote-checked\" data-evernote-id=\"186\">'ZZ Top'<\/span><span class=\"p js-evernote-checked\" data-evernote-id=\"187\">]<\/span>\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<h3 id=\"training-unconditional-character-level-language-model\" class=\"js-evernote-checked\" data-evernote-id=\"188\">Training unconditional character-level language model<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"189\">Our first experiment consisted of training of our character-level language model RNN on the whole corpus. We didn\u2019t take into consideration the artist information while training.<\/p>\n<h3 id=\"sampling-from-rnn\" class=\"js-evernote-checked\" data-evernote-id=\"190\">Sampling from RNN<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"191\">Let\u2019s try to sample a couple of songs after training our model. Basically, on each step our RNN will output logits and we can softmax them and sample from that distribution. Or we can use Gumble-Max trick and&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/hips.seas.harvard.edu\/blog\/2013\/04\/06\/the-gumbel-max-trick-for-discrete-distributions\/\" data-evernote-id=\"192\" data-cke-saved-href=\"https:\/\/hips.seas.harvard.edu\/blog\/2013\/04\/06\/the-gumbel-max-trick-for-discrete-distributions\/\">sample using logits directly<\/a>&nbsp;which is equivalent.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"193\">One intersting thing about sampling is that we can partially define the input sequence ourselves and start sampling with that initial condition. For example, we can sample a song that starts with \u201cWhy\u201d:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"194\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"195\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"196\"><code class=\"js-evernote-checked\" data-evernote-id=\"197\">Why do you have to leave me?  \r\nI think I know I'm not the only one  \r\nI don't know if I'm gonna stay awake  \r\nI don't know why I go along  \r\n  \r\nI don't know why I can't go on  \r\nI don't know why I don't know  \r\nI don't know why I don't know  \r\nI don't know why I keep on dreaming of you   \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"198\">Well, that sounds like a possible song \ud83d\ude00<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"199\">Let\u2019s sample with a song that starts with \u201cWell\u201d:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"200\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"201\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"202\"><code class=\"js-evernote-checked\" data-evernote-id=\"203\">Well, I was a real good time  \r\nI was a rolling stone  \r\nI was a rock and roller  \r\nWell, I never had a rock and roll  \r\nThere were times I had to do it  \r\nI had a feeling that I was found  \r\nI was the one who had to go  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"204\">There is \u201ctemperature\u201d parameter that is used during sampling which controls the randomness of sampling process. When this parameter approaches zero, the sampling is equivalent to argmax and when it is close to infinity the sampling is equivalent to sampling from a uniform distribution. Have a look at the figure from a&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/arxiv.org\/pdf\/1611.01144.pdf\" data-evernote-id=\"205\" data-cke-saved-href=\"https:\/\/arxiv.org\/pdf\/1611.01144.pdf\">relevant paper by Jang et al.<\/a>:<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"206\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/2ab8b692c3c9bfe5e30b15ac4d35dcdc.png\" alt=\"png\" width=\"443\" height=\"95\" data-autoattach=\"success\" data-evernote-id=\"207\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/2ab8b692c3c9bfe5e30b15ac4d35dcdc.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/2ab8b692c3c9bfe5e30b15ac4d35dcdc.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"208\">When&nbsp;, the distribution is not affected. If we decrease&nbsp;, the distribution becomes more pronounced, meaning that value with bigger probability mass will have it increased. When&nbsp;will approach zero, sampling will be equivalent to armax, because the probability of that value will be close to one. When we start to icrease&nbsp;the distribution becomes more and more uniform.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"209\">The previous sample was generated with a temperature paramter equal to&nbsp;. Let\u2019s see what happens when we increase it to&nbsp;and sample:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"210\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"211\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"212\"><code class=\"js-evernote-checked\" data-evernote-id=\"213\">Why can't we drop out of time?  \r\nWe were born for words to see.  \r\nWon't you love this. You're still so amazing.  \r\nThis could be that down on Sunday Time.  \r\nOh, Caroline, a lady floor.  \r\nI thought of love, oh baby.  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"214\">Let\u2019s try increasing it even more:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"215\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"216\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"217\"><code class=\"js-evernote-checked\" data-evernote-id=\"218\">Why - won't we grow up naked?  \r\nWe went quietly what we would've still give  \r\nThat girl you walked before our bedroom room  \r\nI see your mind is so small to a freak  \r\nStretching for a cold white-heart of crashing  \r\nTruth in the universal daughter  \r\n  \r\nI lose more and more hard  \r\nI love you anytime at all  \r\nAh come let your help remind me  \r\nNow I've wanted waste and never noticed  \r\n  \r\nI swear I saw you today  \r\nYou needed to get by  \r\nBut you sold a hurricane  \r\nWell out whispered in store\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"219\">Why don\u2019t we grow up naked, indeed? \ud83d\ude00 Well, you can see that trend that when we increase the temperature, sampled sentences become more and more random.<\/p>\n<h3 id=\"training-conditional-character-level-language-model\" class=\"js-evernote-checked\" data-evernote-id=\"220\">Training conditional character-level language model<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"221\">Imagine if we could generate lyrics in a style of some particular artist. Let\u2019s change our model, so that it can use this information during training.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"222\">We will do this by adding an additional input to our RNN. So far, our RNN model was only accepting tensors containing one-hot encoded character on each step.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"223\">The extention to our model will be very simple: we will have and additional one-hot encoded tensor which will represent the artist. So on each step the RNN will accept one tensor which will consist of concatenated tensors representing character and artist. Look&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\" data-evernote-id=\"224\" data-cke-saved-href=\"https:\/\/github.com\/spro\/practical-pytorch\/blob\/master\/conditional-char-rnn\/conditional-char-rnn.ipynb\">here for more<\/a>.<\/p>\n<h3 id=\"sampling-from-conditional-language-model-rnn\" class=\"js-evernote-checked\" data-evernote-id=\"225\">Sampling from conditional language model RNN<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"226\">After training, we sampled a couple of songs conditined on artist. Below you can find some results.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"227\">Him:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"228\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"229\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"230\"><code class=\"js-evernote-checked\" data-evernote-id=\"231\">My fears  \r\nAnd the moment don't make me sing  \r\nSo free from you  \r\nThe pain you love me yeah  \r\n  \r\nWhatever caused the warmth  \r\nYou smile you're happy  \r\nYou sit away  \r\nYou say it's all in vain  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"232\">Seems really possible, especially the fact the the word pain was used, which is very common in the lyrics of the artist.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"233\">ABBA:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"234\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"235\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"236\"><code class=\"js-evernote-checked\" data-evernote-id=\"237\">Oh, my love it makes me close a thing  \r\nYou've been heard, I must have waited  \r\nI hear you  \r\nSo I say  \r\nThank you for the music, that makes me cry  \r\n  \r\nAnd you moving my bad as me, ah-hang wind in the hell  \r\nI was meant to be with you, I'll never be playing up\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"238\">Bob Marley:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"239\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"240\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"241\"><code class=\"js-evernote-checked\" data-evernote-id=\"242\">Mercy on judgment, we got so much  \r\n  \r\nAlcohol, cry, cry, cry  \r\nWhy don't try to find our own  \r\nI want to know, Lord, I wanna give you  \r\nJust saving it, learned  \r\nIs there any more?  \r\n  \r\nAll that damage done  \r\nThat's all reason, don't worry  \r\nNeed a hammer  \r\nI need you more and more  \r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"243\">Coldplay:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"244\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"245\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"246\"><code class=\"js-evernote-checked\" data-evernote-id=\"247\">Look at the stars  \r\nInto life matter where you lay  \r\nSaying no doubt  \r\nI don't want to fly  \r\nIn my dreams and fight today\r\n\r\nI will fall for you  \r\n  \r\nAll I know  \r\nAnd I want you to stay  \r\nInto the night  \r\n  \r\nI want to live waiting  \r\nWith my love and always  \r\nHave I wouldn't wasted  \r\nWould it hurt you\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"248\">Kanye West:<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"249\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"250\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"251\"><code class=\"js-evernote-checked\" data-evernote-id=\"252\">I'm everywhere for you  \r\nThe way that it couldn't stop  \r\nI mean it too late and love I made in the world  \r\nI told you so I took the studs full cold-stop  \r\nThe hardest stressed growin'  \r\nThe hustler raisin' on my tears  \r\nI know I'm true, one of your love\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p class=\"js-evernote-checked\" data-evernote-id=\"253\">Looks pretty cool but keep in mind that we didn\u2019t track the validation accuracy so some sampled lines could have been just memorized by our rnn. A better way to do it is to pick a model that gives best validation score during training (see the code for the next section where we performed training this way). We also noticed one interesting thing: the unconditional model usually performes better when you want to sample with a specified starting string. Our intuition is that when sampling from a conditional model with a specified starting string, we actually put two conditions on our model \u2013 starting string and an artist compared to the one condition in the case of previous model that we explored. And we didn\u2019t have enough data to model that conditional distribution well (every artist has relatively limited number of songs).<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"254\">We are making the code and models available and you can sample songs from our trained models even without gpu as it is not really computationally demanding.<\/p>\n<h3 id=\"midi-dataset\" class=\"js-evernote-checked\" data-evernote-id=\"255\">Midi dataset<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"256\">Next, we will work with a&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/www-etud.iro.umontreal.ca\/~boulanni\/icml2012\" data-evernote-id=\"257\" data-cke-saved-href=\"http:\/\/www-etud.iro.umontreal.ca\/~boulanni\/icml2012\">small midi dataset<\/a>&nbsp;consisting of approximately&nbsp;piano songs. We have used the&nbsp;<code class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"258\">Nottingam<\/code>&nbsp;piano dataset (training split only).<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"259\">Turns out that any midi file can be&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/nbviewer.jupyter.org\/github\/craffel\/pretty-midi\/blob\/master\/Tutorial.ipynb\" data-evernote-id=\"260\" data-cke-saved-href=\"http:\/\/nbviewer.jupyter.org\/github\/craffel\/pretty-midi\/blob\/master\/Tutorial.ipynb\">converted to piano roll<\/a>&nbsp;which is just is a time-frequency matrix where each row is a different MIDI pitch and each column is a different slice in time. So each piano song from our dataset will be represented as a matrix of size&nbsp;, where&nbsp;is a number of pitches of the piano. Here is an example of piano roll matrix:<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"261\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/68e9df9f67aceb5d8ee14dec872d94d4.png\" alt=\"png\" width=\"424\" height=\"193\" data-autoattach=\"success\" data-evernote-id=\"262\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/68e9df9f67aceb5d8ee14dec872d94d4.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/68e9df9f67aceb5d8ee14dec872d94d4.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"263\">This representation is very intuitive and easy to interpret even for a person that is not familiar with music theory. Each row represents a pitch: top rows represent low frequency pitches and bottom rows represent high pitches. Plus, we have a horizontal axis which represents time. So if we play a sound with a certain pitch for a certian period of time, we will see a horizontal line. Overall, this is very similar to&nbsp;<a class=\"js-evernote-checked\" title=\"Logo Title Text 1\" href=\"https:\/\/warmspringwinds.github.io\/pytorch\/rnns\/2018\/01\/27\/learning-to-generate-lyrics-and-music-with-recurrent-neural-networks\/![alt%20text](sampling_temperature.png\" data-evernote-id=\"264\" data-cke-saved-href=\"https:\/\/warmspringwinds.github.io\/pytorch\/rnns\/2018\/01\/27\/learning-to-generate-lyrics-and-music-with-recurrent-neural-networks\/![alt%20text](sampling_temperature.png\">piano tutorials on youtube<\/a>.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"265\">Now, let\u2019s try to see the similarities between the character-level model and our new task. In the current case, we will have to predict the pitches that will be played on the next timestep, given all the previously played pitches. So, if you look at the picture of the piano roll, each column represents some kind of a musical character and given all the previous musical characters, we want to predict the next one. Let\u2019s pay attention to the difference between a text character and a musical character. If you recall, each character in our language model was represented by one-hot vector (meaning that only one value in our vector is&nbsp;and others are&nbsp;). For music character multiple keys can be pressed at one timestep (since we are working with polyphonic dataset). In this case, each timestep will be represented by a vector which can contain more than one&nbsp;.<\/p>\n<h3 id=\"training-pitch-level-piano-music-model\" class=\"js-evernote-checked\" data-evernote-id=\"266\">Training pitch-level piano music model<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"267\">Before starting the training, we will have to adjust our loss that we have used for language model to account for different input that we discussed in the previous section. In the language model, we had one-hot encoded tensor (character) as an input on each timestep and one-hot encoded tensor as output (predicted next character). As we had to make a single exlusive choice for predicted next character, we used&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/rdipietro.github.io\/friendly-intro-to-cross-entropy-loss\/\" data-evernote-id=\"268\" data-cke-saved-href=\"https:\/\/rdipietro.github.io\/friendly-intro-to-cross-entropy-loss\/\">cross-entropy loss<\/a>.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"269\">But now our model outputs a vector which is no longer one-hot encoded (multiple keys can be pressed). Of course, we can treat all possible combinations of pressed keys as a separate class, but this is intractable. Instead, we will treat each element of the output vector as a binary variable (&nbsp;\u2013 pressing,&nbsp;\u2013 not pressing a key). We will define a separate loss for each element of the output vector to be binary cross-entropy. And our final loss will be an averaged sum of these binary cross-entropies. You can also read the code to get a better understanding.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"270\">After making the aforementioned changes, we trained our model. In the next section, we will perform sampling and inspect the results.<\/p>\n<h3 id=\"sampling-from-pitch-level-rnn\" class=\"js-evernote-checked\" data-evernote-id=\"271\">Sampling from pitch-level RNN<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"272\">We have sampled piano rolls during the early stages of optimization:<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"273\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/5ad1d8f913bee7a28df907334543c7d5.png\" alt=\"png\" width=\"424\" height=\"189\" data-autoattach=\"success\" data-evernote-id=\"274\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/5ad1d8f913bee7a28df907334543c7d5.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/5ad1d8f913bee7a28df907334543c7d5.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"275\">You can see that our model is starting to learn one common pattern that is common among the songs from our dataset: each song consists of two different parts. First part contains a sequence of pitches that are played separately and are very&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.didjshop.com\/BasicMusicalHarmony.html\" data-evernote-id=\"276\" data-cke-saved-href=\"https:\/\/www.didjshop.com\/BasicMusicalHarmony.html\">distinguishable and are often singable<\/a>&nbsp;(also know as melody). If you look at the sampled piano roll, this part can be clearly seen in the bottom. If you also have a look at the top of our piano roll, we can see a group of pitches that are usually played together \u2013 this is harmony or a progression of chords (pitches that are played together throughout the song) which accompanies the melody.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"277\">By the end of the training samples drawn from our model started to look like this:<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"278\"><img loading=\"lazy\" decoding=\"async\" class=\"js-evernote-checked\" src=\"https:\/\/www.stechstar.com\/user\/zbxe\/files\/attach\/images\/3151\/784\/104\/f3aa28265f4b650d3011c611ed6f6f58.png\" alt=\"png\" width=\"424\" height=\"189\" data-autoattach=\"success\" data-evernote-id=\"279\" data-evernote-lazy-src=\".\/files\/attach\/images\/3151\/784\/104\/f3aa28265f4b650d3011c611ed6f6f58.png\" data-cke-saved-src=\".\/files\/attach\/images\/3151\/784\/104\/f3aa28265f4b650d3011c611ed6f6f58.png\"><\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"280\">As you can see they started to look more similar to the picture of the ground-truth piano roll that we showed in the previous sections.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"281\">After training, we have sampled songs and analyzed them. We got one sample with&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\" data-evernote-id=\"282\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\">an interesting introduction<\/a>. While another sample features&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=fUdsWVIOeeU&amp;feature=youtu.be&amp;t=15s\" data-evernote-id=\"283\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=fUdsWVIOeeU&amp;feature=youtu.be&amp;t=15s\">a nice style transition<\/a>. At the same time we generated a couple of examples with low temperature parameter which resulted in songs with a slow tempo:&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=UoLyeauBsNk\" data-evernote-id=\"284\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=UoLyeauBsNk\">first one<\/a>&nbsp;and a&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\" data-evernote-id=\"285\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=Iz8xQou2OqA\">second one here<\/a>. You can find the whole playlist&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.youtube.com\/watch?v=EOQQOQYvGnw&amp;list=PLJkMX36nfYD000TG-T59hmEgJ3ojkOlBp\" data-evernote-id=\"286\" data-cke-saved-href=\"https:\/\/www.youtube.com\/watch?v=EOQQOQYvGnw&amp;list=PLJkMX36nfYD000TG-T59hmEgJ3ojkOlBp\">here<\/a>.<\/p>\n<h3 id=\"sequence-length-and-related-problems\" class=\"js-evernote-checked\" data-evernote-id=\"287\">Sequence length and related problems<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"288\">Now let\u2019s look at our problem from the gpu memory consumption and speed point of view.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"289\">We greatly speed up computation by processing our sequences in batches. At the same time, as our sequences become longer (depending on the dataset), our max batch size starts to decrease. Why is it a case? As we use backpropagation to compute gradients, we need to store all the intermediate acitvations, which contribute the most to the memory consumption. As our sequence becomes longer, we need to store more activations, therefore, we can fit less examples in our batch.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"290\">Sometimes, we either have to work with really long sequences or we want to increase our batch size or maybe you just have a gpu with small amount of memory available. There are multiple possible solutions to reduce memory consumption in this case, but we will mention two, which will have different trade-offs.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"291\">First one is a&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.quora.com\/Whats-the-key-difference-between-backprop-and-truncated-backprop-through-time#sLRGO\" data-evernote-id=\"292\" data-cke-saved-href=\"https:\/\/www.quora.com\/Whats-the-key-difference-between-backprop-and-truncated-backprop-through-time#sLRGO\">truncated back propagation<\/a>. The idea is to split the whole sequence into subsequences and treat them as separate batches with an exception that we process these batches in the order of split and every next batch uses hidden state of previous batch as an initial hidden state. We also provide an implementation of this approach, so that you can get the better understanding. This approach is obviously not an exact equivalent of processing the whole sequence but it makes more frequent updates and consumes less memory. On the other hand, there is a chance that we might not be able to capture long-term dependencies that span beyond the length of one subsequence.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"293\">Second one is&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/medium.com\/@yaroslavvb\/fitting-larger-networks-into-memory-583e3c758ff9\" data-evernote-id=\"294\" data-cke-saved-href=\"https:\/\/medium.com\/@yaroslavvb\/fitting-larger-networks-into-memory-583e3c758ff9\">gradient checkpointing<\/a>. This method gives us a possibilty to use less memory while training our model on the whole sequence on the expence of performing more computation. If you recall, previously we mentioned that the most memory during training is occupied by activations. The idea of gradient checkpointing consists of storing only every&nbsp;-th activation and recomputing the unsaved activations later. This method is already&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/openai\/gradient-checkpointing\" data-evernote-id=\"295\" data-cke-saved-href=\"https:\/\/github.com\/openai\/gradient-checkpointing\">implemented in Tensorflow<\/a>&nbsp;and&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/github.com\/pytorch\/pytorch\/pull\/4594\" data-evernote-id=\"296\" data-cke-saved-href=\"https:\/\/github.com\/pytorch\/pytorch\/pull\/4594\">being implemented in Pytorch<\/a>.<\/p>\n<h3 id=\"conclusion-and-future-work\" class=\"js-evernote-checked\" data-evernote-id=\"297\">Conclusion and future work<\/h3>\n<p class=\"js-evernote-checked\" data-evernote-id=\"298\">In our work we trained simple generative model for text, extended our model to work with polyphonic music, briefly looked at how sampling works and how the temperature parameter affects our text and music samples \u2013 low temperature gives more stable results while high temperature adds more randomness which sometimes gives rise to very interesting samples.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"299\">Future work can include two directions \u2013 more applications or deeper analysis of the already trained models. Same models can be applied to your spotify listening history, for example. After training on your listening history data, you can give it a sequence of songs that you have listened to in the previous hour or so, and it will sample a playlist for you for the rest of the day. Well, you can also do the same for your browsing history, which will be just a cool tool to analyze your browsing behaviour patterns.&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.kaggle.com\/uciml\/human-activity-recognition-with-smartphones\" data-evernote-id=\"300\" data-cke-saved-href=\"https:\/\/www.kaggle.com\/uciml\/human-activity-recognition-with-smartphones\">Capture the accelerometer and gyroscope data<\/a>&nbsp;from your phone while doing different activities (exercising in the gym, working in the office, sleeping) and learn to classify these activity stages. After that you can change your music playlist automatically, based on your activity (sleeping \u2013 calm music of rain, exercising in the gym \u2013 high intensity music). In terms of medical applications, model can be applied to detect heart problems based on pulse and other data, similar to&nbsp;<a class=\"js-evernote-checked\" href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC5391725\/\" data-evernote-id=\"301\" data-cke-saved-href=\"https:\/\/www.ncbi.nlm.nih.gov\/pmc\/articles\/PMC5391725\/\">this work<\/a>.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"302\">It would be very interesting to analyze the neuron firings in our RNN trained for music generation like&nbsp;<a class=\"js-evernote-checked\" href=\"http:\/\/karpathy.github.io\/2015\/05\/21\/rnn-effectiveness\/\" data-evernote-id=\"303\" data-cke-saved-href=\"http:\/\/karpathy.github.io\/2015\/05\/21\/rnn-effectiveness\/\">here<\/a>. To see if the model learned some simple music concepts implicitly (like our discussion of harmony and melody). The hidden representation of RNN can be used to cluster our music dataset to find similar songs.<\/p>\n<p class=\"js-evernote-checked\" data-evernote-id=\"304\">Let\u2019s sample one last lyrics from our unconditional model to conclude this post \ud83d\ude00 :<\/p>\n<div class=\"highlighter-rouge js-evernote-checked\" data-evernote-id=\"305\">\n<div class=\"highlight js-evernote-checked\" data-evernote-id=\"306\">\n<pre class=\"highlight js-evernote-checked\" data-evernote-id=\"307\"><code class=\"js-evernote-checked\" data-evernote-id=\"308\">The story ends  \r\nThe sound of the blue  \r\nThe tears were shining  \r\nThe story of my life  \r\nI still believe  \r\nThe story of my life <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_11012\" class=\"pvc_stats all  \" data-element-id=\"11012\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.stechstar.com\/user\/wordpress\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>[DeepLearning] Learning to generate lyrics and music with Recurrent Neural Networks : \uc21c\ud658 \uc2e0\uacbd\ub9dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uac00\uc0ac\uc640 \uc74c\uc545\uc744 \uc0dd\uc131\ud558\ub294 \ubc29\ubc95 \ubc30\uc6b0\uae30 \uc21c\ud658 \uc2e0\uacbd\ub9dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uac00\uc0ac\uc640 \uc74c\uc545\uc744 \uc0dd\uc131\ud558\ub294 \ubc29\ubc95 \ubc30\uc6b0\uae30 Pytorch\uc640 rnns&nbsp;|&nbsp;2018\ub144 1\uc6d4 27\uc77c RNN \uae30\ubc18 \uc0dd\uc131 \ubaa8\ub378\uc744 \uac00\uc0ac\uc640 \ud53c\uc544\ub178 \uc74c\uc545 \uc0dd\uc131\uc5d0 \uc801\uc6a9\ud55c \uc0ac\ub840\ub97c \ubcf4\uc5ec\uc8fc\ub294 \uac8c\uc2dc\ubb3c\uc785\ub2c8\ub2e4. \uc18c\uac1c \uc774 \uac8c\uc2dc\ubb3c\uc5d0\uc11c\ub294 \uac00\uc7a5 \uc778\uae30 \uc788\ub294\/\ucd5c\uadfc \uc544\ud2f0\uc2a4\ud2b8\uc758 \uac00\uc0ac \ub370\uc774\ud130 \uc138\ud2b8\uc5d0\uc11c RNN [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_11012\" class=\"pvc_stats all  \" data-element-id=\"11012\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.stechstar.com\/user\/wordpress\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[21,16,24,18,20],"tags":[],"class_list":["post-11012","post","type-post","status-publish","format-standard","hentry","category-21","category-16","category-24","category-18","category-20"],"a3_pvc":{"activated":true,"total_views":20,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/posts\/11012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/comments?post=11012"}],"version-history":[{"count":1,"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/posts\/11012\/revisions"}],"predecessor-version":[{"id":11013,"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/posts\/11012\/revisions\/11013"}],"wp:attachment":[{"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/media?parent=11012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/categories?post=11012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stechstar.com\/user\/wordpress\/wp-json\/wp\/v2\/tags?post=11012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}