Neural Network
1. What is DQN
๊ฐํํ์ต์์ agent๋ environment๋ฅผ MDP๋ฅผ ํตํด์ ์ดํด๋ฅผ ํ๋๋ฐ table ํํ๋ก ํ์ต์ ๋ชจ๋ state์ ๋ํ action-value function์ ๊ฐ์ ์ ์ฅํ๊ณ update์์ผ๋๊ฐ๋ ์์ผ๋ก ํ๋ฉด ํ์ต์ด ์๋นํ ๋๋ ค์ง๋๋ค. ๋ฐ๋ผ์ approximation์ ํ๊ฒ๋๊ณ ๊ทธ approximation๋ฐฉ๋ฒ ์ค์์ nonlinear function approximator๋ก deep neural network๊ฐ ์์ต๋๋ค. ๋ฐ๋ผ์ action-value function(q-value)๋ฅผ approximateํ๋ ๋ฐฉ๋ฒ์ผ๋ก deep neural network๋ฅผ ํํ reinforcement learning๋ฐฉ๋ฒ์ด Deep Reinforcement Learning(deepRL)์ ๋๋ค. ๋ํ action value function๋ฟ๋ง ์๋๋ผ policy ์์ฒด๋ฅผ approximateํ ์๋ ์๋๋ฐ ๊ทธ approximator๋ก DNN์ ์ฌ์ฉํด๋ DeepRL์ด ๋ฉ๋๋ค.
action value function์ approximateํ๋ deep neural networks๋ฅผ Deep Q-Networks(DQN)์ด๋ผ๊ณ ํ๋๋ฐ ๊ทธ๋ ๋ค๋ฉด DQN์ผ๋ก ์ด๋ป๊ฒ ํ์ตํ ๊น์? DQN์ด๋ผ๋ ๊ฐ๋ ์ DeepMind์ "Playing Atari with Deep Reinforcement Learning"๋ผ๋ ๋ ผ๋ฌธ์ ์๊ฐ๋์ด์์ต๋๋ค. https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
2. Artificial Neural Networks (ANN)
http://sanghyukchun.github.io/74/ deepRL์ ํ๋ ค๋ฉด ๋ฅ๋ฌ๋์ ๊ธฐ๋ณธ์ ์ธ ๊ฐ๋ ์ ๋ํด์ ์ ํ์๊ฐ ์์ต๋๋ค. ์ ๋ธ๋ก๊ทธ์ ๊ฒ์๋ ๋ด์ฉ์ ๋ฐํ์ผ๋ก ๊ด๋ จ๋ด์ฉ์ ์์ฝํด๋ดค์ต๋๋ค. ์ ๋ํ ๋ฅ๋ฌ๋์ ์ฒ์ ์ ํ๋ ๊ฒ์ด๋ผ ์์ผ๋ก๋ ๊ณต๋ถ๊ฐ ํ์ํ ๊ฒ ๊ฐ์ต๋๋ค. ๊ฐํํ์ต์ด ์ฌ๋์ ํ๋๋ฐฉ์์ ๋ชจ๋ฐฉํ๋ค๋ผ๊ณ ํ๋ค๋ฉด, artificial neural networks(์ค์ฌ์ neural networks)๋ ์ฌ๋์ ๋์ ๊ตฌ์กฐ๋ฅผ ๋ชจ๋ฐฉํ์ต๋๋ค. ์ธ๊ณต์ง๋ฅ์ด ์ฌ๋์ ๋๋ฅผ ๋ชจ๋ฐฉํ๊ฒ ๋ ๊ฒ์๋ ์ปดํจํฐ๊ฐ ๊ณ์ฐ๊ณผ ๊ฐ์ ์ผ์๋ ์ฌ๋๋ณด๋ค ๋ฐ์ด๋ performance๋ฅผ ๋ด์ง๋ง ๊ฐ์ ๊ณ ์์ด๋ฅผ ๊ตฌ๋ณํ๋ ์ฌ๋์ด๋ผ๋ฉด ๋๊ตฌ๋ ๊ฐ๋จํ๊ฒ ํ๋ ์ผ์ ์ปดํจํฐ๋ ํ์ง ๋ชปํ๊ธฐ ๋๋ฌธ์ ๋๋ค. ๋ฐ๋ผ์ ์ด๋ฏธ ๋์ ๊ตฌ์กฐ์ ๋ํด์๋ ์๋ง์ ๋ด๋ฐ๋ค๊ณผ ์๋ ์ค๋ก ๊ตฌ์ฑ๋์ด์๋ค๋ ๊ฒ์ ์๊ณ ๊ทธ๊ฒ์ ์ํ์ ๋ชจ๋ธ๋ก ๋ง๋ค์ด์ ์ปดํจํฐ์ ์๊ณ ๋ฆฌ์ฆ์ ์ ์ฉ์ํค๋ ๋ฐฉ๋ฒ์ ํํ ๊ฒ์ ๋๋ค.
neural networks์ ์ํ์ ๋ชจ๋ธ์ ๋ํด์ ๊ฐ๋จํ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ๊ทธ ์ ์ ์ฌ๋์ ๋ด๋ฐ์ ๊ตฌ์กฐ๋ฅผ ๋ณด๋ฉด http://arxiv.org/pdf/cs/0308031.pdf

๊ฐ Neuron๋ค์ synapse๋ฅผ ํตํด์ signal์ ๋ฐ์ต๋๋ค. ๋ง์ฝ signal์ด ์ด๋ค ํน์ ํ threshlod๋ฅผ ๋์ด๊ฐ๋ค๋ฉด neuron์ด activate๋๊ณ ๊ทธ ๋ด๋ฐ์ axon์ ํตํด์ signal์ ๋ค๋ฅธ synapse๋ก ๋ณด๋ ๋๋ค. ์ด๋ฌํ ๊ตฌ์กฐ๋ฅผ ๋ด๋ฐ์ ๋ชจ์์ ๋นผ๊ณ process์์ฃผ๋ก ๋ค์ ํํ์ ํด๋ณด๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค. http://www.slideshare.net/imanog/artificial-neural-network-48027460

์๋ ์ค๋ฅผ ํตํด์ input์ด ๋ค์ด์ค๋ฉด ๋ด๋ฐ์ processs๋ฅผ ์งํํ๊ณ output์ ๋ด๋์ต๋๋ค. process๋ input์ด ๋ค์ด๊ฐ์ output์ด ๋์ค๋ ์ผ์ข ์ ํจ์์ ๋๋ค. ์ง๊ธ์ ๋จ์ํ ํ๋์ input์ ํ๋์ output๋ง์ ์ ์์ง๋ง ์ฌ์ค์ ์ฌ๋ฌ๊ฐ์ input์ด ๋ค์ด์์ ์ฌ๋ฌ๊ฐ์ output์ด ๋๊ฐ๋ ๋ฐ ๊ทธ input๊ณผ output์ ๋ด๋ฐ ์ฌ์ด์ ์ฐ๊ฒฐ์ ํตํด์ ์ ๋ฌ๋ฉ๋๋ค. ๊ทธ๋ฌํ ๊ตฌ์กฐ๋ฅผ ๋ค์ ๊ทธ๋ฆผ์ผ๋ก ํํํ์๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.

์ด ๊ทธ๋ฆผ์์์ ๊ฐ์ด ๋ด๋ฐ์ ์๋ ์ค๊ฐ 10๊ฐ๋ผ๊ณ ๊ฐ์ ํด๋ณด๋ฉด ์ด ์๋ ์ค๋ค์ ํตํด์ 10๊ฐ์ ๋ค๋ฅธ input๋ค์ด ๋ค์ด์ค๊ฒ ๋ฉ๋๋ค. ๋ด๋ฐ์ process์ ๋ค์ด๊ฐ๋ ๊ฐ์ ์ด 10๊ฐ์ input๋ค์ linear combination์ ๋๋ค. ์ด process๋ฅผ ๊ฑฐ์น y๊ฐ์ ๋ค์ ๋ค๋ฅธ ๋ด๋ฐ๋ค์ ์๋ ์ค๋ก input์ผ๋ก ๋ค์ด๊ฐ๊ฒ ๋ฉ๋๋ค. ์ด๋ฌํ ์ฌ๋์ ๋ด๋ฐ์ ๊ตฌ์กฐ๋ฅผ ๋ชจ๋ฐฉํด์ ์ธ๊ณต์ ๊ฒฝ๋ง์ ๊ตฌ์ฑํ๋ฉด, ๊ฐ neuron๋ค์ node๊ฐ ๋๊ณ synapse๋ฅผ ํตํด์ ๋ค์ด์ค๋ signal์ input์ด ๋๊ณ ๊ฐ๊ฐ ๋ค๋ฅธ synapse๋ฅผ ํตํด์ ๋ค์ด์ค๋ signal๋ค์ ์ค์๋๊ฐ ๋ค๋ฅผ ์ ์์ผ๋ฏ๋ก weight๋ฅผ ๊ณฑํด์ค์ ๋ค์ด์ค๊ฒ ๋ฉ๋๋ค. ์ด signal๋ค์ด weight์ ๊ณฑํด์ง ๊ฒ์ด ์์์ ์ธ๊ธํ๋ net input signal์ ๋๋ค. ๊ทธ net input signal์ ์์ผ๋ก ํํํด๋ณด์๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.

์๋ ์ค๋ก ๋ค์ด์ค๋ ๊ฐ๊ฐ์ input์ vector๋ก ํํํ๊ณ ๊ทธ input์ ๊ฐ๊ฐ ๊ณฑํด์ง๋ weight ๋ํ ๊ทธ์ ๋ฐ๋ผ vector๋ก ๋ง๋ค์ด์ ๋ vector๋ฅผ ๊ณฑํด์ input๊ณผ weight์ linear combination์ ๋ง๋ค์ด์ค๋๋ค. ์ฌ๊ธฐ์ ์๋ก์ด ๊ฐ๋ ์ด ๋ํ๋๋๋ฐ b๋ก ์จ์ง๋ bias์ ๋๋ค.
Bias๊ฐ linear combination์ ๋ํด์ ธ์ net input signal๋ก ๋ค์ด๊ฐ๋ ์ด์ ๋ ๊ฐ๋จํ๊ฒ ๋งํ์๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค. ์ขํํ๋ฉด์์ (0,0)๊ณผ (5,5)์ ์ด๋ ํ ์ ์ ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถํ๊ณ ์ถ๋ค๊ณ ์๊ฐํด๋ด ์๋ค(์๋ฅผ ๋ค๋ฉด, ๊ณ ์์ด๊ณผ ๊ฐ๋ฅผ ๊ตฌ๋ถํ๋ ๋ฌธ์ ๋ผ๊ณ ํ ์ ์์ต๋๋ค). bias๊ฐ ์๋ y = ax๊ฐ์ ํจ์์ ๊ฒฝ์ฐ์๋ ๋ ์ ์ ๊ตฌ๋ถํ ์ ์๋ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค. ํ์ง๋ง y = ax + b๋ ์ด ๋ ์ ์ ๊ตฌ๋ถํ ์ ์์ต๋๋ค.

๋ํ ๋ค๋ฅธ ์์ผ๋ก bias์ ํ์์ฑ์ ์ค๋ช ํ์๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.http://stackoverflow.com/questions/2480650/role-of-bias-in-neural-networks
Modification of neuron WEIGHTS alone only serves to manipulate the shape/curvature of your transfer function, and not its equilibrium/zero crossing point. The introduction of BIAS neurons allows you to shift the transfer function curve horizontally (left/right) along the input axis while leaving the shape/curvature unaltered. This will allow the network to produce arbitrary outputs different from the defaults and hence you can customize/shift the input-to-output mapping to suit your particular needs.
์ฆ ๋ ธ๋๋ก ๋ค์ด๊ฐ๋ input๋ค์ ๊ณฑํด์ง๋ weight(ํ์ต์ํค๋ ค๋ ๋์)์ ๋ณํ์์ผ๋ฉด ํจ์์ ๋ชจ์๋ง ๋ณํ์ํฌ ์ ์์ง ์ผ์ชฝ/์ค๋ฅธ์ชฝ์ผ๋ก ์ด๋์์ผ์ 0์ด ๋๋ point๋ฅผ ๋ณํ์ํฌ ์๋ ์์ต๋๋ค. ๋ฐ๋ผ์ bias๋ฅผ ์ฌ์ฉํ๋ฉด ์ฌ์ฉ์์ ์๊ตฌ์ ๋ ์ ๋์ ์ผ๋ก ๊ทธ๋ํ๋ฅผ ์ด๋ ๋ฐ ๋ณํ์์ผ์ ํ์ตํ ์๊ฐ ์์ต๋๋ค.
input signal๋ค๊ณผ weight๊ฐ ๊ณฑํด์ง๊ณ bias๊ฐ ๋ํด์ง net input signal์ด node๋ฅผ activate์ํค๋๋ฐ ๊ทธ ํ์์ function์ผ๋ก ์ ์ํ ์ ์์ต๋๋ค. ๊ทธ๋ฌํ ํจ์๋ฅผ activation function์ด๋ผ ํฉ๋๋ค. ์ด๋ฌํ ๊ฐ๋ ๋ค์ ๋ชจ๋ ํฉํด์ ๊ทธ๋ฆผ์ผ๋ก ๋ํ๋ธ artificial neuron์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.

f๋ผ๊ณ ํํ๋์ด ์๋ activation function์ ๊ฐ์ฅ ๊ฐ๋จํ ํํ๋ ๋ค์ด์จ input๋ค์ ํฉ์ด ์ด๋ค Threshold๋ณด๋ค ๋์ผ๋ฉด 1์ด ๋์ค๊ณ ๋ฎ์ผ๋ฉด 0์ด ๋์ค๋ ํํ์ผ ๊ฒ์ ๋๋ค. ํ์ง๋ง ์ด๋ฐ ํํ์ activation function์ ๊ฒฝ์ฐ์๋ ๋ฏธ๋ถ์ด ๋ถ๊ฐ๋ฅํ๊ณ ๋ฐ๋ผ์ gradient descent๋ฅผ ๋ชป ์ฐ๊ธฐ ๋๋ฌธ์ ๊ทธ ์ด์ธ์ ๋ฏธ๋ถ๊ฐ๋ฅ ํจ์๋ฅผ ์ฌ์ฉํฉ๋๋ค. gradient descent์ ๋ํด์๋ ๋ค์์ ์ค๋ช ํ๊ฒ ์ต๋๋ค. ๋ฐ์ ์ฌ์ง์ activation function์ ์์์ ๋๋ค.

์์์ ๋งํ ๊ฐ์ฅ ๊ฐ๋จํ activation function์ ํํ๋ ์ฒซ๋ฒ์งธ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ต๋๋ค. ์์์ ์ธ๊ธํ๋ฏ์ด ์ด ํจ์ ๋์ ์ ๋ฏธ๋ถ๊ฐ๋ฅํ ํจ์๋ฅผ ์ฌ์ฉํ๊ฒ ๋์๊ณ ๊ทธ ์ค์ ๋ํ์ ์ธ ํจ์๊ฐ ์ธ๋ฒ์งธ ๊ทธ๋ํ์ธ sigmoid Function์ ๋๋ค. sigmoid function์ด๋ ๋ฌด์์ผ๊น์? ์์ผ๋ก ๋ค์๊ณผ ๊ฐ์ด ํํ๋ฉ๋๋ค.

activation function์ ์์์๋ sigmoid๋ง๊ณ ๋ ์ธ ๊ฐ์ง ๋ค๋ฅธ ํจ์๋ค์ด ์๋๋ฐ ์ด ํจ์๋ค์ ๋ค non-linearํฉ๋๋ค. ๊ทธ ์ด์ ๋ activation function์ด linearํ ๊ฒฝ์ฐ์๋ ์๋ฌด๋ฆฌ ๋ง์ neuron layer๋ฅผ ์๋๋ค ํ๋๋ผ๋ ๊ทธ๊ฒ์ด ๊ฒฐ๊ตญ ํ๋์ layer๋ก ํํ๋๊ธฐ ๋๋ฌธ์ ๋๋ค.
sigmoid function
tanh function
absolute function
ReLU function
๊ฐ์ฅ ์ค์ฉ์ ์ธ activation function์ ReLU function์ด๋ผ๊ณ ํฉ๋๋ค. ์ ํฌ ๋ํ ReLU function์ activation function์ผ๋ก ์ฌ์ฉํ์ต๋๋ค. ReLU๋ ์ด๋ค ํจ์์ผ๊น์? http://cs231n.github.io/neural-networks-1/

์์ ์ผ์ชฝ ๊ทธ๋ฆผ์ฒ๋ผ x๊ฐ 0๋ณด๋ค ์๊ฑฐ๋ ๊ฐ์๋๋ y๊ฐ 0์ด ๋์ค๊ณ x๊ฐ 0๋ณด๋ค ํด๋๋ x๊ฐ ๋์ค๋ ํจ์๋ฅผ ReLU(The Rectified Linear Unit)์ด๋ผ๋ ํจ์์ ๋๋ค. ์ ๊ธ์ ์จ์ ธ์๋ฏ์ด ์ต๊ทผ ๋ช ๋ ๋์ ์ ๋ช ํด์ง๊ณ ์๋ ํจ์์ ๋๋ค. ์ฌ์ค ๋ฅ๋ฌ๋์ด ์ต๊ทผ์ ๊ฐ์๊ธฐ ๊ธ๋ถ์ํ ์ด์ ๋ ์์ฒญ ํ์ ์ ์ธ ๋ณํ๊ฐ ์์๋ ๊ฒ์ด ์๋๊ณ activationํจ์๋ฅผ sigmoid์์ ReLU๋ก ๋ฐ๊พธ๋ ๋ฑ์ ์์ ๋ณํ๋ค์ ์ํฅ์ด ํฌ๋ค๊ณ ๋ณผ ์ ์์ต๋๋ค.
sigmoidํจ์์ ๋นํด์ ReLUํจ์๋ ์ด๋ ํ ์ฅ์ ์ด ์์๊น์? ์ ๊ทธ๋ฆผ์์ ๋ณด๋ฏ์ด ReLU์ ์ง์ ์ ์ธ ํํ์ sigmoidํจ์์ฒ๋ผ ์๋ ดํ๋ ํํ๊ฐ ์๋ ์ ์ด ReLU์ stochastic gradient descent ๊ฐ ๋ ์ ์๋ ดํ๊ฒ ํด์ค๋๋ค. ๋ํ ์๋์ ์ผ๋ก sigmoidํจ์์ ๋นํด์ ๊ณ์ฐ๋์ด ์ค ๊ฒ ๋ฉ๋๋ค. ์ฅ์ ์ด ์์ผ๋ฉด ๋จ์ ๋ ์๋ ๋ฒ์ ๋๋ค. ๋จ์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. Learning rate์ ๋ฐ๋ผ์ ์ค๊ฐ์ ์ต๋ 40%์ ๋์ network๊ฐ "die"ํ ์ ์๋ค๊ณ ํฉ๋๋ค. ๋จ, learning rate๋ฅผ ์ ์กฐ์ ํ๋ฉด ์ด ๋ฌธ์ ๋ ๊ทธ๋ ๊ฒ ํฌ์ง ์์ต๋๋ค.

์์์ ์ดํด๋ณธ artificial neuron๋ค์ network๋ก ํํํ๋ฉด ์์ ๊ฐ์ต๋๋ค. ์ฌ์ค์ ์ฌ๋ ๋์ ๋ด๋ฐ๋ค์ ์ด๋ณด๋ค ์๋นํ ๋ ๋ณต์กํ๊ฒ ์ฐ๊ฒฐ๋์ด ์์ง๋ง ๋จธ์ ๋ฌ๋์์ ์ฌ์ฉํ๋ neural network๋ ํจ์ฌ ๊ฐ๋จํ ํํ์ ๋๋ค. ์์์ ๋ณด์ด๋ ๋๊ทธ๋ผ๋ฏธ๋ค์ ๋ด๋ฐ์ ํด๋นํ๋ node๋ค์ ๋๋ค. ์ด node๋ค์ ๊ฐ ์ธต์ผ๋ก ๋ถ๋ฅ๋ ์ ์๊ณ ๊ฐ์ ์ธต์์์๋ ์ฐ๊ฒฐ๋์ด ์์ง ์์ต๋๋ค. ์ ๋ณด์ ๋ฐฉํฅ์ ์ผ์ชฝ์์ ์ค๋ฅธ์ชฝ์ผ๋ก ํ๋ฌ๊ฐ๋๋ฐ ๊ทธ๋ ์ง ์์ network๋ ์์ต๋๋ค(RNN). ๋ณดํต์ node๋ค์ด fully-connected๋์ด ์์ด์ ํ node์์ ๋์จ output๋ค์ ๋ค์ ์ธต์ ๋ชจ๋ node์ input์ผ๋ก ๋ค์ด๊ฐ๊ฒ ๋ฉ๋๋ค. ์ผ์ชฝ๊ณผ ์ค๋ฅธ์ชฝ์ ๋ ๋ค neural network์ด์ง๋ง ์ฐจ์ด๋ ์ค๋ฅธ์ชฝ์ network๋ hidden layer๊ฐ 2์ธต์ธ ๊ฒ์ ์ ์ ์๊ณ hidden layer๊ฐ 2์ธต ์ด์์ธ neural network๋ฅผ deep neural network๋ผ๊ณ ๋ถ๋ฆ ๋๋ค.
3. SGD(Stochastic Gradient Descent) and Back-Propagation
(1) SGD
์ง๊ธ๊น์ง๋ deep neural network๊ฐ ๋ฌด์์ธ์ง์ ๋ํด์ ์ดํด๋ณด์์ต๋๋ค. ๋ค์ ์ด ๊ธ์ ์ฒ์์ผ๋ก ๋์๊ฐ์ DQN์ด๋ action-value function์ deep neural network๋ก approximationํ ๊ฒ์ ๋งํฉ๋๋ค. ๊ฐํํ์ต์ ๋ชฉํ๋ optimal policy๋ฅผ ๊ตฌํ๋ ๊ฒ์ด๊ณ ๊ฐ state์์ optimalํ action value function์ ์๊ณ ์์ผ๋ฉด q๊ฐ์ด ํฐ action์ ์ทจํ๋ฉด ๋๋ ๊ฒ์ด๋ฏ๋ก ๊ฒฐ๊ตญ์ q-value๋ฅผ ๊ตฌํ๋ฉด ๊ฐํํ์ต ๋ฌธ์ ๋ฅผ ํ๊ฒ๋ฉ๋๋ค. ์ด q-value๋ DNN(deep neural networks)๋ฅผ ํตํด์ ๋์ค๊ฒ ๋๋๋ฐ ๊ฒฐ๊ตญ DNN์ ํ์ต์ํค๋ ๊ฒ์ด ๋ชฉํ๊ฐ ๋๊ฒ ๋ฉ๋๋ค.
๋ฐ๋ผ์ approximationํ์ง ์์์ ๋์ ๋ค๋ฅธ ๊ฒ์ q-table์ ๋ง๋ค์ด์ ๊ฐ๊ฐ์ q-value๋ฅผ updateํ๋ ๊ฒ์ด ์๋๊ณ DNN์์ weight์ bias๋ฅผ updateํ๊ฒ ๋ฉ๋๋ค. ๊ทธ๋ ๋ค๋ฉด ์ด๋ป๊ฒ updateํ ๊น์?
์ด ๋ ์ด์ ์ ๋ฐฐ์ ๋ Stochastic Gradient Descent๊ฐ ์ฌ์ฉ๋ฉ๋๋ค. ์ ๋ฆฌํ์๋ฉด gradient descent๋ผ๋ ๊ฒ์ w๋ฅผ parameter๋ก ๊ฐ์ง๋ J๋ผ๋ objective function์ minimizeํ๋ ๋ฐฉ๋ฒ์ค์ ํ๋๋ก์ w์ ๋ํ J์ gradient์ ๋ฐ๋๋ฐฉํฅ์ผ๋ก w๋ฅผ updateํ๋ ๋ฐฉ์์ ๋งํฉ๋๋ค.
์ด๋ฐ์์ผ๋ก update๋ฅผ ํ๊ฒ๋๋๋ฐ ๋ชจ๋ ๋ฐ์ดํฐ์ ๋ํด์ gradient๋ฅผ ๊ตฌํด์ ํ ๋ฒ updateํ๋ ๊ฒ์ด ์๋๊ณ sampling์ ํตํด์ ์์ฐจ์ ์ผ๋ก updateํ๊ฒ ๋ค๋ gradient descent๋ฐฉ๋ฒ์ด stochastic gradient descent์ ๋๋ค. ์๋ ํ์ด์ง๋ฅผ ์ฐธ๊ณ ํด๋ณด๋ฉด ๊ทธ๋ ๊ฒ ํ ๊ฒฝ์ฐ ์๋ ดํ๋ ์๋๊ฐ ํจ์ฌ ๋น ๋ฅด๋ฉฐ online์ผ๋ก๋ ํ์ตํ ์ ์๋ค๋ ์ฅ์ ์ด ์์ต๋๋ค. ๋ํ ํ๋ ์ค์ํ ์ ์ gradient descent๋ฐฉ๋ฒ์ local optimum์ผ๋ก ๊ฐ ์ ์๋ค๋ ๋จ์ ์ด ์์ต๋๋ค. http://sebastianruder.com/optimizing-gradient-descent/
(2) Back-Propagation
์ด gradient๋ฅผ ๊ตฌํ๋ค๋ฉด DNN์ ์์ ์๋ parameter๋ค์ ์ด๋ป๊ฒ updateํ ๊น์? ๋ค์ DNN์์์ data๊ฐ ์ ๋ฌ๋์ด๊ฐ๋ ๊ณผ์ ์ ์๊ฐํด๋ด
์๋ค. input์ด ๋ค์ด๊ฐ๋ฉด layer๋ค์ ๊ฑฐ์ณ๊ฐ๋ฉฐ ouput layer์ ๋๋ฌํ data๊ฐ output์ด ๋์ด์ ๋์ค๊ฒ ๋ฉ๋๋ค.
parameter๋ฅผ SGD๋ก updateํ ๋๋ ๊ทธ ๋ฐ๋ ๋ฐฉํฅ์ผ๋ก ๊ฐ๊ฒ ๋ฉ๋๋ค. ๋ฐ๋ผ์ ๊ทธ ์ด๋ฆ์ด Back-Propagation์ด๋ผ๋ ์ด๋ฆ์ด ๋ถ์ต๋๋ค. Tensorflow๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ์๋ ๊ทธ๋ฌํ ์๋ค์ด libraryํ ๋์์ด์ ์ฌ๊ธฐ์ ๋ค๋ฃฐ ๋ด์ฉ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
Last updated
Was this helpful?