An educational deep-learning framework built from scratch with NumPy/CuPy. SaANN provides transparent implementations of MLPs, CNNs and RNNs, with optional GPU acceleration and comprehensive metrics for learning and experimentation.
New module: VERSION 0.4.0
SaANN now includes a lightweight quantitative finance module focused on volatility forecasting (see finance for more).
- Parkinson volatility estimation
- HAR feature generation
- Forward realized volatility targets
- Automatic train/test split
- Automatic feature scaling
- Sequence generation for RNNs
- Financial forecasting metrics
- Supported Metrics
- QLIKE
- RMSPE
- MAPE
- MASE
- Directional Accuracy
- Horizon Directional Accuracy
Full documentation lives in docs/:
- Installation — Setup, requirements, optional GPU (CuPy) support
- Quick Start — Copy‑paste examples for every model type
- API Reference — Full method-by-method documentation
- Architecture — Project structure and design overview
- Features — Core architecture, MLP, CNN, RNN, Transformer, Cross-Training, metrics
- Finance — New finance module
git clone https://github.com/ale99bra/SaANN.git
cd SaANN
pip install -e .See docs/installation.md for requirements and GPU setup.
from saann.models import SequentialModel
model = SequentialModel(gpu=False)
layer_info = [
(X_train.shape[1], 10, "relu", "he"),
(10, 1, "linear", "he")
]
model.construct(layer_info, learning_rate=0.01)
model.fit(X_train, y_train, epochs=1000, batch_size=32, wd=0.01, loss_function='MSE')
y_pred = model.predict(X_test)More examples (RNN, CNN, Transformer, Cross-Training) in docs/quickstart.md.
See the examples/ directory for complete working notebooks:
diabetes_dataset_example.ipynb: Manual MLP workflowautomatic_diabetes_dataset_example.ipynb: Automatic MLP workflowXOR_example.ipynb: Non-linearity testingflower_cnn_example.ipynb: CNN training and evaluation with metricsEO_cnn_example.ipynb: CNN training on EO datasettransformer_dummy_example.ipynb: Transfromer model example
Contributions are welcome! Please feel free to submit issues or pull requests. Remember that this is primarily an educational personal project.
This project is licensed under the MIT License - see the LICENSE file for details.
Alessio Branda - GitHub Profile
If you encounter any issues or have questions:
- Check the examples directory for usage patterns
- Review the documentation
- Open an issue on GitHub with a detailed description