![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbmdvaq%2FbtqCn0pl9IC%2F7H8FGY0ur430RNt14Xr120%2Fimg.png)
๊น์ด์ง ์ธ๊ณต์ ๊ฒฝ๋ง์ ๋ฌธ์ ์ Generalization : training์ ์ฌ์ฉ๋์ง ์์ data์ ๋ํ ์ฑ๋ฅ Data set Training set training์ ์ฌ์ฉํ๋ data set Validation set ์ฃผ์ด์ง data set ์ค ๋นผ๋์๋ค๊ฐ ์ฑ๋ฅ์ ๊ฒ์ฆํ ๋ ์ฌ์ฉํ๋ data set Test set ์ฃผ์ด์ง์ง ์์๋ ์ ํ ์ ์๋ data set ํ์ต์ด training set์ผ๋ก ์งํ๋๊ธฐ ๋๋ฌธ์, ํ์ต์ ๋ฐ๋ณตํ ์๋ก training set์ ๋ํ ์ ํ๋๋ ๋์์ง๊ณ ์ค๋ฅ์จ์ ๋ฎ์์ง๋ค. ํ์ง๋ง validation set์ ๋ํ ์ค๋ฅ์จ์ ๋ฎ์์ง๋ค๊ฐ ๋์์ง๋ ํ์์ ๋๋๋ฐ, ์ด๋ ํ์ต์ด ๋๋ฌด training set์๋ง ์ ํฉํ๊ฒ ๋์๊ธฐ ๋๋ฌธ์ด๋ค. ์ด๋ฅผ training set์ overfitting(..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbRzuZH%2FbtqBQoyF3u3%2Fm3k7BlwTqFrni2zj7XupE1%2Fimg.png)
deep neural network์์์ backpropagation backpropagation ์๋ backpropagation(์ญ์ ํ)๋ ํ์ต ๋ฐฉ์์ด ์๋๋ผ perceptron์์ loss function์ ๊ธฐ์ธ๊ธฐ๋ฅผ ๊ณ์ฐํ๋ ์๊ณ ๋ฆฌ์ฆ์ ๋ปํ์ง๋ง, ๋์ ์๋ฏธ์์๋ ๊ธฐ์ธ๊ธฐ๋ฅผ ์ด์ฉํ ํ์ต ๋ฐฉ์์ผ๋ก ์ฐ์ธ๋ค. ์ฐธ๊ณ : https://en.wikipedia.org/wiki/Backpropagation delta rule https://en.wikipedia.org/wiki/Delta_rule delta rule์ ์ ์์ ์ฆ๋ช delta rule์ backpropagation ๋ฐฉ๋ฒ ์ค ํ๋์ด๋ค. delta rule์ ์ multi-layer์์ ์ฌ์ฉํ ์ ์๋๊ฐ... ๋ณธ๋ก 5์์์ ๊ฐ์ด ์ฒ์์๋ ์ ๊ฒฝ๋งํ์ต์์ d..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FchwH92%2FbtqBUSEP7OY%2FGEk9hkoed7131zbtAkOIg0%2Fimg.png)
theta๊ฐ ํ์ํ ์ด์ ์์ ๊ทธ๋ฆผ์ theta๊ฐ ์์ ๋์ ์ฐ์ฐ์ ๋ํ๋ธ ๊ฒ์ด๋ค. ์ด ๋ ํ์ฑํ ํจ์๊ฐ sigmoid๋ผ๋ฉด ์ ๋ ฅ์ด (0,0)์ผ ๋ ์ถ๋ ฅ์ด ๋ค๋ฅธ ์๊ฐ ๋์ค๋ ๊ฒฝ์ฐ๋ฅผ ๋ง์กฑํ ์ ์์๊น? theta๊ฐ ์๋ค๋ฉด net์ ์ ๋ ฅ์ด (0,0)์ผ ๋ ํญ์ 0์ด๋ค. ๋ฐ๋ผ์ ์ถ๋ ฅ์ sigmoid ํจ์๋ฅผ ๊ฑฐ์ณ ํญ์ 1/2 ์ด ๋์จ๋ค. (0,0)์ ์ ๋ ฅ์์ ๋ค๋ฅธ ์ถ๋ ฅ์ด ๋์ค๊ฒ ํ๋ ค๋ฉด sigmoid ํจ์๋ฅผ output์ถ(y์ถ) ๋ฐฉํฅ์ผ๋ก ์์ง์ผ ์ ์์ด์ผํ๋ค. ์ด ์ญํ ์ ์ํด์ theta๋ ์กด์ฌํ๋ ๊ฒ์ด๋ค! net = x1*w1 + x2*x2 + theta , O = f(net) = f(theta) ์ด๋ฏ๋ก theta ๋งํผ ๊ทธ๋ํ๋ฅผ net์ถ์ผ๋ก ์ด๋ํ ๊ฒ์ฒ๋ผ ์๊ฐํ ์ ์๋ค. ์ผ์ชฝ ๊ธฐ์กด์ sigmoid ํจ์์์ (0..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FR9LPM%2FbtqBNNrTsIX%2FkxgFgXBLofULdnjARjrKf0%2Fimg.png)
์ ๊ฒฝ๋ง์ ์๋ฆฌ ์ด์ multi-layer perceptron์ ์ด์ฉํ ์ ์๊ฒ ๋์์ง๋ง, ์ ํํ ๊ตฌ๋์ํค๊ธฐ ์ํด ์์์ผํ ๊ฒ์ด ์๋ค. ์ฃผ์ด์ง input์ ๊ฐ์ง๊ณ ๊ณ์ฐ์ ํด์ output์ ๋ผ ์๋ ์์ง๋ง, output ๊ฐ์ด ์ฃผ์ด์ง ์ ๋ต๊ณผ ๋ค๋ฅผ ๋ ํ์ตํ๋ ๊ธฐ๋ฅ์ ์์ง ๊ตฌํํ์ง ๋ชปํ๋ค. ์ฌ๊ธฐ์ ํ์ต์ด๋ w๊ฐ์ ์กฐ์ ํ๋ ๊ฒ์ ๋งํ๋ค. w๊ฐ์ ์กฐ์ ํ๋ ํ์ต์ ํ๊ธฐ ์ํด์๋ ๋๋ค, ์กฐ๊ธ์ฉ ์ฎ๊ฒจ๋ณด๊ธฐ ์ ๋ฐฉ์๋ณด๋ค๋ ๋ฏธ๋ถ์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข๋ค. w์ ๋ํ Error์ ๋ฏธ๋ถ๊ฐ์ ๊ตฌํ ํ ๋ฐ๋์ชฝ์ผ๋ก ์ผ์ ์น๋งํผ ์์ง์ฌ์ผ ํ๋ฏ๋ก Error๋ฅผ w์ ์์ผ๋ก ๋ํ๋ผ ์ ์์ด์ผ ํ๊ณ , ์กฐ์ ๋๋ w์ ๊ฐ์ ์ด์ ๊ด๋ จํ์ฌ ํํํ ์ ์์ด์ผํ๋ค. ๊ฒฐ๊ตญ error๋ฅผ ์ค์ด๊ธฐ ์ํด w๊ฐ์ ์กฐ์ ํ๋ ๊ณผ์ ์ error์ ๋ํ w์ ๋ฏธ๋ถ๊ฐ์ด ํ์..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdp4qU9%2FbtqBQnFtiNh%2F4dqlHdGyAGcljEqb80f4R0%2Fimg.png)
Restricted Boltzmann machine (RBM) ๊ตฌ์ฑ ๋๊ฐ์ ์ธต(๊ฐ์์ธต, ์๋์ธต)์ผ๋ก ๊ตฌ์ฑ๋์ด ์๋ ๋จ์ผ ์ ๊ฒฝ๋ง ์ฌ์ธต ์ ๋ขฐ ์ ๊ฒฝ๋ง์ ๊ตฌ์ฑํ๋ ์์๋ก ์ฐ์ ๊ฐ ์ธต์ ๋ ธ๋๋ ๋ค๋ฅธ ์ธต์ ๋ ธ๋์ ๋ชจ๋ ์ฐ๊ฒฐ๋์ด์๊ณ , ๊ฐ์ ์ธต์ ๋ ธ๋๋ผ๋ฆฌ๋ ์ฐ๊ฒฐx ์์ผ๋ก ๊ณ์ฐํ๋ฉด ๋ชจ๋ ์ ๋ ฅ๋ ธ๋๋ฅผ ์ด์ฉํ ์์ด ์๋์ธต ๋ ธ๋์ ๊ฐ์ด ๋จ ๋์นญ ์ด๋ถ ๊ทธ๋ํ ๋ผ๊ณ ๋ ๋ถ๋ฆผ ๋น์ง๋ํ์ต ํ์ต ์ค backward sweep ์ forward sweep ํ์ ๋์ ๋ง์ฐฌ๊ฐ์ง๋ก ์ธต๊ฐ ๋ชจ๋ ๋ ธ๋์ ์ฐ๊ฒฐ์ ํตํด์ ๊ฐ์ด ๊ฑด๋๊ฐ๋ค. ์ฆ, ๊ฐ์์ธต์ ๊ฐ์ ์๋์ธต์ ๋ชจ๋ ๊ฐ์ ๊ฐ์ค์น๋ฅผ ๊ณฑํด์ ๋ํ๋ค. ๊ทธ ๊ฒฐ๊ณผ ์ค์ฐจ๋ ์ฌ๊ตฌ์ฑํ ๊ฐ๊ณผ ์ ๋ ฅ๊ฐ์ ์ฐจ์ด์ด๋ค. forward sweep w๊ฐ ์ฃผ์ด์ก์ ๋ ์ ๋ ฅ v์ ๋ํ ์๋์ธต h์ ์กฐ๊ฑด๋ถ ํ๋ฅ backward sw..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdyFxBR%2FbtqBGqO5Hrh%2FmQvV0ORbJajEbA6h6R5lk0%2Fimg.png)
๋ฅ๋ฌ๋์ ์์ ์ด๋ฌํ multi-layer ์ forward-propagation ๊ณผ์ ์ ์์ผ๋ก ๋ํ๋ด๋ณด๋ฉด, h1 = f(x11*w11+x12*w21) net = h1*w13+h2*w23 = f(x11*w11+x12*w21)*w13+f(x11*w12+x12*w22)*w23 ์ฌ๊ธฐ์ f ์ฆ, activation fuction์ด linearํ function์ด๋ผ๊ณ ๊ฐ์ ํด๋ณด์. ๊ทธ๋ ๋ค๋ฉด f(x) = ax์ ํํ์ด๋ฏ๋ก, net = x11*a(w11*w13+w12*w23)+x12*a(w21*w13+w22*w23) ์ผ๋ก ๋ํ๋ผ ์ ์๋ค. ๊ทธ๋ฆฌ๊ณ ์ด๋ฌํ net์ ๊ฐ์ฅ ์ฒ์์ ์ฃผ์ด์ง input layer์๋ค๊ฐ ์์๋ฅผ ๊ณฑํ ๊ผด์ด๋ฏ๋ก one-layer๋ก ๋ํ๋ผ ์ ์๋ค. ์ฆ, ์ฌ๋ฌ ๊ฐ์ layer๋ฅผ ๊ฑฐ์ณค์์๋ ์ฌ์ด ๋ฌธ์ ๋ก ..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FuF6DB%2FbtqBE1PP2pE%2FKbikgn6uyvy26o9ZcaQbnK%2Fimg.png)
weight์ ๋ณํ 1. ๋๋ค ์ค์ต one-layer perceptron weight๋ฅผ ๋๋ค์ผ๋ก ํ์ตํ๋ ํผ์ ํธ๋ก ๋ง๋ค๊ธฐ input, weight ๊ฐฏ์๋ ์ ๋ ฅ๋ฐ๊ธฐ output์ 1๊ฐ๋ก ๊ณ ์ /* 2020-01-28 W.HE one-layer perceptron */ #include #include #include main() { /* variable set */ int input_num; float* input; float* w; float output = 0; float answer = 3; int try_num = 0; /* input input_num */ printf("enter number of inputs\n"); scanf_s("%d", &input_num); /* memory allocat..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdxG2jU%2FbtqBD1JzhTQ%2F4RZoAj9zoDHIa1Pni0hlP1%2Fimg.png)
์ ๊ฒฝ๋ง ํ์ต ์ธ๊ฐ์ ๋์ธํฌ ๋ด๋ฐ์ ๋ณธ๋ด classifier Collection => Processing => Dissemination(์ ํ) ๊ณผ์ ์ ๊ฑฐ์นจ ๋จ์ผ ์ ๊ฒฝ๋ง ๊ธฐ๋ณธ ๊ตฌ์กฐ ๋ด๋ฐ : input(์ ๋ ฅ), weight(ํ์ต, ๊ธฐ์ต), net(ํ์ฑํ ๋ ๋ฒจ), ํ์ฑํ ํจ์ ๋ถ์ ๋ด๋ฐ์ weight๋ ํ์ต, ๊ธฐ์ต์ ์ญํ ์ ํจ ( ==๋ด๋ฐ์ ๊ธฐ๋ฅ ) ๋ณ๊ฒฝ๋๋ฉด ๋ด๋ฐ์ ๊ธฐ๋ฅ์ด ๋ณ๊ฒฝ๋จ x [input] * w [weight] = net O = f(net) [activation function] Error = T [answer] - O [f(net)] ์ด๋ฌํ ํ๋ฆ์ผ๋ก ๊ณ์ฐํ๋ ๊ฒ์ forward propagation์ด๋ผ๊ณ ํจ ๋ชฉํ : input์ ๋ฐ๋ฅธ output์ด ์ ํํ ๋ถ๋ฅ๋์ด ๋์์ผ ํจ Error๊ฐ 0์ ๊ฐ๊น์์ง..
Comment