We will create a tiny but fully functional learning machine: a single-layer perceptron, packaged as a reusable Rust library crate. Starting from an empty project, we will define the data structure, initialize random weights, implement the forward pass and training loop, and then verify everything with integration tests for the AND, OR, and XOR logic gates.
Along the way, we will see how the perceptron learning rule adjusts weights, why convergence is guaranteed for linearly separable tasks, and what happens when a task (XOR) is not linearly separable.