본문 바로가기

딥러닝5

[ML] 03. 딥러닝 주요 모델 Deep Learning main Model Deep Learning이란? Neural Network : 입력, 은닉, 출력층으로 구성된 모형으로서 각 층을 연결하는 노드의 가중치를 업데이트하면서 학습 Overfitting이 심하게 일어나고 학습시간이 오래 걸림 But, 다양한 layer을 통해 복잡한 데이터의 학습이 가능하도록 한다.(graphical representation learning) 알고리즘 및 GPU 발전이 deep learning의 부흥을 이끌었다. 다양한 형태로 발전(CNN, RNN, AutoEncoder등) 다양한 분야로 발전(Object detection, Image Resolution, Style transfer, colorization등) 네트워크의 구조의 발전(ResNET, .. 2020. 3. 16.
딥러닝: 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.
딥러닝 : 01. Tensorflow의 정의 1. Tensorflow 란?¶ tensorflow는 google에서 만든 딥러닝 프로그램을 쉽게 구현할 수 있는 라이브러리이다. 기본적인 언어를 지원하지만 python을 최우선으로 한다. 대부분의 편리한 기능들이 python library로만 구현되어 있다. tenor란 딥러닝에서 데이터를 표현하는 방식을 뜻하고 flow는 흐름을 뜻한다. tensor의 이해가 매우 중요하다. tensorflow의 연산은 dataflow graph로 이루어진다. 즉 텐서 형태의 데이터들이 딥러닝 모델을 구성하는 연산들의 그래프를 따라 흐르면서 연산한다고 보면 되겠다. tensorflow는 가장 인기있는 딥러닝 라이브러리이고 딥러닝을 사용하는데 더욱 편리하게 해준다. In [1]: import tensorflow as t.. 2019. 7. 26.