[부스트캠프 AI-Tech] 6주차 Day 2

LKM·2022년 3월 6일
0

4. Data Generation

  • Data Feeding
    • Feed? → 대상의 상태를 고려해서 적정한 양을 준다.

  • torch.utils.data
    • Dataset
      • 기본 구조

        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
    • DataLoader



5. Model (1)

  • Model

    • 시스템의 informative representation
  • 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)



6. Model (2)

  • Pre-trained Model

    • 모델 일반화를 위해 매번 수 많은 이미지를 학습시키는 것은 까다롭고 비효율적
    • 미리 학습된 좋은 성능이 검증되어 있는 모델을 사용하면 시간적으로 매우 효율적
  • Transfer Learnging

    • CNN base 모델

    • Pretraining 할 때 설정했던 문제와 현재 문제와의 유사성을 고려

    • 데이터가 충분할 경우

    • 데이터가 부족할 경우...

profile
함께 자라기

0개의 댓글