模型搭建流程
模型搭建流程
加载数据。train_loader = torch.utils.data.Dataloader()
构建模型。model = torch.nn.module
构建损失。loss = torch.nn.CrossEntropyLoss()
构建优化器。optimizer = torch.optim.Adam()
设置学习率更新策略。scheduler = torch.optim.lr_scheduler.MultiStepLR()
FP16
模型搭建流程
加载数据。train_loader = torch.utils.data.Dataloader()
构建模型。model = torch.nn.module
构建损失。loss = torch.nn.CrossEntropyLoss()
构建优化器。optimizer = torch.optim.Adam()
设置学习率更新策略。scheduler = torch.optim.lr_scheduler.MultiStepLR()
FP16