[Deep Neural Network] part 1 - 2

2023. 1. 22. 21:25
๐Ÿง‘๐Ÿป‍๐Ÿ’ป์šฉ์–ด ์ •๋ฆฌ

Deep Neural Network
multi-layer perceptron
sigmoid
MNIST
MSE error
logistic regression

 

Forward Propagation

 

  • multi-layer perceptron์—์„œ ์ด ์ˆœ์ฐจ์ ์ธ ๊ณ„์‚ฐ๊ณผ์ •์„ ๋‚˜ํƒ€๋‚ด๋Š” forward propatation

์ถœ์ฒ˜ : https://medium.com/analytics-vidhya/what-do-you-mean-by-forward-propagation-in-ann-9a89c80dac1b

๋‰ด๋Ÿฐ์˜ ์ž…๋ ฅ์œผ๋กœ ์ฃผ์–ด์ง€๋Š” vector๋ฅผ column vector๋กœ ๋งŒ๋“ค๊ณ , ์ด ๋‰ด๋Ÿฐ์ด ๊ฐ€์ง€๋Š” ๊ฐ€์ค‘์น˜๋ฅผ row vector๋กœ ๋งŒ๋“ค๋ฉด ํ–‰์—ด์˜ ๋‚ด์  ํ˜•ํƒœ๋กœ ๊ฐ€์ค‘ํ•ฉ์„ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ถœ์ฒ˜ : https://www.geeksforgeeks.org/advantages-and-disadvantages-of-logistic-regression/

์œ„์™€ ๊ฐ™์ด ๊ณ„์‚ฐ์ƒ์—์„œ ํ•™์Šต์˜ ์šฉ์ดํ•จ์„ ํ•„์š”๋กœ ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ์ด๋Ÿฌํ•œ ํ™œ์„ฑ ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์œ„ Activation function์€ sigmoid or logistic function์ด๋ผ๊ณ  ๋ถˆ๋ฆฌ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

์œ„์™€ ๊ฐ™์ด ์„ ํ˜• ๊ฒฐํ•ฉ๋œ ๊ฐ’์ด Activation function์„ ํ†ต๊ณผํ•˜์—ฌ ์ตœ์ข…์ ์ธ Output ๊ฐ’์„ ๋งŒ๋“ค์–ด๋‚ด๊ฒŒ ๋˜๊ณ ,

 

์ถœ์ฒ˜ : https://www.saedsayad.com/artificial_neural_network.htm

์œ„์™€ ๊ฐ™์€ discreteํ•œ ๊ฐ’์ด ์ถœ๋ ฅ์ธ Hard-Threshold function๊ณผ ๋‹ฌ๋ฆฌ ์œ„ sigmoid function์€ 0๊ณผ 1 ์‚ฌ์ด์˜ ์‹ค์ˆ˜๊ฐ’์„ ์ถœ๋ ฅ์œผ๋กœ ๋‚ด์–ด์ค๋‹ˆ๋‹ค.

 

 

Output noded์ธ ์ถœ๋ ฅ ๋‰ด๋Ÿฐ์˜ ๊ฐœ์ˆ˜์— ํ•ด๋‹นํ•˜๋Š” dimension์„ ๊ฐ€์ง€๋Š” ์—ด๋ฒกํ„ฐ๊ฐ€ ๋‚˜์˜ค๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

์ด ์—ด๋ฒกํ„ฐ ๊ฐ๊ฐ์˜ ์›์†Œ๊ฐ€ sigmoid function์„ ํ†ต๊ณผํ•˜๊ฒŒ ๋˜๋ฉด ์ด๋Ÿฐ Output ๊ฐ’์„ ์–ป์–ด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์•„๋ž˜์™€ ๊ฐ™์ด Linear Layer๋ฅผ ํ˜•์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ถœ์ฒ˜ : https://learnai1.home.blog/2019/11/20/multi-layer-neural-networks-back-propagation/

  • MNIST Dataset (Modified National Institute of Standards and Technology)
    • MNIST Classification Model
    • ์ด ์ถœ๋ ฅ vector๋ฅผ ground truth ๊ฒฐ๊ณผ๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ loss function์„ ๋งŒ๋“ค์–ด์ค„ ์ˆ˜๊ฐ€ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
    • ์‹ค์ œ Prediction๊ณผ Target ๊ฐ„์˜ Squared Error ๋ฅผ ๋‚ด์–ด loss๋ฅผ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ์ด๋Ÿฌํ•œ loss๋ฅผ Mean Squared Error Loss๋ผํ•ฉ๋‹ˆ๋‹ค.
      • class์—์„œ์˜ ์˜ˆ์ธก ๊ฐ’๊ณผ ์ฐธ ๊ฐ’์˜ ์ฐจ์ด๊ฐ€ ์ž‘์•„, ํ•™์Šต์— ์‚ฌ์šฉ๋˜๋Š” Gradient ๊ฐ’์ด ํฌ์ง€ ์•Š๊ฒŒ ๋˜์–ด ํ•™์Šต์ด ์ƒ๋Œ€์ ์œผ๋กœ ๋Š๋ ค์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
      • class ๋ถ„๋ฅ˜ ์‹œ, ์˜ˆ์ธก ๊ฐ’, ์ถœ๋ ฅ ๊ฐ’์˜ ํ˜•ํƒœ๋Š”, ํ™•๋ฅ ์˜ ๊ฐ’์œผ๋กœ ์ด 1์ด ๋˜๋„๋กํ•˜๋Š” vector๋ฅผ ์–ป์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
        • ์ด๋ฅผ softmax layer ํ˜น์€ softmax classifier๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.
          • ๋จผ์ € ์ถœ๋ ฅ ๋‰ด๋Ÿฐ๋“ค์˜ ๊ฐ’์„ ํ•ฉ์ด 1์ด ๋˜๋„๋ก ํ•˜๊ธฐ ์œ„ํ•˜์—ฌ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ณผ์ •์„ ๊ฑฐ์นœ๋‹ค.
            1. ์ถœ๋ ฅ ๋‰ด๋Ÿฐ๋“ค์˜ ๊ฐ๊ฐ์˜ ๊ฐ’์„ ์ง€์ˆ˜ํ•จ์ˆ˜๋ฅผ ๊ฑฐ์น˜๊ฒŒ ํ•œ๋‹ค.
            2. ๋ชจ๋‘ ์–‘์ˆ˜์ธ ํ˜•ํƒœ์˜ ์ถœ๋ ฅ ๊ฐ’์„ ๊ฐ€์ง€๊ณ  ์ƒ๋Œ€์ ์ธ ๋น„์œจ์„ ๊ณ„์‚ฐํ•˜๊ฒŒ ๋œ๋‹ค.
            3. ๊ฐ๊ฐ์˜ ํ™•๋ฅ  ๊ฐ’์„ ๊ตฌํ•˜์—ฌ ํ•ฉ์ด 1์ด ๋˜๋„๋ก ๊ตฌํ•œ๋‹ค.
          • ์ด๋Ÿฌํ•œ softmax layer์˜ Output vector๋ฅผ multi-class classification task๋ฅผ ์œ„ํ•œ ํ˜•ํƒœ๋กœ ์–ป์—ˆ์„ ๋•Œ, ์—ฌ๊ธฐ์— Loss function์„ ์ ์šฉํ•  ๋•Œ,
            • MSE Loss๋Š” 0๊ณผ 1๋กœ ๊ฐ’์„ ๋ฐ”๊พธ๊ณ  ๊ทธ ์ฐจ์ด์˜ ์ œ๊ณฑ์„ ํ™˜์‚ฐํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๊ณ„์‚ฐํ–ˆ๋‹ค๋ฉด,
            • ๋Œ€์‹ ์—, softmax layer์— ์ ์šฉํ•˜๋Š” Loss๋กœ์„œ, softmax loss or cross-entropy loss๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
            • ์•„๋ž˜์™€ ๊ฐ™์ด ์ถœ๋ ฅ vector์™€ ground truth vector์ธ one-hot vector ํ˜•ํƒœ๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค.
             

์ถœ์ฒ˜ : https://www.superdatascience.com/blogs/convolutional-neural-networks-cnn-softmax-crossentropy

 

 

์ถœ์ฒ˜ : https://velog.io/@ljho01/AIMLLogistic-Regression

'Artificial Intelligence > Deep Learning' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Convolutional Neural Networks and Image Classification] Part 3  (0) 2023.01.24
[Training Neural Networks] part 2  (0) 2023.01.24
[Deep Neural Network] part 1 - 1  (0) 2023.01.22
[Machine Learning] ์‹ ๊ฒฝ๋ง ๊ธฐ์ดˆ 1  (0) 2023.01.17
more clever function  (0) 2021.12.19

BELATED ARTICLES

more