일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- SQL
- softmax
- CSAP
- c++
- DFS
- 정렬
- 큐
- Programmers
- deep learning
- 알고리즘 고득점 kit
- TensorFlow
- PIR
- join
- 모두를 위한 머신러닝
- sort
- BOJ
- Machine learning
- Neural Network
- stl
- 백준
- Linear Regression
- ML
- deque
- 한화오션
- sung kim
- 시간초과
- mysql
- Queue
- 프로그래머스
- 모두를 위한 딥러닝
- Today
- Total
목록모두를 위한 딥러닝 (4)
hello, world!
Logistic Classification은 정확도가 높은 알고리즘이다. Binary classification: 둘 중 하나를 골라 결과를 내는 것 (machine: 0 또는 1) 공부 시간(x_data)에 대한 P/F 결과(fail:0 / pass:1)(y_data)를 학습시킨 모델이다. x_data: n개의 인스턴스가 2개의 측정값으로 구성된다. y_data: n개의 인스턴스가 1개의 결과치로 구성된다. import tensorflow.compat.v1 as tf tf.disable_v2_behavior() x_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3], [6, 2]] y_data = [[0], [0], [0], [1], [1], [1]] # placehol..
cost 함수를 그려서 최저점을 확인한다. import tensorflow.compat.v1 as tf import matplotlib.pyplot as plt tf.disable_v2_behavior() X = [1, 2, 3] Y = [1, 2, 3] W = tf.placeholder(tf.float32) # Our hypothesis for linear model X * W hypothesis = X * W # cost/loss function cost = tf.reduce_mean(tf.square(hypothesis - Y)) # Launch the graph in a session sess = tf.Session() # Initializes global variables in the graph..
X가 1일 때 Y가 1, X가 2일 때 Y가 2, X가 3일 때 Y가 3인 값들을 보고 학습한 후 cost function이 최소가 되는 hypothesis의 W(weight)와 b(bias)예측해 보라는 예제이다. import tensorflow.compat.v1 as tf tf.disable_v2_behavior() ## 그래프 구현 # X and Y data x_train = [1, 2, 3] y_train = [1, 2, 3] W = tf.Variable(tf.random_normal([1]), name = 'weight') b = tf.Variable(tf.random_normal([1]), name = 'bias') # hypothesis = XW + b hypothesis = x_train ..
TensorFlow 설치 후 Jupyter Notebook을 이용한다. 본 version은 2.3.0이지만 version 1.xx를 사용하기 위해 v1을 import한다. constant 노드를 생성한 후 세션을 만들어 실행(run())한다. 각 노드가 어떤 tensor인지 정보만 출력된다. session을 만든 후 run을 통해서 graph의 노드를 실행하면 원하는 결과값이 출력된다. placeholder 노드를 사용하면 값을 미리 정해두지 않고, 프로그램이 돌아가는 시점에 정할 수 있다. 변수의 type만 정해 두고, feed_dict를 통해 parameter로 값을 넘겨 받아 graph를 실행시킨다. (array를 통해 n개의 값을 넘겨줄 수 있다.) ranks: 몇 차원 array인가? shape..