pytorch_resnet18_unet.ipynb学习笔记
0.Unet图像分割
1. Python,axis=0与axis=1区分
2. Python函数中的*和**的作用
3.Python 中reduce()与lambda函数详解
from functools import reduce
def plot_side_by_side(img_arrays):
flatten_list = reduce(lambda x,y: x+y, zip(*img_arrays))
plot_img_array(np.array(flatten_list), ncol=len(img_arrays))
4.iter函数和next函数
iter函数和next函数 | Python笔记https://www.pynote.net/archives/1258Python中next()函数、iter()以及next(iter())函数的用法详解_Yale-曼陀罗-CSDN博客_next(iter(train_loader))描述:next() 返回迭代器的下一个项目。next() 函数要和生成迭代器的iter() 函数一起使用。 语法:next 语法:next(iterable[, default]) 参数说明:iterable – 可迭代对象default – 可选,用于设置在没有下一个元素时返回该默认值,如果不设置,又没有下一个元素则会触发 StopIteration 异常。 备注:list、tuple等都是可迭代对象,我们可以通过iter()函数获取这些可迭代对象的迭代器。然后,我们可以对获.https://blog.csdn.net/weixin_42782150/article/details/109315355
5.base_model.children()
6.模型可视化工具summary
7.nn.ReLU(inplace=True)中inplace的作用
8. nn.Sequential(*self.base_layers[:3])
【python】*号用法 如nn.Sequential(*layers)_小西几y的博客-CSDN博客_python sequential形参——单个星号代表这个位置接收任意多个非关键字参数,转化成元组方式。实参——如果*号加在了是实参上,代表的是将输入迭代器拆成一个个元素。从nn.Sequential的定义来看,输入要么是orderdict,要么是一系列的模型,遇到list,必须用*号进行转化,否则会报错 TypeError: list is not a Module subclass# Example of using ...https://blog.csdn.net/qq_41748260/article/details/104346179pytorch中的nn.Sequential(*net[3: 5])是啥意思_alittlebai1的博客-CSDN博客看到代码里面有这个1 class ResNeXt101(nn.Module): 2 def __init__(self): 3 super(ResNeXt101, self).__init__() 4 net = resnext101() # print(os.getcwd(), net) 5 net = list(net.children()) # net.children()得到resneXt 的表层网络 #https://blog.csdn.net/alittlebai1/article/details/116105471
9.Pytorch 中的 dim
10.python中copy()和deepcopy()
11.optimizer.step()和scheduler.step()的区别