SciSharp / TensorFlow.NET

.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
https://scisharp.github.io/tensorflow-net-docs
Apache License 2.0
3.21k stars 514 forks source link

Unexpected accuracy for float32 #525

Closed Oceania2018 closed 4 years ago

Oceania2018 commented 4 years ago

When running this UnitTest: tf.sin, tf.net losts accuracy. This problem will lead to the vanishing of the gradient in the case of multilayer neural networks, especially more than 8 layers deep.

image

Same unexpected result for Sigmoid test.

What's wrong with it? image

Oceania2018 commented 4 years ago

float in python is not equal float32 in .net. Just use double when using deep neural network.