linear regression by bgd