본문 바로가기

tensorflow3

딥러닝: 04. Logistic Classification(로지스틱 회귀) 1.Logistic(regression) classification¶ Binary classification - True(1)/ False(0) 를 판단한다 logistic fnc)(시그모이드 함수) : H(X) = 1 / 1 + e^(-W^T*X) 시그모이드 함수를 사용했기 때문에 cost function 의 모양이 변한다. cost function for logistic¶ Minimize cost - Gradient decent algorithm¶ In [11]: import tensorflow as tf import numpy as np In [12]: xy = np.loadtxt('./dataset/pass.csv', delimiter=',', dtype=np.float32) In [13]: x .. 2019. 7. 30.
딥러닝: 03. 다중 선형 회귀(Multi Variable linear regression) In [6]: import numpy as np import tensorflow as tf In [14]: xy = np.loadtxt('./dataset/data-01-test-score.csv',delimiter=',' , dtype = np.float32 ) x = xy[:,0:-1] y = xy[:,[-1]] In [16]: print(x.shape, x, len(x)) print(y.shape, y, len(y)) (25, 3) [[ 73. 80. 75.] [ 93. 88. 93.] [ 89. 91. 90.] [ 96. 98. 100.] [ 73. 66. 70.] [ 53. 46. 55.] [ 69. 74. 77.] [ 47. 56. 60.] [ 87. 79. 90... 2019. 7. 30.
딥러닝: 02. 경사하강법(Gradient descent algorithm) Gradient descent algorithm¶ cost(W,b) fnc. 의 최소값을 찾는다. 어떤 점에서든 시작할 수 있다. 조금씩 W를 바꿔 최적의 cost(W,b)를 찾는다. In [29]: import tensorflow as tf import matplotlib.pyplot as plt In [30]: X = [1,2,3] Y = [1,2,3] W = tf.placeholder(tf.float32) hypothesis = X * W cost = tf.reduce_mean(tf.square(hypothesis - Y)) sess = tf.Session() sess.run(tf.global_variables_initializer()) W_val = [] cost_val = [] for i in .. 2019. 7. 30.