cyclomon / 3dbraingen

Official Pytorch Implementation of "Generation of 3D Brain MRI Using Auto-Encoding Generative Adversarial Network" (accepted by MICCAI 2019)
MIT License
126 stars 38 forks source link

About test.ipynb #5

Open Hpjhpjhs opened 4 years ago

Hpjhpjhs commented 4 years ago

Excuse me, it seems that the file called 'test.ipynb' cannot be open. It is appreciated if you check it. Thanks so much!

cyclomon commented 4 years ago

Hi, I think there is some conflict between github and the script, so please download the file and open it with your own jupyter notebook.

Thanks!

Hpjhpjhs commented 4 years ago

Hi: Thanks for your reply. I have tried to do that, but it's still not open by my own jupyter notebook. Besides, I have some questions about the training code of AlphaGAN with WGAN-GP in jupyter notebook. I think that for the training of C discriminator, there should be a new real image to input rather than the same image from another discriminator. Besides, I wrote some codes to visualize the data distribution, but it seems unreasonable. As a result, could you share your PCA visualization part. It is appreciated if I can receive your reply.

Best wishes Panjian Huang

------------------ 原始邮件 ------------------ 发件人: "cyclomon"<notifications@github.com>; 发送时间: 2020年6月23日(星期二) 中午1:46 收件人: "cyclomon/3dbraingen"<3dbraingen@noreply.github.com>; 抄送: "☆随偑飘動☆"<773847441@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [cyclomon/3dbraingen] About test.ipynb (#5)

Hi, I think there is some conflict between github and the script, so please download the file and open it with your own jupyter notebook.

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

cyclomon commented 4 years ago

Hi, I uploaded a new Test code, so please check the code. I tried to find my code for PCA visualization, but I lost the file when I graduated. The code is very simple. I just used Nilearn and followed the tutorial that Nilearn provides.

Best Regards, Gihyun Kwon

Hpjhpjhs commented 4 years ago

Hi: Thanks so much for your reply. The test.ipynb can be opened now. So you mean the PCA visualization code can be found from the Nilearn package? It's appreciated if I can receive your reply.

Best wishes Panjian Huang

------------------ 原始邮件 ------------------ 发件人: "cyclomon"<notifications@github.com>; 发送时间: 2020年6月24日(星期三) 中午11:20 收件人: "cyclomon/3dbraingen"<3dbraingen@noreply.github.com>; 抄送: "☆随偑飘動☆"<773847441@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [cyclomon/3dbraingen] About test.ipynb (#5)

Hi, I uploaded a new Test code, so please check the code. I tried to find my code for PCA visualization, but I lost the file when I graduated. The code is very simple. I just used Nilearn and followed the tutorial that Nilearn provides.

Best Regards, Gihyun Kwon

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

cyclomon commented 4 years ago

Hi,

I'm glad to hear that the test code works now. For PCA visualization, code is not from Nilearn, but Sklearn(Scikit-learn). You will easily find easy sample codes for PCA. I'm sorry that I wrongly replied.

Best regards, Gihyun Kwon

Hpjhpjhs commented 4 years ago

Hi: I have tried to apply Sklearn for visualization, but the result seems unreasonable. Whether you do height x width x depth as the features, so the input of PCA is a 2D matrix: 210 x (height x width x depth). I will still try it again. It's appreciated If you can help me when I do that in some problems. Thanks so much.

Best wishes Panjian Huang 

------------------ 原始邮件 ------------------ 发件人: "cyclomon"<notifications@github.com>; 发送时间: 2020年6月29日(星期一) 下午4:24 收件人: "cyclomon/3dbraingen"<3dbraingen@noreply.github.com>; 抄送: "☆随偑飘動☆"<773847441@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [cyclomon/3dbraingen] About test.ipynb (#5)

Hi,

I'm glad to hear that the test code works now. For PCA visualization, code is not from Nilearn, but Sklearn(Scikit-learn). You will easily find easy sample codes for PCA. I'm sorry that I wrongly replied.

Best regards, Gihyun Kwon

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Hpjhpjhs commented 4 years ago

Hi: Sorry for interrupting again. I have mainly some questions about the AlphaGAN with WGAN-GP. These questions all focus on this model training.

  1. You use the mean as the loss of Encoder and Generator. But when the model was training, I found that at the beginning, their loss is positive, after that, their loss will be changed to negative, will this affect the training? Furthermore, the loss of discriminator will be negative all the time. about this?

  2. I studied the original paper about AlphaGAN, but comparing with your codes, I don't know whether there need to input a new real image in each neural network (Encoder, Generator, Discriminator, Code Discriminator), or just input a same real image to the four neural network.

  3. I found out some other's codes about AlphaGAN, but there are different orders of training. For example, in your code, the encoder and generator are trained firstly, and then the discriminator, final training is the code discriminator, but some others are code discriminator is trained firstly. So will the order of training affect the model performance?

It's very appreciated if I can receive your reply. I know here may be a lot of problems, but they are very important to me. So if there is anything unclear here, please let me know. Looking forward to receiving your reply. Thanks so much.

Best wishes Panjian Huang

------------------ 原始邮件 ------------------ 发件人: "cyclomon"<notifications@github.com>; 发送时间: 2020年6月29日(星期一) 下午4:24 收件人: "cyclomon/3dbraingen"<3dbraingen@noreply.github.com>; 抄送: "☆随偑飘動☆"<773847441@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [cyclomon/3dbraingen] About test.ipynb (#5)

Hi,

I'm glad to hear that the test code works now. For PCA visualization, code is not from Nilearn, but Sklearn(Scikit-learn). You will easily find easy sample codes for PCA. I'm sorry that I wrongly replied.

Best regards, Gihyun Kwon

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

cyclomon commented 4 years ago
  1. WGAN loss value can be negative.
  2. As I know of, there might be slight change in putting new inputs, but not major changes. Since I didn't tried many settings, it is not sure.
  3. Training order does not affect the results.

GAN is quite sensitive to minor settings, so there will be changes in performance with changing those settings.

Best Regards, Gihyun Kwon

Hpjhpjhs commented 4 years ago

Hi: Thanks for your reply. The first question I want to focus on AlphaWGAN. So you mean that  1. [10/200000] D: 4.58 En_Ge: -29.6 Code: 7.87

  1. [20/200000] D: -1.33 En_Ge: -52.2 Code: 8.39 3. [30/200000] D: -2.71 En_Ge: -60.5 Code: 8.92 are reasonable?

2.Since I tried to run your code about AlphaWGAN, and there would be the issues about inplace oeration. So I have to input a new image in each neural network.

  1. The new question is that whether there need to add output = h5.view(h5.size()[0], -1) rather than output = h5 in discriminator network on AlphaWGAN.
  2. Whether the generator needs to iterate many times than other models on AlphaWGAN. For example, set g_iter = 5, d_iter = 1, cd_iter = 1.

Looking forward to receiving your reply.

Best wishes Panjian Huang

------------------ 原始邮件 ------------------ 发件人: "cyclomon"<notifications@github.com>; 发送时间: 2020年7月9日(星期四) 晚上8:12 收件人: "cyclomon/3dbraingen"<3dbraingen@noreply.github.com>; 抄送: "☆随偑飘動☆"<773847441@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [cyclomon/3dbraingen] About test.ipynb (#5)

WGAN loss value can be negative.

As I know of, there might be slight change in putting new inputs, but not major changes. Since I didn't tried many settings, it is not sure.

Training order does not affect the results.

GAN is quite sensitive to minor settings, so there will be changes in performance with changing those settings.

Best Regards, Gihyun Kwon

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.