[PyTorch] 1강 Introduction to PyTorch

지구인 ㅣ 2022. 1. 24. 19:12

728x90

1. PyTorch & Tensorflow

 

1. 딥러닝 프레임워크

굉장히 종류가 많으나 현재 가장 많이 쓰이는 건 파이토치(PyTorch-facebook에서 만듦), 텐서플로우(Tensorflow-Google에서 만듦)

 

2. PyTorch Dynamic Computation Gragh VS. TensorFlow Define and run

* Computational Gragh : 연산의 과정을 그래프로 표현

 

- PyTorch : 자동미분(autograd) 시 실행 시점에서 그래프 정의

-> Dynamic Computational Gragh(DCG) : 실행을 하면서 그래프를 생성하는 방식

-> 왠지 더 느릴 것 같지만 그렇지 않음.

 

- Tensorflow : 정의 먼저하고나서 실행 -> (computational gragh를 미리 그린 후) 실행시점에 데이터 대입

 

3. PyTorch Dynamic Graghs VS. Tensorflow Static Graghs

 

- TensorFlow : 그래프 설계 + 각 학습 반복 실행

- PyTorch : 반복 실행마다 새 그래프 정의됨

=> PyTorch의 장점 : 1. 디버깅 쉬움 2. 코드 짧음

 

4. 각 장점 종합

PyTorch : 사용하기 편리

- Define and run : 즉시 확인 가능 -> pythonic한 코드

- GPU 지원, API, Community 발달

- 디버깅 쉬움 -> 논문, 내 아이디어 구현 쉬움

 

Tensorflow : Production과 Scalability의 장점

- Production

- Cloud

- Multi GPU

 

2. PyTorch

 

- numpy 구조를 가지는 Tensor 객체 (array). 넘파이 잘 다루면 파이토치 쉬울 것

- 자동미분, DL 연산 지원

- dataset, multi GPU, data augmentation 등 지원

- 복잡한 것을 간단하게!

 

 

728x90