Fizz Buzz in Tensorflow
11–20 of 85 posts
Re: Fizz Buzz in Tensorflow
#12Earlier quoted context omitted.
Stupid question: We are trying to train the network how to calculate modulus of division. Of a binary encoding. Why should we expect this to be learnable in only two layers?
Yeah, secretly I was surprised that it worked as well as it did!
Don't forget to use a validation set for the model and hyperparameter selection though!
Re: Fizz Buzz in Tensorflow
#13Re: Fizz Buzz in Tensorflow
#14Joke aside, it's funny how simple machine learning problems can reveal people who think you can just give neural networks anything and output anything, and it will work like magic.
Re: Fizz Buzz in Tensorflow
#15 if i % 15 == 0: return np.array([0, 0, 0, 1])
elif i % 5 == 0: return np.array([0, 0, 1, 0])
elif i % 3 == 0: return np.array([0, 1, 0, 0])
else: return np.array([1, 0, 0, 0])Re: Fizz Buzz in Tensorflow
#16It would be much more interesting to see a TensorFlow program actually learn to solve FizzBuzz from examples, instead of hardcoding in the logic: if i % 15 == 0: return np.array([0, 0, 0, 1]) elif i % 5 == 0: return np.array([0, 0, 1, 0]) elif i % 3 == 0: return np.array([0, 1, 0, 0]) else: return np.array([1, 0, 0, 0])
Re: Fizz Buzz in Tensorflow
#17It would be much more interesting to see a TensorFlow program actually learn to solve FizzBuzz from examples, instead of hardcoding in the logic: if i % 15 == 0: return np.array([0, 0, 0, 1]) elif i % 5 == 0: return np.array([0, 0, 1, 0]) elif i % 3 == 0: return np.array([0, 1, 0, 0]) else: return np.array([1, 0, 0, 0])
Re: Fizz Buzz in Tensorflow
#18It would be much more interesting to see a TensorFlow program actually learn to solve FizzBuzz from examples, instead of hardcoding in the logic: if i % 15 == 0: return np.array([0, 0, 0, 1]) elif i % 5 == 0: return np.array([0, 0, 1, 0]) elif i % 3 == 0: return np.array([0, 1, 0, 0]) else: return np.array([1, 0, 0, 0])
Re: Fizz Buzz in Tensorflow
#19He should have used a Recurrent Neural Network with Long Short Term Memory so that the neural network won't have been dependent of the maximum number given NUM_DIGITS. Scalability! No wonders he didn't got the job. Joke aside, it's funny how simple machine learning problems can reveal people who think you can just give neural networks anything and output anything, and it will work like magic.
What _is_ the proper method?
Re: Fizz Buzz in Tensorflow
#20Earlier quoted context omitted.
Yeah, secretly I was surprised that it worked as well as it did!
What architecture do you need to get 100% accuracy? Don't forget to use a validation set for the model and hyperparameter selection though!
As with many models, I suspect that this network really learned some other property that has almost-but-not-quite the same pattern as divisible-by-N.