ios-community/gate-learner — reverse-engineered prompt
Reverse engineered prompt
Build me a small Rust project that can learn simple logic gates with a neural network built from scratch. I want to be able to train and evaluate OR and XOR for any reasonable number of inputs, especially the classic 2 input XOR case, and run it from the command line with simple options for things like number of inputs, epochs, learning rate, batch size, hidden layer sizes, activation choice, and an optional random seed for repeatable runs.
Please make the training smart enough to stop early when it has clearly converged or stalled, and show useful results like loss and accuracy over time. I would also like it to save the trained model and the training history as JSON, and optionally export a PNG chart of the training curves. If possible, make the plotting optional so it can still build in a minimal environment.
It should also work as a small reusable Rust library, not just a CLI tool. Look up current Rust docs online if you need to.
Want more depth? Deep Reverse