PyTorch Lecture 01: Overview

조병근·2020년 9월 11일

PyTorch Lecture

목록 보기
1/4

Sung Kim 교수님의 ML / DL for Everyone with PYTORCH 강의 필기내용입니다.

What is Human Intelligence?

사람이 생각하고 결정하는 방식에 대해 먼저 알아보자.

What to eat for lunch?

  • 내가 뭘 싫어하고, 뭘 좋아하는지에 대한 정보 참고 ➜ 뭐 먹을지 결정

What is this picture?

  • Image information을 보고 CAT일 거라고 예측.

What would be the grade if I study 4 hours?

  • 4시간을 공부했을 때 어떤 성적을 받은 경험을 바탕으로 하거나, 식을 이용해서 예측.

What is ML?

사람이 생각하는 방식과 같다 !

기계들은 멍청하기 때문에 Image를 줘도 이게 뭔지, 예측해야 하는 값인 CAT이 뭔지도 모른다. 그래서 기계들을 가르쳐줘야 한다. 이 과정을 Training이라 한다.

❗ Machine needs lots of training

Training을 할 때 Image와 true label을 함께 제공한다( Labled dataset ).

Training dataset을 이용해 학습한 후, Test dataset을 던졌을 때 올바른 prediction을 하게끔 만드는 게 목표다.

Deep Learning?

Intelligence를 가지게 하기 위한 방법 중 하나가 Machine Learning이다.

Machine Learning 안에는 많은 알고리즘이 있는데, 그 중 neural nets 을 사용하는 알고리즘 그룹을 Deep Learning이라 한다.

Install PyTorch

🚀 https://pytorch.org/get-started/locally/

OS, Package, Programming Language를 선택하면 밑에 커맨드가 나오는데 그걸로 설치하면 된다.

Windows, pip, Python의 경우:

$ pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

😥 Error

Could not find a version that satisfies the requirement torch==1.6.0+cpu (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)

Python이 32bit인지 확인하고, 64비트로 바꾸고 하면 된다.

Verification

from __future__ import print_function
import torch
x = torch.rand(5, 3)
print(x)

# output like
tensor([[0.3380, 0.3845, 0.3217],
        [0.8337, 0.9050, 0.2650],
        [0.2979, 0.7141, 0.9069],
        [0.1449, 0.1132, 0.1375],
        [0.4675, 0.3947, 0.1426]])

설치 끝 😊

profile
I'm always chobo

0개의 댓글