머신러닝/peter's
Linear Regression With Python
무대포개발자
2016. 7. 1. 16:23
http://peterroelants.github.io/posts/neural_network_implementation_part01/ 내용 정리
Source는 SVN에 있음. ipynb
Linear regression
- 개념 설명
Define the target function
- t = f(x) + noise
Define the cost function
- cost func 그리기
Gradient descent
- w(k+1)=w(k)−Δw(k)
- weight의 다음 값은 w의 현재 값에서 w를 미분한 값을 빼준다. (중요)
With the learning rate, which is how big of a step you take along the gradient, and the gradient of the cost function with respect to the weight . For each sample this gradient can be splitted according to the chain rule into:
Chain rule 에 의해 아래 식이 나옴
소스에서는 w = 0.1 로 놓고 4번 iteration 하는 예제임
w = w - dw 를 함으로써 새로운 w를 계속해서 구함.
결론 : w 에 해당 하는 cost를 계속 구해서 그래프를 그려나감.