KortexDL is a modern, high-performance deep learning framework written in C++20, leveraging Intel's oneAPI Math Kernel Library (MKL) for optimized linear algebra operations. The framework provides both C++ and Python interfaces, making it suitable for research and production environments.
- β‘ MKL-Optimized: Built on Intel oneAPI MKL 2025.2 for maximum numerical performance
- π― Modern C++20: Clean, type-safe implementation using latest C++ features
- π Python Bindings: Full-featured Python API via pybind11
- π§ Comprehensive Layers: Dense, CNN, normalization, dropout, and more
- π 12 Optimizers: SGD, Adam, AdamW, RMSprop, Adadelta, and more
- π 15 Activations: ReLU, GELU, Swish, Mish, and all standard functions
- π Flexible Training: Custom loss functions, metrics, and learning rate schedulers
- ποΈ Modular Design: Easy to extend with custom layers and operations
- Intel oneAPI Toolkit 2025.2+ (includes MKL)
- CMake 3.20+
- C++20 compatible compiler (GCC 12+, Clang 15+, or Intel ICX)
- Python 3.8+ (for Python bindings)
# Clone the repository
git clone https://github.com/Mostafasaad1/kortexdl.git
cd kortexdl
# Source Intel oneAPI environment
source ~/intel/oneapi/setvars.sh
# Build C++ library
mkdir build && cd build
cmake .. -DCMAKE_CXX_COMPILER=icpx -DCMAKE_BUILD_TYPE=Release
cmake --build . -j$(nproc)
# Build Python bindings (optional)
cd ..
cmake build -DBUILD_PYTHON_BINDINGS=ON
cmake --build build --target _kortexdl_core -j$(nproc)For detailed instructions, see Installation Guide.
#include "KortexDL.hpp"
using namespace KortexDL;
int main() {
// Create a simple network
Network net({784, 128, 64, 10}, ActivationType::ReLU);
// Train on data
net.train_batch(inputs, targets, LossType::CrossEntropy,
0.001f /*lr*/, 32 /*batch_size*/);
// Make predictions
auto predictions = net.forward(test_input, 1, false);
return 0;
}import _kortexdl_core as bd
import numpy as np
# Create network
net = bd.Network([784, 128, 64, 10], bd.ActivationType.ReLU)
# Train
net.train_with_monitoring(
X_train, y_train,
bd.LossType.CrossEntropy,
learning_rate=0.001,
batch_size=32,
epochs=10
)
# Predict
predictions = net.forward(test_sample, 1, False)KortexDL/
βββ include/ # C++ headers
β βββ core/ # Core components (Layer, Network, Tensor)
β βββ cnn/ # CNN layers (Conv2d, MaxPool2d, etc.)
β βββ optimization/# Optimizers and LR schedulers
βββ src/ # C++ implementation
βββ python_bindings/ # Python API
β βββ src/ # pybind11 bindings
β βββ tests/ # pytest suite
β βββ examples/ # Python examples
βββ examples/ # C++ examples
βββ tests/ # C++ tests
βββ docs/ # Documentation
βββ docker/ # Docker configurations
- Nesterov Optimizer Bug: Contains logic error (documented, not fixed). See KNOWN_ISSUES.md
- Python Optimizer Bindings:
Optimizer.update()not accessible from Python - Limited Python Activations: Only 8/15 activations exposed to Python
For complete list, see KNOWN_ISSUES.md.
- Installation Guide - Detailed setup instructions
- Quick Start - Get up and running quickly
- CNN Guide - Using convolutional layers
- Architecture Overview - Framework design
- API Reference - Complete API documentation
- CHANGELOG - Version history and fixes
- Known Issues - Current limitations and bugs
examples/linear_function_examples/regression_example.cpp- Simple regressionexamples/cnn_demo.cpp- CNN layers demonstrationexamples/flight_delay_examples/- Real-world dataset example
python_bindings/examples/cnn_demo.py- CNN layers in Python- See
python_bindings/tests/for comprehensive usage examples
cmake --build build --target run_tests
cd build && ctest --output-on-failurecd python_bindings
pytest tests/ -v./scripts/lint.sh --format # Format code
./scripts/lint.sh --tidy # Static analysisContributions are welcome! Please see the contributing guidelines (coming soon).
This project is licensed under the MIT License - see the LICENSE file for details.
- Intel for the oneAPI Math Kernel Library
- pybind11 team for excellent Python bindings support
- All contributors and users of KortexDL
Made with β€οΈ by Mostafa Saad
GitHub β’ Documentation β’ Examples