This repository documents a step-by-step attempt to solve the following problem:
Try to learn a neural network adding two binary numbers or performing multiplication by two (note that result should also be some binary number).
This project focuses on the first part of the task: learning binary addition with a neural network.
This is not only a final solution. It is a record of the whole process:
- understanding the task,
- building the program step by step,
- testing and improving the code,
- training a neural network in PyTorch,
- evaluating the results,
- asking what should come next.
task/– original task descriptionconversation/– step-by-step project storycode/– 8 Python files showing how the program evolvedresults/– selected outputs and observationsnext_steps/– open questions and future directions
For 4-bit binary numbers, the MLP model achieved perfect accuracy on all 256 possible input pairs.
Does this approach still work well for larger binary numbers, or do we need a different architecture that better captures binary carry propagation?