Welcome to the LinAlgKit docs. This project provides a comprehensive, Python-first linear algebra and deep learning math library built on NumPy.
| Version: 0.2.1 | GitHub | PyPI |
pip install LinAlgKit
For high-performance functions:
pip install LinAlgKit numba
import LinAlgKit as lk
import numpy as np
# Create matrices
A = lk.Matrix.from_numpy(np.array([[1.0, 2.0], [3.0, 4.0]]))
# Matrix operations
print(A.determinant()) # -2.0
print(A.T.to_numpy()) # Transpose
# Decompositions
L, U, P = A.lu()
Q, R = A.qr()
# Deep learning functions
x = np.random.randn(100, 10)
output = lk.relu(x)
probs = lk.softmax(x)
loss = lk.cross_entropy_loss(probs, targets)
| Section | Description |
|---|---|
| Getting Started | Installation, basic usage, examples |
| API Reference | Complete API documentation |
| Deep Learning | Activations, losses, normalization |
| Performance | Benchmarks and optimization |
| Release Notes | Version history and changelog |
fast Modulefrom LinAlgKit import fast
# Up to 13x faster with Numba JIT
loss = fast.fast_mse_loss(pred, target)
output = fast.fast_relu(x)
| Function | Speedup |
|---|---|
mae_loss |
13.1x |
mse_loss |
12.0x |
leaky_relu |
4.4x |
gelu |
2.6x |
A.add_(B) # No memory allocation
A.mul_(2.0) # Faster than A = A * 2
MIT License - see LICENSE