https://github.com/howl-anderson/tensorweaver
A modern educational deep learning framework for students, engineers and researchers
https://github.com/howl-anderson/tensorweaver
deep-learning deep-learning-framework educational-project machine-learning machine-learning-framework
Last synced: about 1 month ago
JSON representation
A modern educational deep learning framework for students, engineers and researchers
- Host: GitHub
- URL: https://github.com/howl-anderson/tensorweaver
- Owner: howl-anderson
- License: mit
- Created: 2025-04-06T18:13:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-21T02:47:14.000Z (6 months ago)
- Last Synced: 2026-03-17T11:19:47.984Z (2 months ago)
- Topics: deep-learning, deep-learning-framework, educational-project, machine-learning, machine-learning-framework
- Language: Jupyter Notebook
- Homepage: https://www.tensorweaver.ai
- Size: 3.27 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TensorWeaver
π§ A transparent, debuggable deep learning framework
PyTorch-compatible implementation with full visibility into internals
---
## π€ **Ever feel like PyTorch is a black box?**
```python
# What's actually happening here? π€·ββοΈ
loss.backward() # Magic?
optimizer.step() # More magic?
```
**You're not alone.** Most ML students and engineers use deep learning frameworks without understanding the internals. That's where TensorWeaver comes in.
## π― **What is TensorWeaver?**
TensorWeaver is a **transparent deep learning framework** that reveals exactly how PyTorch works under the hood. Built from scratch in pure Python, it provides complete visibility into automatic differentiation, neural networks, and optimization algorithms.
> **Think of it as "PyTorch with full transparency"** π§
### **π Perfect for:**
- **ML Engineers** debugging complex gradient issues and understanding framework internals
- **Researchers** who need full control over their implementations
- **Software Engineers** building custom deep learning solutions
- **Technical Teams** who need to understand and modify framework behavior
- **Developers** who refuse to accept "black box" solutions
> **π‘ Pro Tip**: Use `import tensorweaver as torch` for seamless PyTorch compatibility!
## β‘ **Quick Start - See the Magic Yourself**
```bash
pip install tensorweaver
```
```python
import tensorweaver as torch # PyTorch-compatible API!
# 1. Prepare Data (y = 2x)
x = torch.tensor([[1.0], [2.0], [3.0], [4.0]])
y = torch.tensor([[2.0], [4.0], [6.0], [8.0]])
# 2. Define Model
model = torch.nn.Linear(1, 1)
# 3. Train
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
criterion = torch.nn.MSELoss()
print("Training...")
for epoch in range(100):
# Forward
y_pred = model(x)
loss = criterion(y_pred, y)
# Backward
optimizer.zero_grad()
loss.backward()
optimizer.step()
if epoch % 20 == 0:
print(f"Epoch {epoch}: Loss = {loss.item():.4f}")
# 4. Result
# The difference? You can see EXACTLY what happens inside! π
print(f"\nPrediction for x=5.0: {model(torch.tensor([[5.0]])).item():.4f} (Expected: 10.0)")
```
π **[Try it live in your browser β](https://mybinder.org/v2/gh/howl-anderson/tensorweaver/HEAD?urlpath=%2Fdoc%2Ftree%2Fmilestones%2F01_linear_regression%2Fdemo.ipynb)**
## π§ **What You'll Learn**
### **π¬ Deep Learning Internals**
- How automatic differentiation works
- Backpropagation step-by-step
- Computational graph construction
- Gradient computation and flow
### **π οΈ Framework Design**
- Tensor operations implementation
- Neural network architecture
- Optimizer algorithms
- Model export (ONNX) mechanisms
## π **Why TensorWeaver?**
| π **Production Frameworks** | π¬ **TensorWeaver** |
|------------------------------|---------------------|
| β Complex C++ codebase | β
Pure Python - fully debuggable |
| β Optimized for speed only | β
Optimized for understanding and modification |
| β "Trust us, it works" | β
"Here's exactly how it works" |
| β Black box internals | β
Complete transparency and control |
### **π Key Features**
- **π Transparent Implementation**: Every operation is visible, debuggable, and modifiable
- **π Pure Python**: No hidden C++ complexity - full control over the codebase
- **π― PyTorch-Compatible API**: Drop-in replacement with complete visibility
- **π οΈ Engineering Excellence**: Clean architecture designed for understanding and extension
- **π§ͺ Complete Functionality**: Autodiff, neural networks, optimizers, ONNX export
- **π Production Ready**: Export trained models to ONNX for deployment
## πΊοΈ **Technical Roadmap**
### **π§ Core Components**
1. **[Tensor Operations](milestones/01_linear_regression/)** - Fundamental tensor mechanics and operations
2. **[Linear Models](milestones/01_linear_regression/demo.ipynb)** - Basic neural network implementation
3. **Automatic Differentiation** - Gradient computation engine *(coming soon)*
### **ποΈ Advanced Architecture**
4. **[Deep Networks](milestones/03_multilayer_perceptron/)** - Multi-layer perceptron and complex architectures
5. **Optimization Algorithms** - Advanced training techniques *(coming soon)*
6. **[Model Deployment](milestones/02_onnx_export/)** - ONNX export for production systems
### **β‘ Performance & Extensions**
7. **Custom Operators** - Framework extension capabilities *(coming soon)*
8. **Performance Engineering** - Optimization techniques *(coming soon)*
9. **Hardware Acceleration** - GPU computation support *(in development)*
> **π Note**: Some documentation links are still in development. Check our [milestones](milestones/) for working examples!
## π **Get Started Now**
### **π¦ Installation**
```bash
# Option 1: Install from PyPI (recommended)
pip install tensorweaver
# Option 2: Install from source (for contributors)
git clone https://github.com/howl-anderson/tensorweaver.git
cd tensorweaver
uv sync --group dev
```
### **π― Quick Start Guide**
1. **[π Browse Examples](milestones/)** - Working implementations and demos
2. **[π Try Online](https://mybinder.org/v2/gh/howl-anderson/tensorweaver/HEAD)** - Browser-based environment
3. **[π¬ Community Forum](https://github.com/howl-anderson/tensorweaver/discussions)** - Technical discussions and support
4. **[π Documentation](https://tensorweaver.ai)** - Complete API reference *(expanding)*
## π€ **Contributing**
TensorWeaver thrives on community contributions! Whether you're:
- π **Reporting bugs**
- π‘ **Suggesting features**
- π **Improving documentation**
- π§ͺ **Adding examples**
- π§ **Writing code**
We welcome you! Please open an issue or submit a pull request - contribution guidelines coming soon!
## π **Resources**
- **π [Documentation](https://tensorweaver.ai)** - Framework overview
- **π¬ [Discussions](https://github.com/howl-anderson/tensorweaver/discussions)** - Community Q&A
- **π [Issues](https://github.com/howl-anderson/tensorweaver/issues)** - Bug reports and feature requests
- **π§ [Follow Updates](https://github.com/howl-anderson/tensorweaver)** - Star/watch for latest changes
## β **Why Stars Matter**
If TensorWeaver helped you debug, understand, or build better models, please consider starring the repository! It helps other engineers discover this transparent framework.
## π **License**
TensorWeaver is MIT licensed. See [LICENSE](LICENSE) for details.
## π **Acknowledgments**
- Inspired by transparent implementations: **Micrograd**, **TinyFlow**, and **DeZero**
- Thanks to the PyTorch team for the elegant API design
- Grateful to all contributors and the open-source community
---
Ready for complete transparency in deep learning?
π Explore TensorWeaver at tensorweaver.ai