Notice
Recent Posts
Recent Comments
Link
반응형
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 판교퇴근길밋업
- ai개발밋업
- AIStages
- 우분투리눅스
- 쉽게배우는운영체제
- 자바
- GitHub
- BPTT
- Swing
- 리눅스7장
- 정보처리기사
- MAC OS
- 운영체제연습문제
- repository 복구
- 리눅스연습문제
- 부스트캠프 AI Tech
- Django
- 딥러닝
- backpropagation
- ann
- Python
- java
- CNN
- 2020정보처리기사
- 파이썬
- RNN
- 운영체제
- Git
- homebrew설치
- github branch
Archives
- Today
- Total
코딩하는 애옹😸
[PyTorch] Basics 본문
728x90
반응형
PyTorch
- 딥러닝 프레임워크
- Numpy 구조를 가지는 Tensor 객체로 array 표현
- 자동 미분(AutoGrad) 지원 $\rightarrow$ DL 연산 지원
장점
- Define by Run : 즉시 확인 가능 $\rightarrow$ pythonic code
- GPU 지원, Good API and community
Basics
- numpy의 ndarray와 pytorch의 tensor가 유사
## numpy
import numpy as np
n_array = np.arange(10).reshape(2, 5)
print(n_array)
print("ndim: ", n_array.ndim, "shape: ", n_array.shape)
## pytorch
import torch
t_array = torch.FloatTensor(n_array)
print(t_array)
print("ndim: ", t_array.ndim, "shape: ", t_array.shape)
기본적으로 numpy의 대부분의 사용법이 그대로 적용
- Slicing, flatten, ones_like, shape, dtype 등
device
: GPU에 올릴 것이냐, CPU에 올릴 것이냐를 확인
view
: reshape과 동일하게 tensor의 shape 변환, copy할 때 메모리 주소 그대로 copy
mm
: 행렬곱셈 연산(내적)
matmul
: broadcasting 지원
반응형
'부스트캠프 AI Tech 3기 > Study' 카테고리의 다른 글
[PyTorch] 모델 불러오기 (0) | 2022.01.26 |
---|---|
[PyTorch] AutoGrad (0) | 2022.01.25 |
[예제] BackPropagation (0) | 2022.01.23 |
(AI Math 10강) RNN (0) | 2022.01.21 |
(AI Math 9강) CNN (0) | 2022.01.21 |
Comments