Skip to content

howl-anderson/tensorweaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

42 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TensorWeaver

TensorWeaver Logo

๐Ÿง  Finally understand how PyTorch really works
Build your own deep learning framework from scratch

PyPI version License GitHub stars Documentation


๐Ÿค” Ever feel like PyTorch is a black box?

# 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 the educational deep learning framework that shows you exactly how PyTorch works under the hood. Built from scratch in pure Python, it demystifies automatic differentiation, neural networks, and optimization algorithms.

Think of it as "PyTorch with the hood open" ๐Ÿ”ง

๐ŸŽ“ Perfect for:

  • CS Students learning machine learning internals
  • Self-taught developers who want to go beyond tutorials
  • ML Engineers debugging complex gradient issues
  • Educators teaching deep learning concepts
  • Curious minds who refuse to accept "magic"

๐Ÿ’ก Pro Tip: Use import tensorweaver as torch for seamless PyTorch compatibility!

โšก Quick Start - See the Magic Yourself

pip install tensorweaver
import tensorweaver as torch  # PyTorch-compatible API!

# Build a neural network (just like PyTorch!)
class SimpleModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = torch.nn.Linear(784, 128)
        self.relu = torch.nn.ReLU()
        self.linear2 = torch.nn.Linear(128, 10)
        
    def forward(self, x):
        x = self.relu(self.linear1(x))
        return self.linear2(x)

model = SimpleModel()

# Train it
loss_fn = torch.nn.MSELoss()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# The difference? You can see EXACTLY what happens inside! ๐Ÿ‘€

๐Ÿš€ Try it live in your browser โ†’

๐Ÿง  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?

๐Ÿญ Industrial Frameworks ๐ŸŽ“ TensorWeaver
โŒ Complex C++ codebase โœ… Pure Python - readable by humans
โŒ Optimized for performance โœ… Optimized for learning
โŒ "Trust us, it works" โœ… "Here's exactly how it works"
โŒ Intimidating for beginners โœ… Designed for education

๐Ÿš€ Key Features

  • ๐Ÿ” Transparent Implementation: Every operation is visible and understandable
  • ๐Ÿ Pure Python: No hidden C++ complexity - just NumPy and Python
  • ๐ŸŽฏ PyTorch-Compatible API: Same interface, easier transition
  • ๐Ÿ“š Educational Focus: Built for learning, not just using
  • ๐Ÿงช Complete Functionality: Autodiff, neural networks, optimizers, ONNX export
  • ๐Ÿ“– Growing Documentation: Clear explanations with working examples

๐ŸŽฎ Learning Path

๐ŸŒฑ Beginner Level

  1. Tensor Basics - Understanding tensors and operations
  2. Linear Regression - Your first neural network
  3. Automatic Differentiation - How gradients are computed (coming soon)

๐ŸŒฟ Intermediate Level

  1. Multi-layer Networks - Building deeper models
  2. Loss Functions & Optimizers - Training dynamics (coming soon)
  3. Model Export - ONNX export and deployment

๐ŸŒณ Advanced Level

  1. Custom Operators - Extending the framework (coming soon)
  2. Performance Optimization - Making it faster (coming soon)
  3. GPU Support - Scaling computations (in development)

๐Ÿ“ Note: Some documentation links are still in development. Check our milestones for working examples!

๐ŸŽฏ Quick Examples

๐Ÿ”ฌ See Automatic Differentiation in Action
import tensorweaver as torch

# Create tensors
x = torch.tensor([2.0])
y = torch.tensor([3.0])

# Forward pass
z = x * y + x**2
print(f"z = {z.data}")  # [10.0]

# Backward pass - see the magic!
z.backward()
print(f"dz/dx = {x.grad}")  # [7.0] = y + 2*x = 3 + 4  
print(f"dz/dy = {y.grad}")  # [2.0] = x
๐Ÿง  Build a Neural Network from Scratch
import tensorweaver as torch

class MLP(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = torch.nn.Linear(784, 128)
        self.relu = torch.nn.ReLU()
        self.fc2 = torch.nn.Linear(128, 10)
        
    def forward(self, x):
        x = self.relu(self.fc1(x))
        return self.fc2(x)

# Every operation is transparent!
model = MLP()
print(model)  # See the architecture

๐ŸŽฏ Why Students Love Learning This Way

Instead of mysterious "black box" operations, TensorWeaver shows you:

  • Transparent code - Every function is readable Python
  • Step-by-step execution - See exactly how gradients flow
  • PyTorch compatibility - Easy transition to production frameworks
  • Educational focus - Built for understanding, not just using

Real testimonials coming as the community grows!

๐Ÿš€ Get Started Now

๐Ÿ“ฆ Installation

# 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
poetry install

๐ŸŽฏ Your Learning Journey Starts Here

  1. ๐Ÿงช Try Examples - Hands-on Jupyter notebooks
  2. ๐ŸŽฎ Interactive Playground - No setup required
  3. ๐Ÿ’ฌ Join Community - Ask questions and share projects
  4. ๐Ÿ“– Read Documentation - Framework overview (expanding soon)

๐Ÿค 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

๐ŸŽ“ Educational Use

Using TensorWeaver in your course? We'd love to help!

Curriculum materials and instructor resources are in development - please reach out if you're interested!

โญ Why Stars Matter

If TensorWeaver helped you understand deep learning better, please consider starring the repository! It helps others discover this educational resource.

GitHub stars

๐Ÿ“„ License

TensorWeaver is MIT licensed. See LICENSE for details.

๐Ÿ™ Acknowledgments

  • Inspired by educational frameworks: Micrograd, TinyFlow, and DeZero
  • Thanks to the PyTorch team for the API design
  • Grateful to all contributors and the open-source community

Ready to peek behind the curtain?
๐Ÿš€ Start Learning at tensorweaver.ai

About

A modern educational deep learning framework for students, engineers and researchers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published