scolburn54 / rcwa_tf

RCWA with inherent automatic differentiation using TensorFlow
BSD 3-Clause "New" or "Revised" License
41 stars 6 forks source link

内存消耗问题 #1

Open terra2021 opened 2 years ago

terra2021 commented 2 years ago

我在使用rcwa_tf时发现,当使用的谐波数较多时,内存消耗会急速增加。在我的16GB内存电脑,只能实现15x15的谐波计算。然而为了保证设计数值的收敛性,我需要至少需要35x35的谐波数,这似乎无法在个人电脑上完成设计。有谁可以确认下这个问题吗?

terra2021 commented 2 years ago

When using rcwa_tf, I found that memory consumption increases dramatically when more harmonics are used. On my 16GB RAM computer, only 15x15 harmonic calculations can be achieved. However, in order to ensure the convergence of the design values, I need at least 35x35 harmonics, which seems impossible to design on personal PC. Can anyone confirm this issue?

xu-2052047 commented 1 year ago

I just met the same question in my RCWA code.I think that's because the memory consumption increase with the speed of the fourth power of number harmonics . I think the way to deal with it is to use other kinds of RCWA or use FFF which may help to decrease the number of harmonics to converge. You can see more about FFF in this article: Lifeng Li, "Use of Fourier series in the analysis of discontinuous periodic structures," J. Opt. Soc. Am. A 13, 1870-1876 (1996) https://opg.optica.org/josaa/abstract.cfm?URI=josaa-13-9-1870