Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实例化SPMamba.py #4

Open
SmoothJing opened this issue Apr 4, 2024 · 3 comments
Open

实例化SPMamba.py #4

SmoothJing opened this issue Apr 4, 2024 · 3 comments

Comments

@SmoothJing
Copy link

李凯前辈您好:
我从事的不是语音分离方向,所以有些东西还不太懂,但是我很关注mamba在语音方向上的应用,特别是在语音分离方向的卓越性能,想通过您这篇代码学习一下,所以就去调通了代码,我想实例化一下SPMamba.py主模块,但是由于语音分离方向和我现在的方向有些差别,所以想寻求一下前辈的帮助,希望得到前辈的解答,感谢!!!

@JusperLee
Copy link
Owner

什么意思,你可以单独将其拿出

@SmoothJing
Copy link
Author

前辈,我想我已经解决了这个问题,mamba-ssm包里面有不适配的东西,RMSNorm接受了一个没有被定义的参数,我想向您请教下,因为RMSNorm本质上是一个归一化,我想把他替换为LN,不知道前辈做过类似的实验没,影响不知道大不大。
代码如下
class MambaBlock(nn.Module):
def init(self, in_channels, n_layer=1, bidirectional=False):
super(MambaBlock, self).init()
self.forward_blocks = nn.ModuleList([])
for i in range(n_layer):
self.forward_blocks.append(
Block(
in_channels,
mixer_cls=partial(Mamba, layer_idx=i, d_state=16, d_conv=4, expand=4),
# norm_cls=partial(RMSNorm, eps=1e-5),
fused_add_norm=False,
)
)

@JusperLee
Copy link
Owner

按理说在这个任务上并不影响

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants