Dev23 03. TensorFlow Linear Regression 의 cost 최소화 구현 03. Minimizing Cost Function in Linear Regression 출처 : 모두를위한 머신러닝 (http://hunkim.github.io/ml/) 이론 간소화 한 Hypothesis¶ W, cost(W) 스캔 해보기¶ In [9]: import tensorflow as tf import matplotlib.pyplot as plt X = [1, 2, 3] Y = [1, 2, 3] # W 는 계속 바뀌므로 place holder 로 W = tf.placeholder(tf.float32) hypothesis = X * W # H(x) = Wx cost = tf.reduce_mean(tf.square(hypothesis - Y)) # cost function sess = tf.Sess.. 2018. 8. 17. 02. Tensor Flow로 linear regression 예제 02. Linear Regression 의 개념 출처 : 모두를위한 머신러닝 (http://hunkim.github.io/ml/)이론 예제Hypothesis and cost function¶ 학슴을 통해 cost function 을 최소화 하는 W, b 를 찾아야 함. Build graph¶ In [1]: import tensorflow as tf x_train = [1, 2, 3] y_train = [1, 2, 3] # Variable : Tensorflow 가 사용하는 변수 # Training 과정중에서 변함 W = tf.Variable(tf.random_normal([1]), name='weight') # rank 가 1인 random 값 b = tf.Variable(tf.random_normal(.. 2018. 8. 16. 01. Tensor Flow 의 기본적인 operations 01. 머신러닝의 개념과 용어 출처: 모두를위한 머신러닝 (http://hunkim.github.io/ml/) TensorFlow : Data Flow Graph¶ Node 와 Node가 연결되어 있는 구조 Nodes : Mathematiclal operations (어떤 값을 받아서 더한다, 곱한다 등..) Edges : Data arrays (Tensors !) Tensor 만드는 방법¶ tf.constant(넣을 값) tf.placeholder(tf.데이터 타입) : run 단계에서 값 설정 In [10]: import tensorflow as tf hello = tf.constant("Hello") node1 = tf.constant(3.0, tf.float32) node2 = tf.constan.. 2018. 8. 16. Anaconda 설치 및 사용법 (윈도우, 리눅스, Interpreter) 순서 1. 아나콘다란2. 설치방법3. 기본사용법4. Interpreter 등록 1. 아나콘다란 파이썬 사용자들이 쉽게 개발환경을 구축할수 있도록 도와주는 모듈이다. 두가지 장점이 있다.- pip 으로 라이브러리 설치 시 문제가 거의 발생하지 않음- 가상환경을 만들어 사용하기 때문에 여러버전의 파이썬끼리 충돌이 일어나지 않음가상환경이란 쉽게말하면 가상환경을 만들때 마다 완전히 독립된 새로운 파이썬이 설치된다고 보면 된다. 2. 설치방법 공식홈페이지에 가서 본인 OS에 맞는 파일을 다운받아 설치한다.https://www.anaconda.com/download/파이썬 버전을 고르게 되어있는데, 아무거나 받는다. (왜냐하면 가상환경을 만들때 파이썬 버전도 지정할 수 있기 때문) 설치파일을 실행하면 설치가 완료된.. 2018. 8. 16. 이전 1 2 3 4 5 6 다음