iusaspb / deep_learning_nikolenko_and_co Goto Github PK
View Code? Open in Web Editor NEWCorrected examples from Николенко С., Кадурин А., Архангельская Е. Глубокое обучение
Corrected examples from Николенко С., Кадурин А., Архангельская Е. Глубокое обучение
Thanks for offering this great repository! We deployed a tool that automatically detected this possible numerical bug from your repository.
z_log_sigma_sq
variable may be too large to apply tf.exp or too small so that the gradients after tf.sqrt(tf.exp(.)) become too large.
To fix this, maybe we can replace
z_log_sigma_sq = tf.add( tf.matmul(enc_layer_2, w["w_recog"]['out_log_sigma']), w["b_recog"]['out_log_sigma'])
at Line 46 by
z_log_sigma_sq = tf.add( tf.matmul(enc_layer_2, w["w_recog"]['out_log_sigma']), w["b_recog"]['out_log_sigma'])
z_log_sigma_sq = tf.clip_by_value(z_log_sigma_sq, -87, 87)
Similar possible issues were also found at ch10_04_04_Pic_10_06.py:
at ch10_04_05_Pic_10_07.py:
and at ch10_04_06_Pic_10_08.py:
If they are valid issues, the fixing method could be the same as above.
Thanks!
Hello~
Thank you very much for sharing your code.
I ran ch10_04_01.py on my computer. Unfortunately, I got NAN loss.
After preliminary inspection of the code, I couldn't find the root cause of NaN loss. 1e-10 was added to the log to prevent log(0). This confused me for a long time. After I checked the program carefully with tfdebug, I found the problem!
In the code, 1e-10 was added to log to prevent log(0)
reconstr_loss = -tf.reduce_sum(x * tf.log(1e-10 + x_reconstr_mean) +(1-x) * tf.log(1e-10 + 1-x_reconstr_mean), 1)
However, 1e-10 may be too small to avoid 1e-10 + 1-x_reconstr_mean
becoming 0, because I found that x_reconstr_mean may sometimes become around 1.0000000001 due to floating-point accuracy issue, which may lead to log(0)
Increasing 1e-10 to 1e-7 can solve this problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.