※ 김성훈 교수님의 [모두를 위한 딥러닝] 강의 정리
- 참고자료 : Andrew Ng's ML class
1) https://class.coursera.org/ml-003/lecture
Coursera
class.coursera.org
2) http://holehouse.org/mlclass/ (note)
Machine Learning - complete course notes
Stanford Machine Learning The following notes represent a complete, stand alone interpretation of Stanford's machine learning course presented by Professor Andrew Ng and originally posted on the ml-class.org website during the fall 2011 semester. The topic
holehouse.org
1. Tensorflow
- '데이터 플로우 그래프(data flow graphs)'를 이용한 '수치 계산(numerical computation)'을 위한 오픈소스 라이브러리
2. Tensorflow 설치 : pip install --upgrade tensorflow
3. Tensorflow 버전확인 : tensorflow.__version__
4. Deep Learning 관련 소스코드
- https://github.com/hunkim/DeepLearningZeroToAll/ (2017년경 다수 commit, 최근에는 활동이 적음)
Build software better, together
GitHub is where people build software. More than 40 million people use GitHub to discover, fork, and contribute to over 100 million projects.
github.com
5. Hello, Tensorflow
- Input :
# Create a constant op
# This op is added as a node to the default graph // "Hello, TensorFlow!"라는 노드 생성
hello = tf.constant("Hello, TensorFlow!")
# start a TF session // 다른 프로그래밍 언어와 달리, 명령어 실행을 하려면 Session 생성이 필요
sess = tf.Session()
# run the op and get result
print(sess.run(hello))
- Output :
Hello, TensorFlow!
6. 계산 그래프
- Input :
# 노드 1, 2, 3 생성
node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0) // tf.float32 생략
node3 = tf.add(node1, node2)
# 계산결과 출력
sess = tf.Session()
print("sess.run(node1, node2): ", sess.run([node1, node2]))
print("sess.run(node3): ", sess.run(node3))
- Output :
7. TensorFlow 메커니즘
(1) 그래프 생성
(2) 세션 실행 : 데이터 입력 및 그래프 실행
(3) 그래프 업데이트 및 결과값 반환
※ 그림출처 : mathwarehouse.com
8. Placeholder // 처음에는 값이 없지만 입력 값을 받을 수 있는 노드
- Input :
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
adder_node = a + b
print(sess.run(adder_node, feed_dict={a: 3, b: 4.5}))
print(sess.run(adder_node, feed_dict={a: [1,3], b: [2, 4]}))
- Output :
'Deep Learning' 카테고리의 다른 글
[머신러닝/딥러닝] 파일에서 Tensorflow로 데이터 읽어오기 (0) | 2019.12.02 |
---|---|
[머신러닝/딥러닝] multi-variable linear regression을 Tensorflow 구현 (0) | 2019.11.29 |
[머신러닝/딥러닝] Linear Regression의 cost 최소화의 Tensorflow 구현 (0) | 2019.11.21 |
[머신러닝/딥러닝] TensorFlow로 간단한 linear regression 구현 (0) | 2019.11.21 |
딥러닝(Deep Learning) 공부방법(VoyagerX 남세동 대표) (2) | 2019.11.19 |