- 博客(3)
- 收藏
- 关注
原创 关于特征的输入问题
nn.Linear(in_features,out_features)对于输入的是二维的张量来说(一般为(batch size,size)),in_features表示输入的张量的列,out_features表示经过全连接层输出的张量的列,经过全连接层后输出的张量的行不变。...
2021-04-29 11:48:16 272
原创 repeat() 用于在某一个维度上重复张量 pytorch
x.repeat(a,b) :将张量x在列的方向上重复b次,在行的方向上重复a次。x.repeat(a,b,c) :将张量x在列的方向上重复c次,在行的方向上重复b次,在深度的方向上重复a次。例如YOLOv3中的代码:此代码的功能是生成每个格子的初始的横纵坐标。 grid_x = torch.linspace(0, input_width - 1, input_width).repeat(input_height, 1).repeat( batch_size * sel
2021-04-28 10:22:27 3118
原创 Pytorch 实现Darknet53的网络结构
import torchimport torch.nn as nnfrom collections import OrderedDictimport math# BasicBlock : 残差块,此残差块残差边上并没有卷积,故通过此残差块并不改变特征图的通道数class BasicBlock(nn.Module): def __init__(self,inplanes,planes): super().__init__() self.conv1=nn.Co
2021-04-20 12:46:00 484 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人