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

loss问题 #10

Open
shenbuguanni opened this issue Nov 23, 2023 · 2 comments
Open

loss问题 #10

shenbuguanni opened this issue Nov 23, 2023 · 2 comments

Comments

@shenbuguanni
Copy link

  1. calloss_magmse全带幅度谱loss最后是除以batch和频点维度,而分段幅度谱loss(calloss_magmse_subband)除的是batch和帧数,因为output_mag.shape[2]应该是T维度;
  2. 另外请问为什么不在T维度求平均呢?一般使用F.l1_loss的reduction直接用Mean就会在batch和F和T求平均,这样是对效果有啥影响吗?
@felixfuyihui
Copy link
Owner

  1. calloss_magmse全带幅度谱loss最后是除以batch和频点维度,而分段幅度谱loss(calloss_magmse_subband)除的是batch和帧数,因为output_mag.shape[2]应该是T维度;
  2. 另外请问为什么不在T维度求平均呢?一般使用F.l1_loss的reduction直接用Mean就会在batch和F和T求平均,这样是对效果有啥影响吗?

主要是为了让各部分loss在数值量级上比较接近 方便设置权重

@jinhonglu
Copy link

你好,关于sisnr loss, 我看你在loss文件里通过calloss调用了,我有个小疑问,我们训练的时候 要调用calloss还是sisnr?
假设是调用calloss的话,我会遇到一个问题就是,我传入的参数是[batch, 1, signal_size],会经常遇到 loss_total = loss_total / (output.shape[0] - zerocount) 除以0的问题。
假设直接调用sisnr,我传入参数是[batch, signal_size],会导致 t = torch.sum(x_zm * s_zm) * s_zm / (l2norm(s_zm)**2 + eps) 除以维度不统一。

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

3 participants