So the output of my network is a list of propabilities, which I then round using tf.round() to be either 0 or 1, this is crucial for this project. I then found out that tf.roun
Building on a previous answer, a way to get an arbitrarily good approximation is to approximate round()
using a finite Fourier approximation and use as many terms as you need. Fundamentally, you can think of round(x)
as adding a reverse (i. e. descending) sawtooth wave to x
. So, using the Fourier expansion of the sawtooth wave we get
With N = 5, we get a pretty nice approximation: