[PyTorch] Logistic Regression & Softmax
[Logistic] 활성화 함수 : sigmoid loss function : binary cross entropy import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim torch.manual_seed(1) class BinaryClassifier(nn.Module): def __init__(self): super().__init__() self.linear = nn.Linear(2,1) self.sigmoid = nn.Sigmoid() def forward(self,x): return self.sigmoid(self.linear(x)) x_data = [[1,2],[2,3],[3,1],[..