본문 바로가기

머신러닝/peter's

Linear Regression With Python

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를 미분한 값을 빼준다. (중요)


Δw=μξw

With μ the learning rate, which is how big of a step you take along the gradient, and ξ/w the gradient of the cost function ξ with respect to the weight w. For each sample i this gradient can be splitted according to the chain rule into:



Chain rule 에 의해 아래 식이 나옴








소스에서는 w = 0.1 로 놓고 4번 iteration 하는 예제임


w = w - dw 를 함으로써 새로운 w를 계속해서 구함.



결론 : w 에 해당 하는 cost를 계속 구해서 그래프를 그려나감.

'머신러닝 > peter's' 카테고리의 다른 글

Logistic regression  (0) 2016.07.01