Pytorch实践—-06.Logistic Regression逻辑斯蒂回归
学习
刘二大人《PyTorch深度学习实践》 B站地址:B站视频 逻辑斯蒂回归虽然叫和回归,但其实是为了解决分类问题
import torch
import torch.nn as nn
import torch.nn.functional as F
x_data = torch.Tensor([[1.0], [2.0], [3.0]])
y_data = torch.Tensor([[0], [0], [1]])
class LogistRegressionModel(nn.Module):
def __init__(self):
super(LogistRegressionModel, self).__init__()
self.linear = nn.Linear(1, 1)
def forward(self, x):
y_pred
共有 0 条评论