3. ๋”ฅ๋Ÿฌ๋‹

๋”ฅ๋Ÿฌ๋‹์ด๋ž€? ๋”ฅ๋Ÿฌ๋‹๊ณผ ๋จธ์‹ ๋Ÿฌ๋‹์˜ ์ฐจ์ด


Cost Function๊ณผ Activate Function


Tensorflow์™€ Pytorch

๊ตฌ๋ถ„ Tensorflow PyTorch
ํŒจ๋Ÿฌ๋‹ค์ž„ Define and Run Define by Run
๊ทธ๋ž˜ํ”„ ํ˜•ํƒœ Static graph(์ •์ ) Dynamic graph(๋™์ )
๊ตฌ๋ถ„ Define and Run Define byy Run
์žฅ์  - ๋‚ด๋ถ€ ์ตœ์ ํ™”์— ์œ ๋ฆฌ
- ๋Œ€๊ทœ๋ชจ ๋ฐฐ์ดˆ๋‚˜ ๋ชจ๋ฐ”์ผ/์ž„๋ฒ ๋””๋“œ ํ™˜๊ฒฝ์—์„œ ํšจ์œจ์ 
- ํ•œ๋ฒˆ ๊ทธ๋ž˜ํ”„๋ฅผ ํ™•์ • ์ง€์œผ๋ฉด ์˜ˆ์ธก์ด ์šฉ์ด
- ์ง๊ด€์ ์ด๊ณ  ํŒŒ์ด์ฌ์Šค๋Ÿฌ์›Œ ๋””๋ฒ„๊น…์ด ์‰ฝ๊ณ  ํ•™์Šต ๊ณก์„ ์ด ๋น„๊ต์  ๋‚ฎ์Œ
- ์‹คํ–‰ ํ๋ฆ„๊ณผ ์ฝ”๋“œ๊ฐ€ ๊ฐ™์•„ ๋น ๋ฅธ ํ”„๋กœํ† ํƒ€์ž… ๊ฐ€๋Šฅ
๋‹จ์  - ๋””๋ฒ„๊น…์ด ์–ด๋ ต๊ณ  ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ์–ด๋ ค์›€
- ์ฆ‰์‹œ ๊ฒฐ๊ณผํ™•์ธ์ด ์–ด๋ ค์›€
- ๊ทธ๋ž˜ํ”„ ์ตœ์ ํ™”๋ฅผ ์œ„ํ•ด ์ถ”๊ฐ€์ ์ธ ์ž‘์—…์ด ํ•„์š”ํ•  ์ˆ˜๋„ ์žˆ์Œ
- ์ดˆ๊ธฐ์—๋Š” ์ •์  ๊ทธ๋ž˜ํ”„๋Œ€๋น„ ์†๋„๊ฐ€ ๋Š๋ฆผ

Data Nomalization

Pasted image 20250304135502.png


Activation function์˜ ์ข…๋ฅ˜ ๋ฐ ํŠน์ง•


์˜ค๋ฒ„ํ”ผํŒ…์˜ ๊ฒฝ์šฐ ์–ด๋–ป๊ฒŒ ๋Œ€์ฒ˜ํ•ด์•ผํ•˜๋Š”๊ฐ€


ํ•˜์ดํผ ํŒŒ๋ผ๋ฏธํ„ฐ๋ž€?

  • ์„ ํ—˜์  ์ง€์‹: ๊ฒฝํ—˜ํ•˜์ง€ ์•Š์•„๋„ ์•Œ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์„ ๋งํ•œ๋‹ค.
  • ํœด๋ฆฌ์Šคํ‹ฑ: ์ฒด๊ณ„์ ์ด๋ฉด์„œ ํ•ฉ๋ฆฌ์ ์ธ ํŒ๋‹จ์ด ๊ตณ์ด ํ•„์š”ํ•˜์ง€ ์•Š์€ ์ƒํ™ฉ์—์„œ ์‚ฌ๋žŒ๋“ค์ด ๋น ๋ฅด๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก, ๋ณด๋‹ค ์šฉ์ดํ•˜๊ฒŒ ๊ตฌ์„ฑ๋œ ๊ฐ„ํŽธ์ถ”๋ก ์˜ ๋ฐฉ๋ฒ•์ด๋‹ค. '๋Œ€์ถฉ ์–ด๋ฆผ์ง์ž‘ํ•˜๊ธฐ', '๋ˆˆ๋Œ€์ค‘์œผ๋กœ ๋งž์ถ”๊ธฐ' ๋“ฑ์˜ ๋ฐฉ๋ฒ•์„ ์ผ์ปซ๋Š”๋‹ค.


Weight Initalization


๋ณผ์ธ ๋งŒ ๋จธ์‹ 


๋‰ด๋Ÿด๋„ท์˜ ๊ฐ€์žฅ ํฐ ๋‹จ์ ์€ ๋ฌด์—‡์ธ๊ฐ€

None-Linearity


ReLU ๋ฌธ์ œ์ 

Pasted image 20250304150548.png

  • Zero-Centered: ํ‰๊ท (๋˜๋Š” ๊ธฐ๋Œ€๊ฐ’)์ด 0์— ๊ฐ€๊น๋„๋ก ์ „์ฒ˜๋ฆฌํ•˜๊ฑฐ๋‚˜ ๋ณ€ํ™˜ํ•œ ์ƒํƒœ๋ฅผ ๋งํ•ฉ๋‹ˆ๋‹ค.


ํŽธํ–ฅ์€ ์™œ ์กด์žฌํ•˜๋Š”๊ฐ€

Pasted image 20250304150832.png

Gradient Descent


๊ผญ Gradient๋ฅผ ์จ์•ผ ํ• ๊นŒ? ๊ทธ ๊ทธ๋ž˜ํ”„์—์„œ ๊ฐ€๋กœ์ถ•๊ณผ ์„ธ๋กœ์ถ• ๊ฐ๊ฐ์€ ๋ฌด์—‡์ธ๊ฐ€? ์‹ค์ œ ์ƒํ™ฉ์—์„œ๋Š” ๊ทธ ๊ทธ๋ž˜ํ”„๊ฐ€ ์–ด๋–ป๊ฒŒ ๊ทธ๋ ค์งˆ๊นŒ?

Pasted image 20250304151749.png


GD ์ค‘์— ๋•Œ๋•Œ๋กœ Loss๊ฐ€ ์ฆ๊ฐ€ํ•˜๋Š” ์ด์œ ๋Š”?

Pasted image 20250304151914.png


Back Propagation

Pasted image 20250304152140.png


Local minima ๋ฌธ์ œ์—๋„ ๋”ฅ๋Ÿฌ๋‹์ด ์ž˜ ๋˜๋Š” ์ด์œ 

  • critical point: ์ผ์ฐจ ๋ฏธ๋ถ„์ด 0์ธ ์ง€์ ์ด๋‹ค. (local/global)minima, (local/global)maxima, saddle point๋ฅผ ๊ฐ€๋ฆฌํ‚ด
  • local minimum: ๋ชจ๋“  ๋ฐฉํ–ฅ์—์„œ ๊ทน์†Œ๊ฐ’์„ ๋งŒ์กฑํ•˜๋Š”
  • global minimum: ๋ชจ๋“  ๋ฐฉํ–ฅ์—์„œ ๊ทน์†Œ๊ฐ’์„ ๋งŒ์กฑํ•˜๋Š” ์  ์ค‘์— ๊ฐ€์žฅ ๊ฐ’์ด ์ž‘์€ ์ (์ •๋‹ต)
  • saddle point: ์–ด๋Š ๋ฐฉํ–ฅ์—์„œ ๋ณด๋ฉด ๊ทน๋Œ€๊ฐ’์ด์ง€๋งŒ ๋‹ค๋ฅธ ๋ฐฉํ–ฅ์—์„œ ๋ณด๋ฉด ๊ทน์†Œ๊ฐ’์ด ๋˜๋Š” ์ 


Gradient Descent๊ฐ€ Local Minima ๋ฌธ์ œ๋ฅผ ํ”ผํ•˜๋Š” ๋ฐฉ๋ฒ•


์ฐพ์€ ํ•ด๊ฐ€ Global Minimum์ธ์ง€ ์•„๋‹Œ์ง€ ์•Œ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์€?


Training set๊ณผ Test set์„ ๋‚˜๋ˆ„๋Š” ์ด์œ 


Validation set์ด ์žˆ๋Š” ์ด์œ 


Test set์ด ์˜ค์—ผ๋˜์—ˆ๋‹ค๋Š” ์˜๋ฏธ


Batch Normalization์˜ ํšจ๊ณผ


GAN์—์„œ Generator ์ชฝ์—๋„ BN์„ ์ ์šฉ ๊ฐ€๋Šฅ?


SGD, RMSprop, Adam

Pasted image 20250304154129.png


๋ฏธ๋‹ˆ ๋ฐฐ์น˜ ํฌ๊ธฐ