当前位置: 首页 > news >正文

一个商城网站开发要多少时间软件工程的定义

一个商城网站开发要多少时间,软件工程的定义,1m带宽可以建设电商网站吗,东莞勒流网站制作在 PyTorch 中#xff0c;named_children、named_modules 和 named_parameters 是用于获取神经网络模型组件和参数的三种不同的方法。下面是它们各自的作用和区别#xff1a; named_parameters#xff1a;递归地列出所有参数名称和tensornamed_modules#xff1a;递归地列…在 PyTorch 中named_children、named_modules 和 named_parameters 是用于获取神经网络模型组件和参数的三种不同的方法。下面是它们各自的作用和区别 named_parameters递归地列出所有参数名称和tensornamed_modules递归地列出所有子层其中第一个返回值就是模型本身named_children列出模型的第一层级的子层不往下进行深入递归 1. named_children: named_children 返回一个生成器它包含模型中所有直接子模块的名称和模块对。它只返回一层级的子模块不递归到更深层次的子模块。这个方法通常用于迭代模型的直接子模块并对其进行操作或检查。 示例: from torchvision.models import resnet18model resnet18() # Print each layer name and its module # Note that named_children method only returns the first level submodules for name, layer in model.named_children():print(name.ljust(10), --, type(layer))输出 conv1 -- class torch.nn.modules.conv.Conv2d bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d relu -- class torch.nn.modules.activation.ReLU maxpool -- class torch.nn.modules.pooling.MaxPool2d layer1 -- class torch.nn.modules.container.Sequential layer2 -- class torch.nn.modules.container.Sequential layer3 -- class torch.nn.modules.container.Sequential layer4 -- class torch.nn.modules.container.Sequential avgpool -- class torch.nn.modules.pooling.AdaptiveAvgPool2d fc -- class torch.nn.modules.linear.Linear2. named_modules: named_modules 返回一个生成器它包含模型中所有模块的名称和模块对包括子模块的子模块。它递归地遍历整个模型返回所有模块的名称和引用。这个方法适用于当你需要对模型中的所有模块进行操作或检查时无论它们位于哪一层级。 示例: from torchvision.models import resnet18model resnet18() # The first layer is the model itself for name, layer in model.named_modules():print(name.ljust(15), --, type(layer))输出 -- class torchvision.models.resnet.ResNet conv1 -- class torch.nn.modules.conv.Conv2d bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d relu -- class torch.nn.modules.activation.ReLU maxpool -- class torch.nn.modules.pooling.MaxPool2d layer1 -- class torch.nn.modules.container.Sequential layer1.0 -- class torchvision.models.resnet.BasicBlock layer1.0.conv1 -- class torch.nn.modules.conv.Conv2d layer1.0.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer1.0.relu -- class torch.nn.modules.activation.ReLU layer1.0.conv2 -- class torch.nn.modules.conv.Conv2d layer1.0.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer1.1 -- class torchvision.models.resnet.BasicBlock layer1.1.conv1 -- class torch.nn.modules.conv.Conv2d layer1.1.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer1.1.relu -- class torch.nn.modules.activation.ReLU layer1.1.conv2 -- class torch.nn.modules.conv.Conv2d layer1.1.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer2 -- class torch.nn.modules.container.Sequential layer2.0 -- class torchvision.models.resnet.BasicBlock layer2.0.conv1 -- class torch.nn.modules.conv.Conv2d layer2.0.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer2.0.relu -- class torch.nn.modules.activation.ReLU layer2.0.conv2 -- class torch.nn.modules.conv.Conv2d layer2.0.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer2.0.downsample -- class torch.nn.modules.container.Sequential layer2.0.downsample.0 -- class torch.nn.modules.conv.Conv2d layer2.0.downsample.1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer2.1 -- class torchvision.models.resnet.BasicBlock layer2.1.conv1 -- class torch.nn.modules.conv.Conv2d layer2.1.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer2.1.relu -- class torch.nn.modules.activation.ReLU layer2.1.conv2 -- class torch.nn.modules.conv.Conv2d layer2.1.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer3 -- class torch.nn.modules.container.Sequential layer3.0 -- class torchvision.models.resnet.BasicBlock layer3.0.conv1 -- class torch.nn.modules.conv.Conv2d layer3.0.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer3.0.relu -- class torch.nn.modules.activation.ReLU layer3.0.conv2 -- class torch.nn.modules.conv.Conv2d layer3.0.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer3.0.downsample -- class torch.nn.modules.container.Sequential layer3.0.downsample.0 -- class torch.nn.modules.conv.Conv2d layer3.0.downsample.1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer3.1 -- class torchvision.models.resnet.BasicBlock layer3.1.conv1 -- class torch.nn.modules.conv.Conv2d layer3.1.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer3.1.relu -- class torch.nn.modules.activation.ReLU layer3.1.conv2 -- class torch.nn.modules.conv.Conv2d layer3.1.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer4 -- class torch.nn.modules.container.Sequential layer4.0 -- class torchvision.models.resnet.BasicBlock layer4.0.conv1 -- class torch.nn.modules.conv.Conv2d layer4.0.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer4.0.relu -- class torch.nn.modules.activation.ReLU layer4.0.conv2 -- class torch.nn.modules.conv.Conv2d layer4.0.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d layer4.0.downsample -- class torch.nn.modules.container.Sequential layer4.0.downsample.0 -- class torch.nn.modules.conv.Conv2d layer4.0.downsample.1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer4.1 -- class torchvision.models.resnet.BasicBlock layer4.1.conv1 -- class torch.nn.modules.conv.Conv2d layer4.1.bn1 -- class torch.nn.modules.batchnorm.BatchNorm2d layer4.1.relu -- class torch.nn.modules.activation.ReLU layer4.1.conv2 -- class torch.nn.modules.conv.Conv2d layer4.1.bn2 -- class torch.nn.modules.batchnorm.BatchNorm2d avgpool -- class torch.nn.modules.pooling.AdaptiveAvgPool2d fc -- class torch.nn.modules.linear.Linear3. named_parameters: named_parameters 返回一个生成器它包含模型中所有参数的名称和参数值对。它递归地遍历模型返回所有可训练参数的名称和参数张量。这个方法用于获取和检查模型中的参数例如在打印模型参数、保存模型或加载模型时使用。 示例: from torchvision.models import resnet18model resnet18() for name, param in model.named_parameconv1.weight -- torch.Size([64, 3, 7, 7]) bn1.weight -- torch.Size([64]) bn1.bias -- torch.Size([64]) layer1.0.conv1.weight -- torch.Size([64, 64, 3, 3]) layer1.0.bn1.weight -- torch.Size([64]) layer1.0.bn1.bias -- torch.Size([64]) layer1.0.conv2.weight -- torch.Size([64, 64, 3, 3]) layer1.0.bn2.weight -- torch.Size([64]) layer1.0.bn2.bias -- torch.Size([64]) layer1.1.conv1.weight -- torch.Size([64, 64, 3, 3]) layer1.1.bn1.weight -- torch.Size([64]) layer1.1.bn1.bias -- torch.Size([64]) layer1.1.conv2.weight -- torch.Size([64, 64, 3, 3]) layer1.1.bn2.weight -- torch.Size([64]) layer1.1.bn2.bias -- torch.Size([64]) layer2.0.conv1.weight -- torch.Size([128, 64, 3, 3]) layer2.0.bn1.weight -- torch.Size([128]) layer2.0.bn1.bias -- torch.Size([128]) layer2.0.conv2.weight -- torch.Size([128, 128, 3, 3]) layer2.0.bn2.weight -- torch.Size([128]) layer2.0.bn2.bias -- torch.Size([128]) layer2.0.downsample.0.weight -- torch.Size([128, 64, 1, 1]) layer2.0.downsample.1.weight -- torch.Size([128]) layer2.0.downsample.1.bias -- torch.Size([128]) layer2.1.conv1.weight -- torch.Size([128, 128, 3, 3]) layer2.1.bn1.weight -- torch.Size([128]) layer2.1.bn1.bias -- torch.Size([128]) layer2.1.conv2.weight -- torch.Size([128, 128, 3, 3]) layer2.1.bn2.weight -- torch.Size([128]) layer2.1.bn2.bias -- torch.Size([128]) layer3.0.conv1.weight -- torch.Size([256, 128, 3, 3]) layer3.0.bn1.weight -- torch.Size([256]) layer3.0.bn1.bias -- torch.Size([256]) layer3.0.conv2.weight -- torch.Size([256, 256, 3, 3]) layer3.0.bn2.weight -- torch.Size([256]) layer3.0.bn2.bias -- torch.Size([256]) layer3.0.downsample.0.weight -- torch.Size([256, 128, 1, 1]) layer3.0.downsample.1.weight -- torch.Size([256]) layer3.0.downsample.1.bias -- torch.Size([256]) layer3.1.conv1.weight -- torch.Size([256, 256, 3, 3]) layer3.1.bn1.weight -- torch.Size([256]) layer3.1.bn1.bias -- torch.Size([256]) layer3.1.conv2.weight -- torch.Size([256, 256, 3, 3]) layer3.1.bn2.weight -- torch.Size([256]) layer3.1.bn2.bias -- torch.Size([256]) layer4.0.conv1.weight -- torch.Size([512, 256, 3, 3]) layer4.0.bn1.weight -- torch.Size([512]) layer4.0.bn1.bias -- torch.Size([512]) layer4.0.conv2.weight -- torch.Size([512, 512, 3, 3]) layer4.0.bn2.weight -- torch.Size([512]) layer4.0.bn2.bias -- torch.Size([512]) layer4.0.downsample.0.weight -- torch.Size([512, 256, 1, 1]) layer4.0.downsample.1.weight -- torch.Size([512]) layer4.0.downsample.1.bias -- torch.Size([512]) layer4.1.conv1.weight -- torch.Size([512, 512, 3, 3]) layer4.1.bn1.weight -- torch.Size([512]) layer4.1.bn1.bias -- torch.Size([512]) layer4.1.conv2.weight -- torch.Size([512, 512, 3, 3]) layer4.1.bn2.weight -- torch.Size([512]) layer4.1.bn2.bias -- torch.Size([512]) fc.weight -- torch.Size([1000, 512]) fc.bias -- torch.Size([1000])总结来说named_children 用于获取模型的直接子模块named_modules 用于获取模型的所有模块包括嵌套的子模块而 named_parameters 用于获取模型中的所有参数。这些方法在模型调试、分析和优化时非常有用。
http://www.hkea.cn/news/14399604/

相关文章:

  • 贵州省住房和城乡建设部网站首页wordpress禁止留言网址
  • 查询网站空间商中国核工业第五建设有限公司怎么样
  • php建设网站后台有域名怎么建立网站
  • 外包网络推广公司推广网站免费的行情软件下载安装
  • 网站的涂鸦效果图怎么做的wordpress研究院
  • 学院招生网站建设方案外贸网站交易平台
  • 江苏省城乡建设厅网站无锡网站建设价格
  • 做衣服的网站推荐建设银行网银官方网站
  • 个人网站怎么备案做外包网站
  • 网站前台可以打开wordpress 本地视频插件安装
  • 耒阳网站建设包装设计网站设计平台
  • 张家口网站设计无锡朝阳网站建设
  • 网店模板素材seo关键词分析表
  • 百宝图建设工程电子网站小松建设官方网站
  • 判断网站cms如何做各大网站广告链接
  • 徐州网站开发市场网页开发者模式怎么打开
  • 什么网站可以做电影投资网络推广渠道公司
  • 网站建设公司怎么开拓业务ui特效网站
  • 网站外包公司该如何运营建设工程网站新专家入库
  • 如果做微商需不需要开个网站钉钉免登 wordpress
  • 青岛网站搭建公司创建自己网站
  • 校园网站建设硬件采购做网站的公司一年能赚多少钱
  • 如何部署thinkphp网站网站开发建设计入什么科目
  • 宁波专业品牌网站制作外包整站wordpress下载
  • 苏州企业网站建公司网站怎么建
  • 网站的分类有哪些类型网站制作 东莞
  • 菏泽建设公司网站网站安全建设策划书
  • 柳城网站制作红色系网站设计
  • 德州专业网站开发公司wordpress首页设计
  • 班级网站源码中国建设工程信息网清欠