Tensorflow: how to handle input with nan values

I have a multilayer perceptron with a sigmoid loss (tf.nn.sigmoid_cross_entropy_with_logits) and an Adam optimizer (tf.train.AdamOptimizer). My input has several functions and some nan function values. When I replace nan values ​​with 0, I get the result, however, when I don't replace nan values, I get loss = nan.

What is the best way to handle nan values ​​in a tensor stream and how can I use my input with nan values ​​without replacing them with 0?

+4
source share

Source: https://habr.com/ru/post/1685927/


All Articles