Skip to content

Commit 9c86be7

Browse files
authored
Merge pull request L1aoXingyu#24 from jaeyung1001/patch-2
2 parents ef9af81 + 67de326 commit 9c86be7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

02-Logistic Regression/Logistic_Regression.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
test_loader = DataLoader(test_dataset, batch_size=batch_size, shuffle=False)
3030

3131
# 定义 Logistic Regression 模型
32-
class logsticRegression(nn.Module):
32+
class Logistic_Regression(nn.Module):
3333
def __init__(self, in_dim, n_class):
34-
super(logsticRegression, self).__init__()
35-
self.logstic = nn.Linear(in_dim, n_class)
34+
super(Logistic_Regression, self).__init__()
35+
self.logistic = nn.Linear(in_dim, n_class)
3636

3737
def forward(self, x):
38-
out = self.logstic(x)
38+
out = self.logistic(x)
3939
return out
4040

41-
model = logsticRegression(28 * 28, 10) # 图片大小是28x28
41+
42+
model = Logistic_Regression(28 * 28, 10) # 图片大小是28x28
4243
use_gpu = torch.cuda.is_available() # 判断是否有GPU加速
4344
if use_gpu:
4445
model = model.cuda()

0 commit comments

Comments
 (0)