Raman-Lab-UCLA / Multiclass_Metasurface_InverseDesign

Here, we use a conditional deep convolutional generative adversarial network (cDCGAN) to inverse design across multiple classes of metasurfaces. Reference: https://onlinelibrary.wiley.com/doi/10.1002/adom.202100548
116 stars 32 forks source link

Problem about training the model #2

Open aliinassiri opened 2 years ago

aliinassiri commented 2 years ago

Hello, many thanks for putting these information about the model. I have problem while running the DCGAN_Train.py file. When the training loop starts after second batch ,the values of Discriminator and Generator loss don't change and D(x) ,G(D(Z)) will be 1. I don't have any idea about this problem. I run the file on windows 10, NVIDIA GEFORCE GTX 1650 bandicam 2022-06-25 14-13-41-830 .

Orrinn commented 2 years ago

i met the same problem, did u solve it?

aliinassiri commented 2 years ago

i met the same problem, did u solve it?

i change learning rate to 0.00001 and i think it has positive impact on the loss (i guess the problem is due to different types of GPU that we use). if you could find the problem help me about this 2

Orrinn commented 2 years ago

thank u. i gonna try it. i tried to use different random seed, but the GAN was collapse and i got the follow loss image...... So are u GAN work properly? image

aliinassiri commented 2 years ago

thank u. i gonna try it. i tried to use different random seed, but the GAN was collapse and i got the follow loss image...... So are u GAN work properly? image

sorry for replying late. I Train the model with learning rate that I have mentioned before for 500 epoch. The loss of the model is in the below image. I think because of changing learning rate for better result I have to train for more than 500 epoch. And other problem I have is that when I want to validate the result with the Lumerical, the scripts that the author provided doesn't work, Do you have similar problem? Figure 2022-08-04 094745 .

hzyliusha commented 1 year ago

I doubt that the picture is not aligned with the data in excel, because the code does not consider whether the picture is aligned with the data in excel.

Yu-Chen-Yi commented 1 year ago

I doubt that the picture is not aligned with the data in excel, because the code does not consider whether the picture is aligned with the data in excel.

I think there might be an issue with the 'importbinary(files{i}, 'microns');' command for loading the file. It's possible that the older version of Lumerical and the newer version have slightly different ways of importing images. I'm going to manually input the image instead of using the command for this line. Currently, the generated absorption spectrum by Gnet doesn't differ significantly from the spectral characteristics used for training. 360181567_626417269447776_3909386154965243711_n

xulin23 commented 8 months ago

我怀疑图片与excel中的数据没有对齐,因为代码没有考虑图片与excel中的数据是否对齐。

我认为 'importbinary(files{i}, 'microns');' 可能存在问题 用于加载文件的命令。旧版本的 Lumerical 和新版本的导入图像的方式可能略有不同。 我将手动输入图像,而不是使用此行的命令。目前,Gnet 生成的吸收光谱与用于训练的光谱特征没有显着差异。 360181567_626417269447776_3909386154965243711_n

请问该如何操作

FengNDXN commented 2 months ago

thank u. i gonna try it. i tried to use different random seed, but the GAN was collapse and i got the follow loss image...... So are u GAN work properly? image

sorry for replying late. I Train the model with learning rate that I have mentioned before for 500 epoch. The loss of the model is in the below image. I think because of changing learning rate for better result I have to train for more than 500 epoch. And other problem I have is that when I want to validate the result with the Lumerical, the scripts that the author provided doesn't work, Do you have similar problem? Figure 2022-08-04 094745 .

Hello, when I adjust the learning rate to 0.00001 as you said, the value of D(x) becomes zero all the time, and the discriminator can't make a judgment on the real and the output picture, do you know how to solve it? 6d3d33efdbfb9644254595232646a63