MLResearchAtOSRAM / tmm_fast

tmm_fast is a lightweight package to speed up optical planar multilayer thin-film device computation. Developed by Alexander Luce (@Nerrror) in cooperation with Heribert Wankerl (@HarryTheBird).
MIT License
58 stars 23 forks source link

Nan will sometimes appear when calculating reflection coefficients #5

Closed Hiter-ZSH closed 2 years ago

Hiter-ZSH commented 2 years ago

I used the package for genetic optimization and found that nan would appear when calculating reflectance in a large-scale search

Nerrror commented 2 years ago

For which parameters do Nan's appear? Can you give me a minimal example to replicate the problem?

Hiter-ZSH commented 2 years ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

    I have sovled this problem. 

        I found that in a few cases, some numbers in the M matrix are very small, very closely to 0, which can lead to a NAN in the calculated reflection coefficient r. So, I changed all the data types to torch.double. Then, it worked fine after that.

                ***@***.***

---- Replied Message ----

     From 

        ***@***.***>

     Date 

    10/5/2022 17:11

     To 

        ***@***.***>

     Cc 

        ***@***.***>
        ,

        ***@***.***>

     Subject 

          Re: [MLResearchAtOSRAM/tmm_fast] Nan will sometimes appear when calculating reflection coefficients (Issue #5)

For which parameters do Nan's appear? Can you give me a minimal example to replicate the problem?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>