摘要: import torch import torch.nn as nn import torch.optim as optim '''定义模拟数据集''' inputs = torch.randn(5, 10) # 定义5个样本,每个样本的特征数位10 labels = torch.tensor([0 阅读全文
posted @ 2024-06-07 17:29 映辉 阅读(19) 评论(0) 推荐(0) 编辑
摘要: import torch import torch.nn as nn import torch.optim as optim '''定义模型''' class SimpleModel(nn.Module): ''' 方便理解,这里只定义了一层网络 input_size: 输入维度(这里表示每个样本的 阅读全文
posted @ 2024-06-07 16:45 映辉 阅读(60) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示