GithubHelp home page GithubHelp logo

Mixloss 出现 nan about phasen HOT 7 OPEN

huyanxin avatar huyanxin commented on June 19, 2024
Mixloss 出现 nan

from phasen.

Comments (7)

iver56 avatar iver56 commented on June 19, 2024 2

I had this problem too. I think the non-differentiability of sqrt at 0 is the culprit here. Adding a very small value before taking sqrt, or somehow avoid passing zeroes to sqrt, can help against NaNs.

from phasen.

Chen1399 avatar Chen1399 commented on June 19, 2024 1

可以先用sisnr预训练几步,初始化参数,然后在换成mixloss进行训练

from phasen.

Andong-Li-speech avatar Andong-Li-speech commented on June 19, 2024 1

大佬,我用的是Mixloss,一运行loss就 nan.
1、LR 我已经设置很小了(0.00001);
2、没有/0 情况;请问还有可能是什么原因呢?

This may be caused by the compressed coefficient \alpha, i.e., 0.3. You may as well calculate the gradient of the network output and you will get it.

from phasen.

huyanxin avatar huyanxin commented on June 19, 2024

我印象中之前也遇到过Nan,直观感觉是这个loss确实有点问题,和你的数据集和网络初始化有点关系,曾经试过只喂随机数,前几个step正常,然后就突然崩掉了确实也很奇怪。你换成sisnr应该就可以了正常训练,效果也是相差不大的。

from phasen.

Wangzhen-kris avatar Wangzhen-kris commented on June 19, 2024

可以先用sisnr预训练几步,初始化参数,然后在换成mixloss进行训练

我尝试先用sisnr预训练了几步,并使用第一次保存下的模型初始化,但是mix-loss依然为nan,请问您具体是怎么做的呢

from phasen.

Wangzhen-kris avatar Wangzhen-kris commented on June 19, 2024

I had this problem too. I think the non-differentiability of sqrt at 0 is the culprit here. Adding a very small value before taking sqrt, or somehow avoid passing zeroes to sqrt, can help against NaNs.

That works for me. I set the value to 1e-6 and I'm not sure what is appropriate to set the value.

from phasen.

iver56 avatar iver56 commented on June 19, 2024

I had this problem too. I think the non-differentiability of sqrt at 0 is the culprit here. Adding a very small value before taking sqrt, or somehow avoid passing zeroes to sqrt, can help against NaNs.

That works for me. I set the value to 1e-6 and I'm not sure what is appropriate to set the value.

I've been using 1e-12. Note that the square root of 1e-6 ends up being a much larger number, namely 0.001

from phasen.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.