当前位置:网站首页>nn. Modulelist() and nn Sequential()
nn. Modulelist() and nn Sequential()
2022-06-10 00:52:00 【msdhy】
This article is a supplement to other blogs , It is recommended to refer to other blogs at the same time
Pytorch series 1: torch.nn.Sequential() Explain _xddwz The blog of -CSDN Blog _torch.nn.sequential
nn.ModuleList() Built components have no order , and nn.Sequential() Build in order .
nn.ModuleList() One of the advantages is stay forward when , The middle tier can have multiple inputs .
nn.Sequential() Run directly from top to bottom by default . In fact, you can also change the input in the middle layer , Take... Like a dictionary key value , But obviously not for Simple direct circulation .
nn.Modulelist()
...
def __init__(self, ...):
self.op_num = 3
self._op_trans = nn.ModuleList()
self._op_trans.append(ISPMixedOp(C_out, C_out, width_mult_list=width_mult_list))
for i in range(self.op_num-1):
self._op_trans.append(ISPMixedOp(C_out, C_out, width_mult_list=width_mult_list))
def forward(self, x):
output = self._op_trans[0](x, alphas, (ratio_fusion, ratio_out))
for i in range(self.op_num-1):
output = self._op_trans[i](output, alphas, (ratio_out, ratio_out))
return output
...
nn.Sequential()
...
def __init__(self, ...):
self.op_num = 3
self._op_trans = nn.Sequential(OrderedDict([(str(i), ISPMixedOp(C_out, C_out, op_idx, stride=1, shift=shift)) for i in range(self.op_num)]))
def forward(self, x):
output = self.op_trans(x)
...边栏推荐
- gurobi解的状态及其属性获取
- 二分查找(折半查找)总结
- OSPF first experiment
- if判断是否为空时的函数选择
- rip實驗
- 浅谈Cookie 和 Session——含案例及详细注解
- Can the online security of futures account opening be guaranteed? Which futures company is good?
- University of Ulm, Germany | comparative characterization of 3D protein structure
- mpls vpn
- Blue Bridge Cup · winter vacation hundred schools' real topic league tournament (Phase V) real topic exercise of cargo placement for graduate students and university group A
猜你喜欢
试题 历届试题 子串分值和【第十一届】【省赛】【B组】

The latest version of Alibaba development manual is released in 2022!!!

wps合并单元格快捷键是什么
力扣 两数相加 C语言 题解

第6章域控制器安全

力扣 无重复字符的最长子串 C语言 题解

How to keep the contents of WPS merged cells in one cell
Analysis on the scores of previous real questions [11th] [provincial competition] [group B]

RHCSA第一天

Sword finger offer II 013 Sum of two dimensional submatrix
随机推荐
消防应急照明和疏散指示系统在某洁净医药的设计与应用
Blue Bridge Cup · winter vacation hundred schools' real topic league tournament (Phase V) real topic exercise of cargo placement for graduate students and university group A
Hcip day 1 Summary
if判斷是否為空時的函數選擇
Sword finger offer II 013 Sum of two dimensional submatrix
Sword finger offer II 015 All modifiers in the string
Pycharm 2022 permanently activated version download, valid for personal test
Sword finger offer II 016 Longest substring without duplicate characters
Weights of complete binary tree of past real questions [10th] [provincial competition] [group B]
2018年虚拟仪器竞赛作品分享-基于LabVIEW、百度地图、STM32单片机等的可重构蛇形机器人
Cloning of EBS r12.2
第5章域内横向移动分析及防御
PCI BAR寄存器详解(一)
浅谈Cookie 和 Session——含案例及详细注解
BGP summary
Sword finger offer II 021 Delete the penultimate node of the linked list
CloudCompare&PCL 主曲率、平均曲率以及高斯曲率计算
Gartner global IAAs report in 2021: AWS cake is nibbled, and Chinese cloud manufacturers are steadily attacking
shell eval用法详解 命令替换
wps合并单元格内容都保留在一个单元格怎么实现