tensorflow tutorial - isl-homepage.github.io€¦ · 4 tensorflow dev summit - 17.02.16...

Post on 29-May-2020

8 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

TensorFlow Tutorial전현호

2019-04-10 1

2

3

What is TensorFlow?

텐서플로우( TensorFlow ) : 구글에서개발한기계학습및딥러닝용오픈소스라이브러리

왜텐서플로우를사용해야하는가?

구현이쉬움 ( 연산, 신경망구조 )

여러 CPU 및 GPU에서동작이가능함 데이터및구조를시각적으로확인할수있음 ( TensorBoard )

기타등등 ( 뒤에서설명 )

다차원배열

4

TensorFlow Dev Summit - 17.02.16

텐서플로우 1.0 공식버전릴리즈

빨라짐 : 8GPUs + inception v3 모델을사용할경우 7.3배속도향상64GPUs + Inception v3 모델을사용할경우 58배속도향상

유연해짐 : 더고급수준의 API 추가및딥러닝라이브러리중하나인 Keras와완벽한호환성을제공하는새로운 tf.keras 모듈이추가됨

기타등등

Python tf_upgrade.py --infile InputFile --outfile OutputFile

pip install tensorflow로대부분환경에서바로업데이트가능

5

Install TensorFlow

1. Anaconda3 4.2.0 버전설치 (Python 3.5)

anaconda

6

Install TensorFlow

1. Anaconda3 4.2.0 버전설치 (Python 3.5)

7

Install TensorFlow

1. Anaconda3 4.2.0 버전설치 (Python 3.5)

8

Install TensorFlow

1. Anaconda3 4.2.0 버전설치 (Python 3.5)

9

Install TensorFlow

2. TensorFlow 설치 – CPU 버전

- cmd창에 pip install tensorflow 입력

10

Install TensorFlow

3. 설치확인

- Python을실행시킨후 import tensorflow를통해에러가나는지확인

11

Install TensorFlow

GPU 버전설치과정

1. CUDA 8.0 버전설치 (https://developer.nvidia.com/cuda-downloads )

12

Install TensorFlow

2. cuDNN 5.1 버전설치 ( https://developer.nvidia.com/cudnn )

간단한등록과정을요구함

13

Install TensorFlow

3. cuDNN 파일의압축풀기

4. 결과로나오는 bin, include, lib 폴더를 CUDA가설치된경로로접근하여붙여넣기

14

Install TensorFlow

5. Tensorflow 설치 - GPU 버전

- cmd창에 pip install tensorflow-gpu 입력

- CPU버전과마찬가지로설치가잘되었는지확인

15

Install TensorFlow

6. quit()을통해 python 종료

16

Install TensorFlow

MNIST 예제를학습시켜동작확인 ( 3 hidden layer )

17

Data type

cmd - jupyter notebook

※주의 : 경로상에관련파일이있지않을경우 404 에러발생

18

Data type

jupyter notebook - h

19

Data type

※ https://www.tensorflow.org/versions/r0.12/api_docs/python/

20

Data type- Code

21

Data type

그래프생성

22

Data type

그래프생성

23

Data type

그래프생성

24

Data type

그래프생성

25

Data type

그래프생성

26

Data type

그래프생성

27

Data type

그래프생성

28

Data type

그래프생성

29

Data type

그래프생성

30

Data type

그래프생성

31

Data type

그래프생성

32

Data type

그래프생성

33

Data type

그래프생성

34

Data type

그래프생성

35

Data type

그래프생성

36

Data type

그래프생성

37

Data type

그래프생성

38

Data type

그래프생성

39

Data type

그래프생성

40

Data type

그래프생성

41

Data type

그래프생성

42

Data type

세션

Python이 C기반이기때문에상호간의호환성이좋음

Python에서생성된모델은디바이스에서실제구조가만들어짐. 이과정을 ‘세션에보낸다.’

또는 ‘세션에올린다.’ 고표현함.

하드웨어단계에서구현되었기때문에매우빠른연산이가능해짐 -> TF의장점

43

Data type

테스트 - constant

44

Data type

테스트 - constant

45

Data type

테스트 - Variable

46

Data type

테스트 - Variable

Variable은별도의초기화가필요함!

47

Data type

테스트 - Variable

48

Data type

테스트 - placeholder

49

Linear regression + Plot

50

Linear regression + Plot

51

Linear regression + Plot

52

MNIST

MNIST

When one learns how to program, there's a tradition that the first thing you do is print "Hello World."

Just like programming has Hello World, machine learning has MNIST.

53

MNIST

MNIST

When one learns how to program, there's a tradition that the first thing you do is print "Hello World."

Just like programming has Hello World, machine learning has MNIST.

54

MLP

Input layer - 3 hidden layer – output layer

55

MLP

Input layer - 3 hidden layer – output layer

56

MLP

Input layer - 3 hidden layer – output layer

57

MLP

Failure

58

MLP

Failure

59

CNN ( ConvNet )

버그

CPU버전삭제로해결

60

CNN ( ConvNet )

61

Q&A

62

example

63

Before any opt

64

After 1 opt iter

65

After 10 opt iter

66

After 1000 opt iter

67

After 1000 opt iter

top related