๋”ฅ๋Ÿฌ๋‹/Today I learned :

RNN

์ฃผ์˜ ๐Ÿฑ 2022. 12. 28. 12:13
728x90
๋ฐ˜์‘ํ˜•

์ž์—ฐ์–ด์ฒ˜๋ฆฌ์—์„œ ํ† ํฐ์˜ ์ˆœ์„œ๊ฐ€ ๋งค์šฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. 

  • ๋‚˜๋Š” ์ง‘์— ๊ฐ„๋‹ค. (o)
  • ๋‚˜๋Š” ๊ฐ„๋‹ค ์ง‘์—  (x)

์ด๋Ÿฌํ•œ ํ† ํฐ์˜ ์ˆœ์„œ๋ฅผ ๊ณ ๋ คํ•˜๊ธฐ ์œ„ํ•ด RNN ํ˜•ํƒœ์˜ ๋ชจ๋ธ์ด ๊ฐœ๋ฐœ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. 

 

RNN์˜ ์˜๋ฏธ์™€ ๊ตฌ์กฐ

๋˜‘๊ฐ™์€ weight๋ฅผ ํ†ตํ•ด ์žฌ๊ท€์ ์œผ๋กœ(Recurrent) ํ•™์Šตํ•œ๋‹ค. = RNN(Recurrent Neural Network)

์™ผ์ชฝ์„ ํ’€์–ด์“ฐ๋ฉด ์˜ค๋ฅธ์ชฝ๊ณผ ๊ฐ™๋‹ค.

xt๋ผ๋Š” input์ด ๋“ค์–ด๊ฐ€๊ฒŒ ๋˜๋ฉด ์ด์ „์— xt-1์—์„œ ํ•™์Šต๋œ A๋ผ๋Š” weight๋ฅผ ํ†ตํ•ด ht๋ฅผ ๋ฆฌํ„ดํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. 

 

RNN์˜ ์—ฌ๋Ÿฌ ํ˜•ํƒœ์™€ ์‚ฌ์šฉ ๋ถ„์•ผ

 

๋นจ๊ฐ„๋ฐ•์Šค๋Š” ์ธํ’‹, ์ดˆ๋ก๋ฐ•์Šค๋Š” RNN Block, ํŒŒ๋ž€๋ฐ•์Šค๋Š” y(์ •๋‹ต) ํ˜น์€ y^(์˜ˆ์ธก๊ฐ’) ์•„์›ƒํ’‹์ž…๋‹ˆ๋‹ค. 

 

one-to-many

์‚ฌ์šฉ๋ถ„์•ผ : image captioning ( input: image, output: sequence of words/tokens ex. <start> Giraffes standing, ,,, <end>)

many-to-one

- ๊ฐ์ •๋ถ„์„(sentiment claasification) : ๊ฐ์ •์˜ ํด๋ž˜์Šค ์˜ˆ์ธก(very positive, positive, neutral..)

 

many-to-many (์™ผ์ชฝ)

- ์ „์ฒด ์ธํ’‹์„ ํ•˜๋‚˜๋กœ ์š”์•ฝํ•ด์„œ(์ดˆ๋ก์ƒ‰ ๊ฐ€์šด๋ฐ ๋ฐ•์Šค) ๊ทธ๊ฑธ ๊ธฐ๋ฐ˜์œผ๋กœ ์•„์›ƒํ’‹์„ ๋‚ธ๋‹ค.

- input๊ณผ ์•„์›ƒํ’‹์ด ํ•˜๋‚˜์”ฉ ๋Œ€์‘๋˜์ง€ ์•Š๋Š”๋‹ค. 

๊ธฐ๊ฒŒ๋ฒˆ์—ญ machine translation - NMT(encoder+decoder)

 

many-to-many (์˜ค๋ฅธ์ชฝ)

- ๋งค timestamp๋งˆ๋‹ค ์•„์›ƒํ’‹์„ ๋‚ธ๋‹ค. 

Named entity recognition(NER) ์ •๋ณด์ถ”์ถœ์— ์‚ฌ์šฉ

example of NER: ์žฅ์†Œ, ๊ธฐ๊ด€

1. ์ œ์ฃผ์™€ ์„œ์šธ์€ ๋น„ํ–‰๊ธฐ๋กœ 1์‹œ๊ฐ„์ด๋‹ค. -์žฅ์†Œ

2. ์„œ์šธ์‹œ์ฒญ์€ ์˜ค๋Š˜ ๋ฌธ์„ ๋‹ซ๋Š”๋‹ค. -๊ธฐ๊ด€

๋ฐ˜์‘ํ˜•