沿时间 rFFT,将实部与虚部拼到 batch 轴,共享两层1×1通道卷积,再逆变换、残差相加并施加有效帧掩码。
(2,8,31) / (2,1,31);x为BCT,mask可广播到BCT(2,8,31);保持31帧,掩码为0处输出为0144 个总参数;其中 144 个可训练。in_channels=out_channels=8、T=31;骨架动作分割的时序特征混合forward() 数据流顺序拆解 · 点击任意子模块方块可同步查看对应源码切片B×C×T 输入变为B×C×16复频谱;实虚沿 batch 拼接至4×8×16,经过两层无激活的实值仿射卷积。重组复谱后指定 n=T 逆变换,残差和乘 mask。 本页使用 in_channels=out_channels=8、T=31,以真实模块 forward_hook 记录子层输入输出,并追踪本文件执行行上的张量形状。
51 x_fft = torch.fft.rfft(x, dim=2)52 53 x_fft_real = x_fft.real54 x_fft_imag = x_fft.imag55 56 x_fft_real_imag = torch.cat([x_fft_real, x_fft_imag], dim=0)57 x_fft_real_imag = self.conv1x1_mag(x_fft_real_imag)58 x_fft_real_imag = self.conv1x1_mag2(x_fft_real_imag)59 60 x_fft_real, x_fft_imag = torch.chunk(x_fft_real_imag, 2, dim=0)61 62 out_fft = torch.complex(x_fft_real,x_fft_imag)
保持输入输出通道相同,并为每个时间点提供有效性掩码。
from SpectralScalpelChannelMixer import FFT_conv_filter mixer = FFT_conv_filter(8, 8) y = mixer(sequence, mask)
Method 动机参考:在动作分割特征中通过频谱通道交互改变时间响应,并用掩码排除填充帧的最终输出。
| 消融变体 | 结构配置 | 验证目的 |
|---|---|---|
| 通道混合 | 只保留残差 | 比较混合贡献 |
| 映射深度 | 一层与两层1×1卷积 | 比较参数化差异 |
| 频谱分量 | 仅实部或仅虚部更新 | 比较时间边界敏感性 |