Skip to content
ale99braPublic

About

Self-automated Artificial Neural Network: a from-scratch implementation of an ANN with multi-layer perceptron architecture, now with CNN, RNNs support and Transformer and GPU acceleration.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

175 Commits

Folders and files

Repository files navigation

SaANN — Self-automated Artificial Neural Network

Tests Python 3.11+ License: MIT

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).

Features

- 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

⚠️ Important: SaANN is designed for personal learning, not production. This project was created as an exercise to deepen my understanding of neural networks. While others are welcome to explore or use it, its primary purpose is educational for myself.

Documentation

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

Installation

git clone https://github.com/ale99bra/SaANN.git
cd SaANN
pip install -e .

See docs/installation.md for requirements and GPU setup.

Quick Start

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.

Examples

See the examples/ directory for complete working notebooks:

  • diabetes_dataset_example.ipynb: Manual MLP workflow
  • automatic_diabetes_dataset_example.ipynb: Automatic MLP workflow
  • XOR_example.ipynb: Non-linearity testing
  • flower_cnn_example.ipynb: CNN training and evaluation with metrics
  • EO_cnn_example.ipynb: CNN training on EO dataset
  • transformer_dummy_example.ipynb: Transfromer model example

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests. Remember that this is primarily an educational personal project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Alessio Branda - GitHub Profile

Getting Help

If you encounter any issues or have questions:

  1. Check the examples directory for usage patterns
  2. Review the documentation
  3. Open an issue on GitHub with a detailed description

About

Self-automated Artificial Neural Network: a from-scratch implementation of an ANN with multi-layer perceptron architecture, now with CNN, RNNs support and Transformer and GPU acceleration.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages