1.创新点方面
消融实验,缝合模块
缝合模块:加模块到模型文件中,确保通道数相同,初始化(__init__),前向传播(forward)
步骤:(1)class__ 模块 (2)实例化--初始化中 (3)前向传播
缝合模块的常见方式:(1)串行 (2)并行 (3)交互 (4)多尺度融合 (5)各种连接
2.下载模型(代码)可在 github,huggingface,paperswithcode 上获取。
3.搭建网络模型(官网上的模型--pytorch官网)--从整体到局部,数据的流动形状,搞清楚模型的输入和输出。
(1)定义类class
(2)定义初始化函数(def __init__),初始化模型
(3)定义前向传播函数(def forward)
4.使用GPU训练模型
方式一
(1)网络模型 .cuda()
(2)数据(输入,标注) .cuda()
(3)损失函数 .cuda()
方式二 .to(device)
device=torch.device(“cpu”)
device=torch.device(“cuda”)&device=torch.device(“cuda:0”)
.to(device)