![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度瞎搞
文章平均质量分 69
Curya
没人枪毙你,你就活着!
展开
-
PyTorch单机多卡训练(DDP-DistributedDataParallel的使用)备忘记录
PyTorch使用DDP进行单机多卡训练备忘记录原创 2021-12-23 12:19:34 · 6123 阅读 · 2 评论 -
SwinTransformer中SW-MSA中attn_mask生成逻辑纪录
令input_resolution = (12, 12)window_size = 6shift_size = 3生成部分的源码如下: if self.shift_size > 0: # calculate attention mask for SW-MSA H, W = self.input_resolution img_mask = torch.zeros((1, H, W, 1)) # 1 H W 1原创 2021-08-03 10:57:02 · 1501 阅读 · 0 评论 -
Bilinear Attention Networks 代码记录
torch.einsum是个好东西,就是输入数据多于2个,就有点看不懂了。(改成了使用torch.matmul主要是为了将代码和论文公式对应上)其中,相关数据维度如下:# 1 forward函数:v_ [B, M, D]q_ [B, L, D]# 2 forward_with_weights函数:v_ [B, M, D]q_ [B, L, D]w [B, M, L]1 forward函数# low-rank bilinear pooling using einsumdef for原创 2021-04-19 16:31:17 · 1165 阅读 · 1 评论