linear regression1 선형 회귀 알고리즘 구현, 비용함수, 경사하강법 선형 회귀 알고리즘 구현, 비용함수, 경사하강법 import numpy as npnumber_of_points = 500; x_point=[]y_point=[]a=0.22 #선형관계 지수b=0.78 for i in range(number_of_points): x=np.random.normal(0.0,0.5) y=a*x+b+np.random.normal(0.0,0.1) x_point.append([x]); y_point.append([y]); import matplotlib.pyplot as pltplt.plot(x_point,y_point,'o',label='Input Data')plt.legend()plt.show() #비용함수와 경사하강법import tensorflow as tfA = tf.Varia.. 2017. 4. 14. 이전 1 다음 반응형