[GoogleML] Regularizing Neural Network

2023. 9. 12. 16:34ใ†ArtificialIntelligence/2023GoogleMLBootcamp

 

 

 

ํ”„๋กœ๋ฒ ๋‹ˆ์šฐ์Šค norm ๊ณต์‹ (ํ•˜๋‹จ์— F)

 

 

 

Regularization

๋†’์€ ์ฐจ์›์˜ W์— ๋น„ํ•ด, b๋Š” ๋งค์šฐ ๋‚ฎ์€ ์ฐจ์›(์‹ค์ˆ˜)

bias๋Š” regularization ํ•˜์ง€ ์•Š๋Š”๋‹ค. 

 

 

 

@Logistic regression

๋žŒ๋‹ค = regularization parameter

 

 

 

@Neural Network

L2 norm = wieght decay

 

 

 

Why Regularization Reduces Overfitting?

๋žŒ๋‹ค๋ฅผ ํ‚ค์šธ ๊ฒฝ์šฐ, W๊ฐ€ ์ฃฝ๊ฒŒ ๋œ๋‹ค 
๋” ๊ฐ„๋‹จํ•œ ๋ชจ๋ธ ๊ตฌ์กฐ๊ฐ€ ๋œ๋‹ค
W๋ฅผ 0์œผ๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด
๋” simpleํ•œ network -> parmas size๋ฅผ ์ค„์—ฌ์„œ ์˜ค๋ฒ„ํ”ผํŒ… ๋ฐฉ์ง€ ๊ฐ€๋Šฅ (๊ณผ์ ํ•ฉ ํ•ด๊ฒฐ)
 
 
 
๋žŒ๋‹ค๋กœ ์ธํ•ด W๊ฐ€ ์ž‘์•„์ง€๋ฉด, Z์— ๋“ค์–ด๊ฐ€๋Š” ๊ฐ’๋„ ์ค„์–ด๋“ ๋‹ค -> ํ™œ์„ฑํ™” ํ•จ์ˆ˜์˜ 0๊ทผ์ฒ˜์— ๋ถ„ํฌ -> ์ง์„ 
layer๋ฅผ linearํ•˜๊ฒŒ ๋งŒ๋“ ๋‹ค -> ์˜ค๋ฒ„ํ”ผํŒ… ํ•ด๊ฒฐ 

 

 

 

second term์˜ ์ถ”๊ฐ€๋กœ, ๊ธฐ์กด cost func์—์„œ ๋ณ€ํ™”๊ฐ€ ๋ฐœ์ƒํ•˜๊ฒŒ ๋œ๋‹ค 

 

 

 

Dropout Regularization

randomํ•˜๊ฒŒ ๋…ธ๋“œ๋ฅผ ์‚ญ์ œํ•˜๋Š” ๊ธฐ๋ฒ•

๋” ์ž‘์€ ๊ทœ๋ชจ์˜ network๋กœ ๋งŒ๋“œ๋Š” ์—ญํ• 

 

 

 

inverted dropout

1๋ณด๋‹ค ์ž‘์€ ๊ฐ’์œผ๋กœ ๋‚˜๋ˆˆ๋‹ค -> ํ‚ค์šด๋‹ค

activation ๊ฐ’์˜ ์ฐจ์›์„ ํ‚ค์šด๋‹ค (dropout์œผ๋กœ ์ค„์–ด๋“ค์—ˆ๊ธฐ ๋•Œ๋ฌธ์—)

keep prob - ๋ณด์กดํ•˜๋ ค๋Š” ๋…ธ๋“œ์˜ ๋น„์œจ 

 

 

 

test time์—์„œ๋Š” training time๊ณผ ๋‹ฌ๋ฆฌ, ๋น„์œจ์„ ์กฐ์ •ํ•  ํ•„์š” X

In general, the number of neurons in the previous layer gives us the number of columns of the weight matrix,

and the number of neurons in the current layer gives us the number of rows in the weight matrix.

 

 

 

Understanding Dropout

 

 

 

layer์˜ node ์ˆ˜, ํŠน์„ฑ์— ๋”ฐ๋ผ dropout์„ ์ ์šฉํ•˜๋Š” keep-prob์„ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ๋‹ค

CV ๋ถ„์•ผ์—์„œ ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” overfitting ๋ฐฉ์ง€ regularization  

 

 

 

Other Regularization Methods

 

 

 

์™œ W๊ฐ€ ์ ์  ๋” ์ปค์ง€์ง€?

- validation(develop) error๊ฐ€ ๋†’์•„์ง€๊ธฐ ์ „์— ์กฐ๊ธฐ ๋ฉˆ์ถค ์•Œ๊ณ ๋ฆฌ์ฆ˜

 

 

 

cost๋ฅผ ๋‚ฎ์ถ”๋Š” ๋ชฉ์  + ๊ทœ์ œ (์˜ค๋ฒ„ํ”ผํŒ… ๋ฐฉ์ง€)

 

 

 

 

 

'ArtificialIntelligence > 2023GoogleMLBootcamp' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[GoogleML] Optimization Algorithms  (0) 2023.09.20
[GoogleML] Optimization Problem  (0) 2023.09.13
[GoogleML] Setting up Machine Learning  (0) 2023.09.12
[GoogleML] Neural Networks and Deep Learning ์ˆ˜๋ฃŒ  (0) 2023.09.12
[GoogleML] Deep Neural Network  (0) 2023.09.11