摘要:
import torch import torch.nn as nn import torch.optim as optim '''定义模拟数据集''' inputs = torch.randn(5, 10) # 定义5个样本,每个样本的特征数位10 labels = torch.tensor([0 阅读全文
摘要:
import torch import torch.nn as nn import torch.optim as optim '''定义模型''' class SimpleModel(nn.Module): ''' 方便理解,这里只定义了一层网络 input_size: 输入维度(这里表示每个样本的 阅读全文