Deep-Learning 용어정리 (Pytorch 문법)
·
용어정리/Deep-Learning
Pytorch 문법에 대해서 알아보자.Pytorch 문법 정리기본 모델의 구축모든 신경망 모델의 기본 클래스이다.# nn (신경망 모듈) 을 가져온다.import torch.nn as nnclass MyModel(nn.Module): #초기화 메서드를 정의 def __init__(self): #nn.Module의 초기화 메서드를 호출한다. super(MyModel, self).__init__() #첫번재 레이어를 정의한다. #10개의 특성값을 받아서 20개의 출력 특성을 생성한다. self.layer1 = nn.Linear(10, 20) def forward(self, x): #입력 데이터 ..