How shahzaib3120/apollo-backend works
Project Type and Purpose
• This is a standalone C++17 machine-learning framework (“Apollo”) for building and training feed-forward neural networks with minimal dependencies (Eigen3 for linear algebra) and a modular code structure. It is not a web app or microservices suite but a library + CLI (and separate Qt GUI) that supports custom layers, activations, and loss functions, demonstrated by a spam-email binary classifier.
File Structure Analysis
Top-level:
• Apollo.h, CMakeLists.txt, main.cpp – core library header, build configuration, and the CLI entry point for training/evaluation.
• Dataset/ – sample CSVs and preprocessing scripts, used by Dataloader and Preprocessing modules.
• Layers/ – implementations of Layer base class plus derived Dense, Relu, Sigmoid, Softmax.
• Loss/ – namespace Loss with BCE and MSE functions and derivatives.
• Model/ – Model class that holds a vector<variant<Dense,Sigmoid>> of layers, orchestrates compile(), fit(), predict(), save/load.
• Preprocessing/ – functions for normalization, standardization, and spam-specific feature extraction.
• Utils/ – Dataloader class (splits CSV into train/val Eigen matrices) and linalg namespace (broadcast helpers).
• Tests/ – unit tests exercising layers, loss, model behavior.
• Models/ – sample serialized model outputs and CSVs for regression/spam testing.
• TODO.txt, images/, readme.md – documentation/artifacts.
Key Architectural Insights from README
• Modular “Layer” interface (forward/backward/update) → concrete layers via polymorphism + std::variant.
• Preprocessing & Dataloader separate concerns: feature extraction vs. I/O + batching.
• Utils.linalg provides low-level matrix ops beyond Eigen’s core.
• CMake orchestrates build; Eigen3 is the sole heavy dependency.