模块出处
[MICCAI 24] [link] TinyU-Net: Lighter Yet Better U-Net with Cascaded Multi-receptive Fields
模块名称
Cascade Multi-Receptive Fields (CMRF)
模块作用
轻量感受野块
模块结构
模块特点
- 起点使用PWConv(PointWise Convolution, 1×1卷积)压缩通道,终点使用PWConv恢复通道,构成bottle neck结构
- 中间使用级联的DWConv(Depthwise Convolution, 深度卷积)提取特征
模块代码
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
def autopad(k, p=None, d=1):
if d > 1:
k = d * (k - 1) + 1 if isinstance(k, int) else [d * (x - 1) + 1 for x in k] # actual kernel-size
if p is None:
p = k // 2 if isinstance(k, int) else [x // 2 for x in k] # auto-pad
return p
class Conv(nn