Feed? → 대상의 상태를 고려해서 적정한 양을 준다.
기본 구조
from torch.utils.data import Dataset
class MyDataset(Dataset):
def __init__(self): # 초기화
pass
def __getitem__(self, index): # index 위치의 데이터
return None
def __len__(self): # 데이터 전체 길이
return None
내가 만든 Dataset을 효율적으로 사용할 수 있도록 기능 추가
ref. https://pytorch.org/docs/stable/data.html#data-loading-order-and-sampler
Model
Model with Pytorch
low-level, pythonic, flexibility
nn.Module (기본 클래스)
import torch.nn as nn
import torch.nn.functional as F
class MyModel(nn.Module):
def __init__(self):
super(MyModel, self).__init__()
self.conv1 = nn.Conv2d(1, 20, 5)
self.conv2 = nn.Conv2d(20, 20, 5)
def foward(self, x): # 모델이 호출 되었을 때 실행되는 함수
x = F.relu(self.conv1(x))
return F.relu(self.conv2(x))
Parameters (계산에 쓰일 Parameter)
Pre-trained Model
Transfer Learnging
CNN base 모델
Pretraining 할 때 설정했던 문제와 현재 문제와의 유사성을 고려
데이터가 충분할 경우
데이터가 부족할 경우...