This project implements Logistic Regression from scratch in C++ with CUDA acceleration, featuring modular libraries for Matrix operations, Statistical computations, and GPU-optimized implementations.
- Matrix Library: Full CPU implementation with constructors, operations, and vector operations
- Statistics Library: Descriptive statistics, correlation, normalization, and quartiles
- Project Structure: Organized modular architecture with cpp_lib and cuda_lib separation
- Build System: Makefile-based compilation for all modules
- Dataset Integration: Training and test CSV datasets prepared
Phase 1: Algorithm Implementation ⏳ IN PROGRESS (README)
- Logistic Regression (CPU): Core implementation with multiple optimization methods
- Gradient Descent Variants: Batch, Stochastic, and Mini-Batch implementations
- Cost Functions: Cross-entropy loss and regularization support
- Prediction Pipeline: Inference module for trained models
- Python Bindings: Seamless integration with Python for data science workflows
- CUDA Matrix Operations: GPU-accelerated matrix computations
- CUDA Memory Management: Efficient GPU memory allocation and transfer
- GPU Kernels: Optimized CUDA kernels for core operations
- CPU-GPU Interface: Seamless data transfer between CPU and GPU
- Training Scripts:
train_logreg.pyfor model training - Prediction Module:
predict_logistic.pyfor inference
- Benchmark CPU vs CUDA implementations
- Optimize memory allocation patterns in CUDA kernels
- Implement advanced gradient descent variants (Adam, RMSprop)
- Profile and optimize bottlenecks
- Comprehensive unit tests for all modules
- Integration tests for CPU-GPU consistency
- Regression tests on standard datasets
- Numerical accuracy validation
- Detailed API documentation for each module
- Performance comparison benchmarks
- Real-world usage examples
- Troubleshooting guide
dslr/
├── cpp_lib/ # CPU implementations
│ ├── Matrix/ # Matrix operations library
│ ├── Stats/ # Statistics library
│ └── LogisticRegression/ # Main ML model
├── cuda_lib/ # GPU implementations
│ ├── MatrixCuda/ # CUDA matrix operations
│ └── Stats/ # CUDA statistics
├── datasets/ # Training and test data
├── train_logreg.py # Training script
└── predict_logistic.py # Prediction script
- Benchmark Suite - Compare CPU vs GPU performance metrics
- Unit Testing Framework - Implement comprehensive tests for all modules
- Documentation - Generate API docs and usage examples
- Performance Profiling - Identify and optimize bottlenecks
- Linear Regression Using Normal Equation: https://www.deep-ml.com/problems/14
- Linear Regression Using Gradient Descent: https://www.deep-ml.com/problems/15