RunwenHu / CNN-Prediction-Based-Reversible-Data-Hiding

21 stars 6 forks source link

Training and testing section #2

Open heiheiyouhei opened 3 years ago

heiheiyouhei commented 3 years ago

Hello, author. First of all, thank you very much for sharing the code of this article. I learned a lot by reading your articles and code. I have a little contact with neural network, and I can't get the training and testing model from the loss function you gave. So I hope you can share the training and testing code. If I offend you, please forgive me. Looking forward to your reply, thank you!

RunwenHu commented 1 year ago

Hello author, I am a master student in University of Shanghai for Science and Technology. Thank you for your great contribution to the field of RDH, I have a question to ask you, does λ||w||2 in the loss function refer to L2 regularization? Is it equivalent to adding weight_decay(optimizer = torch.optimize.Adam(model.parameters(), lr=learning_rate, weight_decay= 1e-3)) to the optimizer, but the training results without weight_decay Why is it better than adding it? I'm sorry for the relatively basic question, as I have not been involved in deep learning before. I look forward to your answer, thanks again.

Thanks for your attention to this work.

For the standard stochastic gradient descent (SGD), L2 regularization is equal to weight decay regularization. But for the adaptive gradient algorithms like Adam, L2 regularization and weight decay regularization are not equal.

Inside the code (torch.optimize.Adam()), the “weight_decay” parameter represents to use of the “decoupled weight decay”. More information can be found at https://arxiv.org/abs/1711.05101

Kind Regards

Lesliepie1 commented 1 year ago

Thank you for your reply, and I wish you good luck in your studies and good health.

007rabbit commented 1 year ago

作者你好,最近拜读了您的两篇《CNN Prediction Based Reversible Data Hiding》和《Reversible Data Hiding By Using CNN Prediction and Adaptive Embedding》。第一篇文章中,在CNN网络训练阶段,使用您提出的网络训练以后在标准测试图像Lena.bmp中获得的预测像素误差为0的数量约为3.6万,但是在第二篇文章中,根据图像分类方法,使用三个集合像素去预测另外一个集合像素时,并没有取得更加良好的效果,反而略有不如。因此,想请作者是否能上传整个过程的代码?或者关键的train函数。上述两个复现过程大致使用同一种思路,因此对于第二篇文章中没能获得理想的效果感到不解。

err-2 commented 3 weeks ago

Hello authors, I recently read two of your papers, "CNN Prediction Based Reversible Data Hiding" and "Reversible Data Hiding By Using CNN Prediction and Adaptive Embedding". Here you only give the code for the test, and if you can, you can attach the train.py. thank