当前位置: 首页 > 工具软件 > pytorch-book > 使用案例 >

PyTorch构造神经网络及各modules解析

毕魁
2023-12-01

零: 用torchvision.models构造常用baselines网络

import torchvision.models as models

 pytorch已定义models详看:Models and pre-trained weights — Torchvision main documentation

构造示例:

import torchvision.models as models


alexnet = models.alexnet()                         # AlexNet
vgg16 = models.vgg16()                             # VGG16
resnet18 = models.resnet18()                       # ResetNet模型
googlenet = models.googlenet()                     # googlenet
inception = models.inception_v3()                  # inception

squeezenet = models.squeezenet1_0()                # 序列网络
densenet = models.densenet161()                    # 稠密网络
shufflenet = models.shufflenet_v2_x1_0()

mobilenet_v2 = models.mobilenet_v2()
mobilenet_v3_large = models.mobilenet_v3_large()
mobilen
 类似资料: