3 ms·
It 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 %
by gertef 10y ago
It 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])
- sherjilozair 10y agoThe TF program does learn to sovle FizzBuzz. The above code was used to generate data with which to train the network.
- oh_sigh 10y agoIt's really easy even just hand generate a "neural network" if you assume that the inputs can be preprocessed into base-3 and base-5 representations
- Bromskloss 10y agoAs far as I can see, that function was used only to generate training data. How would you like to see it trained instead? Should it output a string and only be told whether that was the correct output or not for the given input number?