1,代码如下 import imp from statistics import mode import torch.nn.functional as F import torch # 1, Prepare data x_data = torch.Tensor([[1.0],[2.0],[3.0]]) y_data = torch.Tensor([[0],[0],[1]]) # 2, Design model class LogisticRegressionModel(torch.nn.Module): def __init__(self) -> None: # 初始化函...