PyTorch로 이진 분류기 만들기
단일 선형 계층 뒤에 시그모이드 함수를 두는 작은 신경망은 이진 분류기라는 점을 떠올려 보세요. 로지스틱 회귀와 동일하게 동작합니다.
이 작은 네트워크를 직접 만들어 보고, 분류기의 출력을 해석하는 연습을 해봅시다.
이 연습은 강의의 일부입니다
PyTorch로 배우는 딥러닝 입문
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
import torch
import torch.nn as nn
input_tensor = torch.Tensor([[3, 4, 6, 2, 3, 6, 8, 9]])
# Implement a small neural network for binary classification
model = nn.Sequential(
nn.____(____),
nn.____()
)
output = model(input_tensor)
print(output)