티스토리 뷰
1. Tensorflow 로 Logistic Classfication의 구현하기(new)
cost를 작게하는 W를 구하는것이 이번 장의 핵심!
가장 작은 W를 구하는 방법은? 위의 2차 함수에서 어떤 주어진 점에서 기울기를 구해서 기울기의 반대방향으로 움직이면 된다. 여기서 a(알파)는 그만큼 움직이는 수
2. Training Data
x_data는 2개 , y_data는 1개를 나타내는것을 볼 수 있는데, 여기서 tf.placeholder를 사용하여 float32타입으로 하나의 노드를 생성시키고, shape값을 지정하는데 이것은 N개의 개수로 놓을때, None의 속성값을 주고, 2개의 데이터를 나타내므로 shape = [None,2] 이런식으로 나타낼 수 있다.
3. Code 설명
1. x,y로 노드를 생성한다. (Shape=None,2 / Shape = None,1
2. Variable을 사용하여 weight값과 bias값을 지정한다
3. H(x)식 hypothesis를 간단히 구할 수 있는 메소드는 tf.sigmoid를 사용하여 간단히 구할 수 있다.
4. tf.reduce_mean 메소드를 사용하여 시그마 값을 구할 수 있다. 이 시그마값을 구한 후 cost(W)값을 구할 수 있다.
5. 이제 위에서 구한 값들을 이용하여 tf.train 에 있는 메소드 GradientDescentOptimizer를 사용하여 W:값을 구한다. predicted 값과 ,accurac값을 적절한 형변환 한다.
이제 이것들을 활용하여 train model에다가 training을 한다.
* train the model
1. 세션을 생성시킨후 variables들을 모두 초기화 시켜준다
2. 10001 Range 까지 반복문 실행후 train그래프를 실행시키게 되면서 x_data와 y_data를 던져 주게 된다.
3. 200번 마다 step과 cost_val값을 출력 시켜 주게 된다.
4. 이제 세션들을 모두 run 시키면서 hypothesis, predicted , accuracy값들을 실행시키게 되어 그 값들을 h,c,a에 넣어 print로 출력하여 확인해볼 수 있다.
4. 전체 코드
5. 응용 하기(Classifying diabetes)
import tensorflow as tf | |
tf.set_random_seed(777) # for reproducibility | |
x_data = [[1, 2], | |
[2, 3], | |
[3, 1], | |
[4, 3], | |
[5, 3], | |
[6, 2]] | |
y_data = [[0], | |
[0], | |
[0], | |
[1], | |
[1], | |
[1]] | |
# placeholders for a tensor that will be always fed. | |
X = tf.placeholder(tf.float32, shape=[None, 2]) | |
Y = tf.placeholder(tf.float32, shape=[None, 1]) | |
W = tf.Variable(tf.random_normal([2, 1]), name='weight') | |
b = tf.Variable(tf.random_normal([1]), name='bias') | |
# Hypothesis using sigmoid: tf.div(1., 1. + tf.exp(tf.matmul(X, W))) | |
hypothesis = tf.sigmoid(tf.matmul(X, W) + b) | |
# cost/loss function | |
cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y) * | |
tf.log(1 - hypothesis)) | |
train = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost) | |
# Accuracy computation | |
# True if hypothesis>0.5 else False | |
predicted = tf.cast(hypothesis > 0.5, dtype=tf.float32) | |
accuracy = tf.reduce_mean(tf.cast(tf.equal(predicted, Y), dtype=tf.float32)) | |
# Launch graph | |
with tf.Session() as sess: | |
# Initialize TensorFlow variables | |
sess.run(tf.global_variables_initializer()) | |
for step in range(10001): | |
cost_val, _ = sess.run([cost, train], feed_dict={X: x_data, Y: y_data}) | |
if step % 200 == 0: | |
print(step, cost_val) | |
# Accuracy report | |
h, c, a = sess.run([hypothesis, predicted, accuracy], | |
feed_dict={X: x_data, Y: y_data}) | |
print("\nHypothesis: ", h, "\nCorrect (Y): ", c, "\nAccuracy: ", a) | |
import tensorflow as tf | |
import numpy as np | |
tf.set_random_seed(777) # for reproducibility | |
xy = np.loadtxt('data-03-diabetes.csv', delimiter=',', dtype=np.float32) | |
x_data = xy[:, 0:-1] | |
y_data = xy[:, [-1]] | |
print(x_data.shape, y_data.shape) | |
# placeholders for a tensor that will be always fed. | |
X = tf.placeholder(tf.float32, shape=[None, 8]) | |
Y = tf.placeholder(tf.float32, shape=[None, 1]) | |
W = tf.Variable(tf.random_normal([8, 1]), name='weight') | |
b = tf.Variable(tf.random_normal([1]), name='bias') | |
# Hypothesis using sigmoid: tf.div(1., 1. + tf.exp(tf.matmul(X, W))) | |
hypothesis = tf.sigmoid(tf.matmul(X, W) + b) | |
# cost/loss function | |
cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y) * | |
tf.log(1 - hypothesis)) | |
train = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(cost) | |
# Accuracy computation | |
# True if hypothesis>0.5 else False | |
predicted = tf.cast(hypothesis > 0.5, dtype=tf.float32) | |
accuracy = tf.reduce_mean(tf.cast(tf.equal(predicted, Y), dtype=tf.float32)) | |
# Launch graph | |
with tf.Session() as sess: | |
# Initialize TensorFlow variables | |
sess.run(tf.global_variables_initializer()) | |
for step in range(10001): | |
cost_val, _ = sess.run([cost, train], feed_dict={X: x_data, Y: y_data}) | |
if step % 200 == 0: | |
print(step, cost_val) | |
# Accuracy report | |
h, c, a = sess.run([hypothesis, predicted, accuracy], | |
feed_dict={X: x_data, Y: y_data}) | |
print("\nHypothesis: ", h, "\nCorrect (Y): ", c, "\nAccuracy: ", a) |
6. 실행 결과1
(0, 1.5079803)
(200, 0.3676095)
(400, 0.3527939)
(600, 0.340542)
(800, 0.32940093)
(1000, 0.3191423)
(1200, 0.309602)
(1400, 0.30066207)
(1600, 0.2922383)
(1800, 0.28426877)
(2000, 0.2767068)
(2200, 0.2695162)
(2400, 0.2626675)
(2600, 0.25613597)
(2800, 0.24990028)
(3000, 0.24394138)
(3200, 0.23824249)
(3400, 0.23278804)
(3600, 0.22756386)
(3800, 0.22255677)
(4000, 0.21775454)
(4200, 0.21314593)
(4400, 0.20872037)
(4600, 0.20446783)
(4800, 0.20037915)
(5000, 0.19644572)
(5200, 0.19265936)
(5400, 0.18901253)
(5600, 0.18549804)
(5800, 0.1821093)
(6000, 0.17883994)
(6200, 0.17568415)
(6400, 0.1726364)
(6600, 0.16969144)
(6800, 0.16684441)
(7000, 0.16409071)
(7200, 0.16142601)
(7400, 0.15884613)
(7600, 0.15634735)
(7800, 0.1539259)
(8000, 0.15157852)
(8200, 0.14930183)
(8400, 0.14709276)
(8600, 0.14494851)
(8800, 0.1428663)
(9000, 0.14084356)
(9200, 0.1388777)
(9400, 0.1369666)
(9600, 0.13510786)
(9800, 0.13329959)
(10000, 0.1315396)
('\nHypothesis: ', array([[0.02356477],
[0.14780492],
[0.268441 ],
[0.798558 ],
[0.94988024],
[0.98368007]], dtype=float32), '\nCorrect (Y): ', array([[0.],
[0.],
[0.],
[1.],
[1.],
[1.]], dtype=float32), '\nAccuracy: ', 1.0)
실행결과 2(당뇨병 표본)
(0, 0.82793975)
(200, 0.7551809)
(400, 0.72635543)
(600, 0.70517904)
(800, 0.6866307)
(1000, 0.669853)
(1200, 0.654603)
(1400, 0.6407365)
(1600, 0.6281296)
(1800, 0.61666805)
(2000, 0.60624564)
(2200, 0.59676415)
(2400, 0.58813345)
(2600, 0.58027065)
(2800, 0.5731005)
(3000, 0.5665548)
(3200, 0.5605713)
(3400, 0.5550946)
(3600, 0.5500747)
(3800, 0.5454661)
(4000, 0.54122907)
(4200, 0.53732735)
(4400, 0.5337287)
(4600, 0.53040445)
(4800, 0.52732897)
(5000, 0.5244792)
(5200, 0.5218346)
(5400, 0.519377)
(5600, 0.51708966)
(5800, 0.514958)
(6000, 0.5129687)
(6200, 0.5111098)
(6400, 0.5093705)
(6600, 0.5077413)
(6800, 0.50621307)
(7000, 0.5047781)
(7200, 0.5034291)
(7400, 0.50215966)
(7600, 0.5009635)
(7800, 0.4998357)
(8000, 0.49877086)
(8200, 0.49776477)
(8400, 0.49681306)
(8600, 0.49591216)
(8800, 0.49505854)
(9000, 0.49424884)
(9200, 0.49348038)
(9400, 0.49275038)
(9600, 0.49205622)
(9800, 0.49139577)
(10000, 0.49076685)
('\nHypothesis: ', array([[0.44348487],
[0.9153647 ],
[0.22591162],
[0.93583125],
[0.33763626],
[0.70926887],
[0.9440914 ],
[0.63417906],
[0.25953037],
[0.46434346],
[0.64745134],
[0.2013701 ],
[0.25898227],
[0.3507237 ],
[0.7484501 ],
[0.48230037],
[0.70017725],
[0.9126371 ],
[0.81194925],
[0.56007695],
[0.64738876],
[0.10781654],
[0.6211922 ],
[0.6812047 ],
[0.3879278 ],
[0.9218674 ],
[0.5113428 ],
[0.57813394],
[0.7277054 ],
[0.42962766],
[0.947626 ],
[0.78322077],
[0.57234144],
[0.82043636],
[0.3719366 ],
[0.65550166],
[0.8322083 ],
[0.5858857 ],
[0.4828183 ],
[0.37765244],
[0.7715164 ],
[0.15435624],
[0.41105628],
[0.09908313],
[0.6002736 ],
[0.9216085 ],
[0.7503082 ],
[0.7309086 ],
[0.9057401 ],
[0.9337645 ],
[0.91885823],
[0.22622736],
[0.40282893],
[0.9670282 ],
[0.24808311],
[0.48856133],
[0.16441572],
[0.74614495],
[0.87746376],
[0.5058378 ],
[0.94102794],
[0.7067245 ],
[0.6720777 ],
[0.83451414],
[0.57611436],
[0.56968987],
[0.9423231 ],
[0.62705135],
[0.8611879 ],
[0.66249925],
[0.28705814],
[0.68772477],
[0.90430325],
[0.93054074],
[0.8619426 ],
[0.79959214],
[0.5011081 ],
[0.851752 ],
[0.9077294 ],
[0.91465306],
[0.8482475 ],
[0.8133985 ],
[0.3305776 ],
[0.7996024 ],
[0.5579508 ],
[0.8760086 ],
[0.46680826],
[0.88466996],
[0.9295567 ],
[0.75336826],
[0.8224553 ],
[0.6240478 ],
[0.6739127 ],
[0.5920257 ],
[0.90274733],
[0.9736109 ],
[0.9006145 ],
[0.58983034],
[0.28804177],
[0.6286034 ],
[0.50599474],
[0.94689244],
[0.79772764],
[0.78799766],
[0.74173564],
[0.7075536 ],
[0.9247627 ],
[0.79692364],
[0.4833581 ],
[0.42817965],
[0.91080415],
[0.8747808 ],
[0.49349838],
[0.38975462],
[0.6205439 ],
[0.86676735],
[0.8711117 ],
[0.9021138 ],
[0.19183865],
[0.74102116],
[0.83572984],
[0.584201 ],
[0.60889226],
[0.90380293],
[0.73348796],
[0.8431135 ],
[0.77833253],
[0.58289593],
[0.5162981 ],
[0.48885208],
[0.45935678],
[0.79451776],
[0.91807514],
[0.84374917],
[0.7949944 ],
[0.85585064],
[0.43244144],
[0.80172807],
[0.67200494],
[0.7287594 ],
[0.892524 ],
[0.6513482 ],
[0.592054 ],
[0.7229086 ],
[0.8944097 ],
[0.7614472 ],
[0.45333427],
[0.91975904],
[0.6181831 ],
[0.75063866],
[0.27331045],
[0.39573702],
[0.14643265],
[0.27661097],
[0.9209079 ],
[0.87682265],
[0.9268399 ],
[0.15622394],
[0.45511833],
[0.7731305 ],
[0.6303127 ],
[0.87436235],
[0.38049507],
[0.79983234],
[0.63154304],
[0.63753104],
[0.72437006],
[0.8205088 ],
[0.7225103 ],
[0.644892 ],
[0.8916267 ],
[0.8965665 ],
[0.94586605],
[0.24037465],
[0.79200023],
[0.2724574 ],
[0.428479 ],
[0.41106912],
[0.83278424],
[0.7077458 ],
[0.9084821 ],
[0.89983803],
[0.5593667 ],
[0.18515909],
[0.23126031],
[0.52138555],
[0.70186657],
[0.5924637 ],
[0.8138665 ],
[0.6199554 ],
[0.37586212],
[0.33271646],
[0.9074295 ],
[0.37606186],
[0.85864055],
[0.88906884],
[0.73362815],
[0.6664398 ],
[0.635792 ],
[0.54875034],
[0.7227512 ],
[0.92644846],
[0.7838188 ],
[0.78484607],
[0.16648032],
[0.26155692],
[0.9079235 ],
[0.21474457],
[0.9324346 ],
[0.28267318],
[0.23685995],
[0.5460347 ],
[0.682689 ],
[0.27264276],
[0.7702284 ],
[0.7163303 ],
[0.8068969 ],
[0.6973648 ],
[0.2204188 ],
[0.3221106 ],
[0.7011276 ],
[0.57344306],
[0.9110978 ],
[0.9200657 ],
[0.68174523],
[0.4616705 ],
[0.06047468],
[0.6672931 ],
[0.3636063 ],
[0.502833 ],
[0.9268252 ],
[0.6454942 ],
[0.93917227],
[0.2694309 ],
[0.15849417],
[0.27981663],
[0.6891854 ],
[0.91438967],
[0.87116045],
[0.6558525 ],
[0.72758436],
[0.58962077],
[0.16379216],
[0.5631413 ],
[0.17079303],
[0.60406107],
[0.8296625 ],
[0.7197742 ],
[0.63126683],
[0.9273156 ],
[0.82215315],
[0.80330724],
[0.78661615],
[0.7904222 ],
[0.8482827 ],
[0.45577043],
[0.4323323 ],
[0.54077005],
[0.8145451 ],
[0.65694064],
[0.6969459 ],
[0.8172718 ],
[0.388383 ],
[0.56082153],
[0.66170526],
[0.62019974],
[0.46870697],
[0.8935141 ],
[0.70107514],
[0.91088533],
[0.58294505],
[0.7786868 ],
[0.82171696],
[0.81825185],
[0.64801645],
[0.86337 ],
[0.38436705],
[0.593065 ],
[0.6432194 ],
[0.3211656 ],
[0.7663024 ],
[0.30135295],
[0.61643463],
[0.92937034],
[0.77416193],
[0.83075243],
[0.7328758 ],
[0.5308521 ],
[0.7305944 ],
[0.4535324 ],
[0.515292 ],
[0.62174416],
[0.5828515 ],
[0.6644159 ],
[0.60110724],
[0.25209838],
[0.70171493],
[0.8832898 ],
[0.49269295],
[0.55240005],
[0.7555515 ],
[0.47591224],
[0.71548027],
[0.5438321 ],
[0.7196998 ],
[0.8916029 ],
[0.68694806],
[0.66260934],
[0.8838498 ],
[0.575437 ],
[0.8533249 ],
[0.91234094],
[0.29163304],
[0.7950291 ],
[0.22171356],
[0.7898905 ],
[0.7936038 ],
[0.69622296],
[0.30619732],
[0.78933454],
[0.69838697],
[0.76624656],
[0.20785281],
[0.8006819 ],
[0.8360086 ],
[0.5831884 ],
[0.9443234 ],
[0.33497918],
[0.63417745],
[0.9403417 ],
[0.267043 ],
[0.53737307],
[0.6632525 ],
[0.34147513],
[0.18768631],
[0.8227757 ],
[0.89777267],
[0.85066694],
[0.5736877 ],
[0.6930104 ],
[0.5546943 ],
[0.8072825 ],
[0.78953505],
[0.92085654],
[0.74930257],
[0.7606985 ],
[0.5274852 ],
[0.92507595],
[0.936637 ],
[0.7514222 ],
[0.24211979],
[0.74455845],
[0.46339172],
[0.758592 ],
[0.22341524],
[0.2847514 ],
[0.43424726],
[0.62925035],
[0.40992048],
[0.57794607],
[0.86769986],
[0.6182245 ],
[0.8469107 ],
[0.9219313 ],
[0.6652271 ],
[0.11281974],
[0.5561782 ],
[0.86496615],
[0.86661315],
[0.7361211 ],
[0.31306022],
[0.8419028 ],
[0.9036891 ],
[0.35566625],
[0.58162355],
[0.8252524 ],
[0.81827056],
[0.87852776],
[0.9005161 ],
[0.84348917],
[0.9139978 ],
[0.685808 ],
[0.58222806],
[0.5448358 ],
[0.8382333 ],
[0.8778371 ],
[0.275088 ],
[0.81035614],
[0.84945863],
[0.32469288],
[0.665941 ],
[0.8688517 ],
[0.5744996 ],
[0.8813922 ],
[0.29812017],
[0.83038664],
[0.580107 ],
[0.86577946],
[0.3905164 ],
[0.78442615],
[0.70089257],
[0.7654539 ],
[0.10487223],
[0.2832779 ],
[0.6420273 ],
[0.81158966],
[0.48725414],
[0.757057 ],
[0.560396 ],
[0.3450102 ],
[0.8427396 ],
[0.47088128],
[0.89001626],
[0.79944557],
[0.6554149 ],
[0.9103197 ],
[0.71775067],
[0.8176385 ],
[0.38046846],
[0.28783903],
[0.7678862 ],
[0.46867603],
[0.41779262],
[0.8799522 ],
[0.8737638 ],
[0.9016648 ],
[0.9397562 ],
[0.63108957],
[0.88971317],
[0.44869092],
[0.3704197 ],
[0.4545314 ],
[0.9244402 ],
[0.56591946],
[0.14451903],
[0.9247122 ],
[0.8176871 ],
[0.58533835],
[0.82063884],
[0.04074065],
[0.903477 ],
[0.74382514],
[0.7638223 ],
[0.746956 ],
[0.95469576],
[0.6107616 ],
[0.7986448 ],
[0.72812253],
[0.8823784 ],
[0.24653709],
[0.66903937],
[0.8980652 ],
[0.59970355],
[0.71646553],
[0.9284341 ],
[0.8481684 ],
[0.8573307 ],
[0.40936857],
[0.79820675],
[0.9462509 ],
[0.7732368 ],
[0.65917146],
[0.35805908],
[0.48135698],
[0.53641945],
[0.66543734],
[0.45865202],
[0.7632323 ],
[0.5398332 ],
[0.74884933],
[0.79249823],
[0.6932613 ],
[0.6092041 ],
[0.51973194],
[0.5462554 ],
[0.93328404],
[0.82414585],
[0.35082003],
[0.49633455],
[0.59151196],
[0.16269815],
[0.8700804 ],
[0.14488032],
[0.90538347],
[0.8432349 ],
[0.8302127 ],
[0.6980455 ],
[0.88925713],
[0.34941766],
[0.74698174],
[0.92957133],
[0.30203366],
[0.43846193],
[0.8194511 ],
[0.87369496],
[0.7040197 ],
[0.8314473 ],
[0.8057637 ],
[0.7749103 ],
[0.25775987],
[0.78441626],
[0.92062306],
[0.5840047 ],
[0.78953195],
[0.7088163 ],
[0.7919214 ],
[0.8541057 ],
[0.9291916 ],
[0.60357255],
[0.38285992],
[0.79750276],
[0.6902758 ],
[0.954083 ],
[0.730172 ],
[0.71406955],
[0.44618604],
[0.72842085],
[0.92110217],
[0.93639654],
[0.86580694],
[0.70400375],
[0.6476467 ],
[0.8196577 ],
[0.5253299 ],
[0.8327501 ],
[0.80341715],
[0.9093833 ],
[0.63361627],
[0.6340066 ],
[0.8933691 ],
[0.49026382],
[0.48130035],
[0.6870948 ],
[0.7231698 ],
[0.6608201 ],
[0.8792795 ],
[0.9037943 ],
[0.19178617],
[0.19349495],
[0.76263976],
[0.4837717 ],
[0.16504325],
[0.82847375],
[0.89699304],
[0.63410836],
[0.9312178 ],
[0.92189646],
[0.7314807 ],
[0.842437 ],
[0.6659083 ],
[0.64479965],
[0.7422422 ],
[0.6009008 ],
[0.1693232 ],
[0.9014964 ],
[0.88139933],
[0.6856136 ],
[0.92126733],
[0.86953294],
[0.8865903 ],
[0.57914716],
[0.71034443],
[0.87518984],
[0.6060405 ],
[0.8563715 ],
[0.91543823],
[0.5403559 ],
[0.8422194 ],
[0.8597398 ],
[0.5805166 ],
[0.51427 ],
[0.10524596],
[0.27125648],
[0.8283167 ],
[0.63159657],
[0.6830768 ],
[0.57044554],
[0.9340287 ],
[0.4748734 ],
[0.7822911 ],
[0.27818298],
[0.87620425],
[0.40491685],
[0.75358295],
[0.5564272 ],
[0.8861112 ],
[0.5899721 ],
[0.23874184],
[0.8123519 ],
[0.96174157],
[0.38889664],
[0.9318458 ],
[0.82226306],
[0.8313118 ],
[0.77551043],
[0.4429134 ],
[0.33926627],
[0.74928886],
[0.21241446],
[0.9346715 ],
[0.3574331 ],
[0.9137917 ],
[0.89193976],
[0.49039418],
[0.21016917],
[0.6839566 ],
[0.4797078 ],
[0.7943344 ],
[0.59705055],
[0.97201085],
[0.5473796 ],
[0.6517014 ],
[0.7451314 ],
[0.78550255],
[0.08319242],
[0.79393005],
[0.80676556],
[0.8021497 ],
[0.6134628 ],
[0.46032584],
[0.5797855 ],
[0.8976246 ],
[0.63814104],
[0.7481717 ],
[0.80257577],
[0.8129237 ],
[0.78882074],
[0.5718042 ],
[0.762966 ],
[0.8846777 ],
[0.72563726],
[0.93452525],
[0.754552 ],
[0.6178817 ],
[0.45350593],
[0.82794565],
[0.82661957],
[0.50532573],
[0.6128822 ],
[0.33095893],
[0.50806963],
[0.81247866],
[0.94330645],
[0.84906334],
[0.7077069 ],
[0.76407266],
[0.8763727 ],
[0.6052481 ],
[0.9145643 ],
[0.58223236],
[0.8280346 ],
[0.27832612],
[0.11806341],
[0.21988471],
[0.3599583 ],
[0.7354445 ],
[0.7892243 ],
[0.59419465],
[0.7328644 ],
[0.8380757 ],
[0.4801989 ],
[0.4264808 ],
[0.91051686],
[0.8391696 ],
[0.43559033],
[0.6720609 ],
[0.1947009 ],
[0.32932144],
[0.76831293],
[0.7527959 ],
[0.8988742 ],
[0.9729038 ],
[0.26043844],
[0.7716568 ],
[0.57317674],
[0.44516504],
[0.7145437 ],
[0.6964922 ],
[0.9069285 ],
[0.68262553],
[0.5182257 ],
[0.5971678 ],
[0.12781557],
[0.7062687 ],
[0.56908894],
[0.89197505],
[0.5170487 ],
[0.5499835 ],
[0.7758222 ],
[0.692719 ],
[0.54036903],
[0.7449601 ],
[0.62544686],
[0.3303107 ],
[0.662131 ],
[0.85619724],
[0.83233106],
[0.6239581 ],
[0.83721215],
[0.28781974],
[0.86139995],
[0.62624264],
[0.72332054],
[0.5131491 ],
[0.69079167],
[0.8024625 ],
[0.25563976],
[0.3019365 ],
[0.79715955],
[0.8264072 ],
[0.80015147],
[0.8787403 ],
[0.81115067],
[0.6899247 ],
[0.708648 ],
[0.70006746],
[0.70190644],
[0.7782457 ],
[0.46299386],
[0.3382843 ],
[0.8892328 ],
[0.75804394],
[0.56239504],
[0.29365563],
[0.8830452 ],
[0.77468354],
[0.85513973],
[0.61353314],
[0.886117 ],
[0.892597 ],
[0.7779245 ],
[0.46513566],
[0.91470504],
[0.9094112 ],
[0.29176524],
[0.18068965],
[0.6849963 ],
[0.40855667],
[0.8277174 ],
[0.36886245],
[0.45231634],
[0.44597292],
[0.75609404],
[0.86245894],
[0.15327378],
[0.3861984 ],
[0.5768829 ],
[0.44672123],
[0.54502654],
[0.77241576],
[0.15254727],
[0.9161699 ],
[0.24863592],
[0.8272391 ],
[0.70974886],
[0.7461012 ],
[0.7991931 ],
[0.7299595 ],
[0.8829719 ]], dtype=float32), '\nCorrect (Y): ', array([[0.],
[1.],
[0.],
[1.],
[0.],
[1.],
[1.],
[1.],
[0.],
[0.],
[1.],
[0.],
[0.],
[0.],
[1.],
[0.],
[1.],
[1.],
[1.],
[1.],
[1.],
[0.],
[1.],
[1.],
[0.],
[1.],
[1.],
[1.],
[1.],
[0.],
[1.],
[1.],
[1.],
[1.],
[0.],
[1.],
[1.],
[1.],
[0.],
[0.],
[1.],
[0.],
[0.],
[0.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[0.],
[0.],
[1.],
[0.],
[0.],
[0.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[0.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
[1.],
'AI' 카테고리의 다른 글
[머신러닝 - Tensorflow] Lec-13 Softmax classifier 의 cost함수 (0) | 2018.03.18 |
---|---|
[머신러닝 - Tensorflow] Lec-12 Softmax Regression (Multinomial Logistic Regression) (0) | 2018.03.18 |
[머신러닝 - Tensorflow] Lec10-Logistic Regression의 cost 함수 설명 (0) | 2018.03.16 |
[머신러닝-Tensorflow]Lec-09 Logic Classfication 가설 함수 정의 (0) | 2018.03.16 |
[머신러닝-Tensorflow]Lec-08 TensorFlow로 파일에서 데이터 파일 읽기 (0) | 2018.03.11 |
- Total
- Today
- Yesterday
- TensorFlow
- 코드엔진
- db
- Algorigm
- 백준
- Android
- MVC
- node
- 감자코딩
- 머신러닝
- 복습
- programming
- 노드
- 텐서플로우
- BFS
- Spring
- 알고리즘
- 리버싱
- 스프링
- 백준알고리즘
- 감자개발자
- 프로그래밍
- C langauge
- 개발하는 관광이
- C언어
- 안드로이드
- Controller
- 학교
- 초보자를 위한 C언어 300제
- node.js
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |