JaderoChan/BPNN
Library这是一个三层全连接 BP 神经网络的实现,出于学习目的,没有依赖任何第三方库。各个部分都进行了解耦,可以进行多种切实的任务训练。
一个三层全连接 BP 神经网络的实现,出于学习目的,没有依赖任何第三方库。各个部分都进行了解耦,可以进行多种切实的任务训练。
No GitHub topics on this repo.
- C98.6%
- CMake1.4%
1 Review
BPNN is a compact, focused C implementation of a three-layer fully connected backpropagation neural network, and its biggest strength is that it is small enough to study end to end. The core API is cleanly split between parameter ownership (bpnn_params_t) and per-run network state (bpnnet_t), with separate constructors for training and inference. I also liked that the implementation avoids third-party dependencies, uses CMake to expose a static library, and includes a separate derivation document for the forward/backward math rather than leaving the equations implicit in code.
For adoption, the project would benefit most from a runnable example and tests. Right now there is no sample program showing how to initialize weights/biases, train on a tiny dataset such as XOR or a toy classifier, and call bpnn_use. That makes it harder to verify the intended memory layout for input batches and labels. A few unit tests around softmax output normalization, loss behavior, and one gradient update would make the implementation much easier to trust. I would also revisit the tanh helper in bpnn.h, since it collides with the standard math.h tanh name on many C toolchains. The early-stop condition in bpnn_train compares consecutive sample losses rather than an epoch-level aggregate, which could stop training sooner than expected depending on sample order.
The repo is very new, MIT licensed, written in C, and has a clear educational purpose. Adding CI, topics, a short API reference, and one complete training example would turn it from a readable learning implementation into something other C developers can confidently clone, build, and experiment with.
I have removed the tanh function and corrected the stop condition of the training function. The documentation and examples have been added to the TODO.
