๋จธ์ ๋ฌ๋, ๋ฅ๋ฌ๋/Paper Classification
4/23 ํด๋ดค๋ ๊ฒ ์ ๋ฆฌ
ํ๋ฑ
2020. 4. 24. 12:03
1. RMDL ์ ์ฉ ์๋
- Colab์ pip ์ค์นํด ํ๋ค๊ฐ checkpoint ๊ฒฝ๋ก ๋ฐ๊ฟ๋ณด๋ ค๊ณ ๋ด ๊นํ์ forkํ๊ณ ๊ฒฝ๋ก ๊ณ ์ณ์ ์ปค๋ฐํ ๋ค์ git cloneํจ (pip ์ค์นํ๊ณ ๋ ์ฝ๋๋ฅผ ์์ ํ ์ ์๋ ์ง๋ ๋ชจ๋ฅด๊ฒ ์..)
- https://stackoverflow.com/questions/49322072/checkpoints-in-google-colab : ์ด๊ฑฐ ๋ณด๋ฉด checkpoint ๊ฒฝ๋ก๋ฅผ /gdrive ๋ด๋ก ๋ฐ๊ฟ๋ ์ ๋ ์๋ ์์ ๊ฒ ๊ฐ์ (๋ฌผ๋ก mount ํ์..)
- https://research.google.com/colaboratory/local-runtimes.html : Colab ๋ก์ปฌ ๋ฐํ์ ๊ด๋ จ document. ๋ก์ปฌ์์ ์ฝ๋๋ฅผ ์คํํ๊ณ ๋ก์ปฌ ํ์ผ ์์คํ ์ ์์ธ์คํ ์ ์๋ค๊ณ ํจ. ๋จ์ ์ ๋ก์ปฌ์ ์ ๊ทผ์ด ๊ฐ๋ฅํ๋ฏ๋ก rm -rf ๊ฐ์ ๋ฌด์์ด ๋ช ๋ น์ด๊ฐ ์คํ๋ ์๋ ์๋ค๋ ๊ฒ๊ณผ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์๋ก ์ค์นํด์ผํ ์๋ ์๋ค๋ ๊ฒ.
- https://blog.nerdfactory.ai/2019/04/25/learn-bert-with-colab.html : Colab์์ ํ ํด๋ ์์ฒด๋ฅผ ๊ตฌ๊ธ ๋๋ผ์ด๋ธ์ ์ฐ๊ฒฐ์ํฌ ์ ์๋ ๋ฐฉ๋ฒ์ด ๋์์์. (!ls๋ฅผ ์คํํ๋ฉด ๋๋ผ์ด๋ธ์ ๋์ผํ๊ฒ ๋์ค๋!!) 'Colab๊ณผ ๊ตฌ๊ธ ๋๋ผ์ด๋ธ๋ฅผ ์ฐ๋' ๊ฒ์.
- ์ถ๊ฐ) ์ ๊ฒ ์๋ ๋ฐฉ๋ฒ์ธ ๋ฏ. ๊ทธ๋ฅ ๋๋ผ์ด๋ธ ๋ง์ดํธํ๊ณ !ls /gdrive ํ๋ฉด ๋๋ผ์ด๋ธ ํด๋๋ค ๋์ด..^^
- checkpoint ๊ฒฝ๋ก ๋ฐ๊พผ ๋ฒ์ + RMDL ๋ฆฌ๋๋ฏธ์ ๋์์๋ IMDB ๋ฐ์ดํฐ์ ์ผ๋ก ์๋ํด๋ดค๋๋ฐ ๋จ์ด ํฐ์ง (ํ๋์จ์ด ๊ฐ์๊ธฐ GPU๋ก ์ค์ ํ๋ฉด ํ ๋น๋๋ ๋จ์ด ์ค์ด๋ ๋์ TPU/None์ผ๋ก๋ ์๋ํด๋ด)
- https://github.com/googlecolab/colabtools/issues/253 : Colab์์ (๋์ ๋ด๊ณ ) ๋จ์ ๋ ๋ง์ด ์ธ ์ ์๋๋ํ๋ ์ด์์ธ๋ฐ ๋์ ๋ด๊ณ ๋จ์ ๋ ๋ฐ๋ ์๋น์ค๋ ์๋ค๊ณ ํจ. ์ฌ๊ธฐ ๋์์๋ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ํ ๋ฒ ๋จ ์ต๋ ๋ฆฌ๋ฐ์ ์น๋ฉด '๋จ ์ฌ์ด์ฆ๋ฅผ ๋๋ฆฌ์๊ฒ ์ต๋๊น?' ํ๋ ๋ฉ์์ง๊ฐ ๋จ๋ฏ๋ก ๊ฑฐ๊ธฐ์ '์'๋ฅผ ๋๋ฅด๋ผ๋ ๊ฒ์ธ๋ฐ ํ์ฌ๋ '๋จ ์ฌ์ด์ฆ๋ฅผ ๋๋ฆด ๊ฒ์ธ์ง'๋ฅผ ๋ฌป๋ ๋ฉ์์ง๊ฐ ์๋ '๋จ ์ฌ์ด์ฆ๋ฅผ ๋ชจ๋ ์ฌ์ฉํ์ผ๋ ์ธ์ ์ด ์ข ๋ฃ๋์์'์ด๋ผ๋ ๋ฉ์์ง๊ฐ ๋ธ. ์ ์ฑ ์ด ๋ฐ๋๊ฑธ์ง๋?
- ์ถ๊ฐ) Colab pro๋ก ๋ ๋ด๊ณ GPU/TPU/RAM ๋๋ฆด ์ ์๋ ๋ฏ
2. RNN ๊ธฐ๋ฐ ๋ค๋ฅธ ๋ชจ๋ธ ์๋
- https://buomsoo-kim.github.io/keras/2019/07/12/Easy-deep-learning-with-Keras-19.md/ : ์ฌ๊ธฐ์ ๋์์๋ ๊ธฐ๋ณธ์ ์ธ RNN ๊ธฐ๋ฐ ๋ชจ๋ธ์ ์๋ํด๋ด. Input shape ์ค์ ์์ ์ฒจ์ ์ค๋ฅ๊ฐ ๋ฌ์๋ค๊ฐ X_label (N, 100, 1)๋ก reshapeํ๊ณ input shape์ (100, 1)๋ก ํ๋ ์ค๋ฅ๋ ์ฌ๋ผ์ง. Y_label๋ ์ํซ์ผ๋ก ํจ. ๊ทธ๋ฌ๋ Test ๊ฒฐ๊ณผ๊ฐ ๋๋ฌด ํํธ ์์์. (๋ค์ธต LSTM Epoch 15๋ฒ์ Train acc๋ 53%, Test acc๋ 41%) RNN์ผ๋ก ๋๋ฆฌ๊ฑฐ๋ Epoch๋ฅผ ๋๋ ค๋ ๋๊ฐ์์. ์ค๋ฒํผํ ์ธ๊ฐ..?_? Train acc๊ฐ ๊ทธ๋ค์ง ๋์ง ์์๋ฐ๋ ์ค๋ฒํผํ ์ด ์ฌ ์ ์๋๊ฑธ๊น? ๋ฐ์ดํฐ๊ฐ ๋ ์ ์ด์ ๊ทธ๋ฐ๊ฐ ์ถ๊ธฐ๋ ํ๋ค..
- https://stackoverflow.com/questions/39117878/keras-simplernn-input-shape-and-masking : Input shape ๋ง์ถ๋ ๋ฒ
- https://buomsoo-kim.github.io/blog/categories/ : ์ฌ๊ธฐ์ ๋ค๋ฅธ RNN ๊ธฐ๋ฐ ๋ชจ๋ธ๋ ์์ผ๋ ์ฐธ๊ณ ํด๋ณด๊ธฐ
- https://www.tensorflow.org/tutorials/keras/text_classification : Keras๋ฅผ ์ด์ฉํด text classificationํ๋ ์์ (TF ๊ณต์๋ฌธ์)