I Built EveryO to Understand How Neural Networks Actually Work
Hey everyone! 👋
I'm Krishanth, and I've been spending a lot of time exploring artificial intelligence, neural networks, and the engineering behind deep-learning frameworks.
Something I've always found interesting is what actually happens when we train a neural network.
We write a few lines of Python, define some layers, choose an optimizer, and start training. Eventually, the model begins making predictions.
But what's really happening underneath?
How does a framework calculate gradients? How does it know which parameters to update? What happens inside convolutional layers? And could I implement those things myself?
Those questions led me to start building EveryO.
GitHub Repository: github.com/krishanth7/EveryO
EveryO is an open-source neural computing framework built primarily with Python and NumPy.
It's a project focused on learning, experimentation, and understanding the fundamentals of deep learning.
What is EveryO?
EveryO is a neural-network framework that implements its own tensor operations, automatic differentiation engine, neural-network layers, optimizers, and training utilities.
Rather than depending on PyTorch or TensorFlow for its core gradient calculations, EveryO implements these operations using NumPy.
The project includes:
- Tensor computation and broadcasting
- Reverse-mode automatic differentiation
- Dense neural networks
- Convolutional neural networks
- RNN, LSTM, and GRU architectures
- Attention mechanisms and Transformer encoders
- Optimizers and loss functions
- Model training and evaluation
- Model serialization
- ONNX interoperability
- Profiling and quantization utilities
- Optional CUDA operations
My main goal with EveryO is to make the internal workings of neural-network frameworks easier to explore.
I want developers to be able to open the source code, follow the calculations, and understand how the individual components fit together.
Why Build Another Deep-Learning Framework?
It's a reasonable question.
We already have excellent frameworks like PyTorch, TensorFlow, and JAX.
They're powerful, mature, and supported by large communities.
I'm not trying to replace them.
In fact, working on EveryO has helped me appreciate how much engineering goes into those frameworks.
When you begin implementing even a basic tensor engine, you quickly encounter challenges involving numerical precision, gradient propagation, tensor shapes, memory management, and performance.
And that's before you start building neural-network architectures.
EveryO gives me a place to explore those problems directly.
It's also an opportunity to share what I'm learning through open-source development.
Understanding Automatic Differentiation
One of the most interesting parts of EveryO is its automatic differentiation engine.
Automatic differentiation allows a framework to calculate gradients without requiring developers to manually derive every mathematical expression.
Let's look at a simple example.
import everyo as eo
x = eo.tensor([2.0], requires_grad=True)
y = x * x
y.backward()
print(x.grad)
Output:
[4.]
The mathematical function is:
y = x²
Its derivative is:
dy/dx = 2x
When x = 2, the gradient is 4.
EveryO calculates this gradient through its own autograd implementation.
Of course, real neural networks contain far more operations and parameters.
But the same underlying idea applies.
The framework tracks mathematical operations and propagates gradients backward through the computation graph.
That process is fundamental to training neural networks.
Building a Neural Network with EveryO
Once tensors and automatic differentiation are working, the next step is combining operations into reusable neural-network layers.
Here's a simple feed-forward neural network:
import everyo as eo
model = eo.Sequential(
eo.Linear(64, 128),
eo.ReLU(),
eo.Dropout(0.2),
eo.Linear(128, 10),
)
print(model)
This model contains a linear layer with 128 output units, a ReLU activation, dropout, and a final linear layer with 10 output units.
The layers are connected through Sequential, making the architecture easier to organize.
During training, an optimizer can use the gradients calculated by autograd to update the model's parameters.
It's a relatively small example, but it demonstrates how the framework's components work together.
Exploring Convolutional Neural Networks
I also wanted EveryO to support more than fully connected neural networks.
Convolutional neural networks are particularly interesting because of how they process images.
Instead of treating every pixel independently, convolutional layers apply learnable filters across spatial regions.
These filters can detect patterns that become useful for classification.
EveryO includes convolution and pooling operations, along with examples that visualize their behavior.
The image above shows convolutional filters and the feature maps they produce.
Being able to visualize these intermediate results helps connect the mathematical operations with the behavior of the model.
Training and Evaluating Models
Training a neural network involves more than calculating gradients.
You also need to manage data, calculate losses, update parameters, and evaluate how the model performs.
EveryO includes training utilities for these tasks.
Here's an example of configuring a trainer:
import everyo as eo
model = eo.Sequential(
eo.Linear(64, 128),
eo.ReLU(),
eo.Linear(128, 10),
)
optimizer = eo.Adam(
model.parameters(),
lr=0.005
)
loss_function = eo.CrossEntropyLoss()
trainer = eo.Trainer(
model,
optimizer,
loss_function,
metrics=["accuracy"]
)
# Provide suitable training and validation DataLoaders.
# history = trainer.fit(
# train_loader,
# epochs=25,
# validation_loader=test_loader
# )
The repository includes runnable examples demonstrating the complete training workflow.
It also includes visualization utilities for examining model performance.
Training Curves
Training curves help show whether a model is improving over time.
Confusion Matrix
A confusion matrix helps identify which classes a model predicts correctly and where it makes mistakes.
These visualizations make experiments easier to understand and debug.
Experimenting with Transformers and Attention
As the project expanded, I started exploring sequence models and attention mechanisms.
EveryO includes implementations of RNNs, LSTMs, GRUs, multi-head attention, and Transformer encoder components.
Attention is particularly interesting because it allows a model to relate information across different positions in a sequence.
Here's an attention visualization generated from an EveryO experiment.
Working with these architectures has helped me better understand how different neural-network designs process information.
I still see these implementations primarily as educational and experimental tools rather than replacements for highly optimized production libraries.
Why Numerical Correctness Matters
One lesson from building EveryO is that getting a model to run doesn't necessarily mean its implementation is correct.
A small error in gradient calculations can be difficult to detect.
Sometimes a model will even appear to train while producing incorrect gradients.
That's why numerical validation is an important part of the project.
EveryO includes tests that compare supported gradient calculations against finite-difference approximations.
It also provides optional TensorFlow reference comparisons for selected operations.
These tests help identify mathematical mistakes and implementation regressions.
There's always more validation to do, but correctness is something I want to keep prioritizing.
Getting Started with EveryO
If you'd like to explore the project yourself, you can install it directly from GitHub.
The repository documents support for Python 3.9 through 3.12.
Step 1: Clone the repository
git clone https://github.com/krishanth7/EveryO.git
cd EveryO
Step 2: Create a virtual environment
python -m venv .venv
For Linux or macOS:
source .venv/bin/activate
For Windows PowerShell:
.venv\Scripts\Activate.ps1
Step 3: Install the framework
python -m pip install -e .
Step 4: Check the installation
everyo doctor
Step 5: Run the demonstration
everyo demo
The demo provides a way to explore the framework's training workflow.
If you're interested in the implementation details, I'd recommend starting with the tensor and autograd modules.
Advanced Features and Experiments
EveryO also contains several features beyond its core neural-network functionality.
Optional CUDA Support
The project includes native CUDA components for selected numerical operations.
These require a compatible NVIDIA GPU and development toolchain.
The CUDA implementation is experimental and has not been comprehensively validated across different hardware configurations.
ONNX Integration
EveryO provides tools for exporting supported models to ONNX.
This makes it possible to experiment with interoperability between EveryO and compatible runtimes.
Export support has limitations depending on the architecture and operations involved.
Mixed Precision
The framework includes experimental mixed-precision utilities, including automatic casting and gradient scaling.
Quantization
EveryO contains tools for exploring lower-precision model representations.
Profiling
Profiling utilities help developers inspect execution behavior and identify potential performance bottlenecks.
These features are useful for studying framework engineering, even though they are not intended to match the performance or maturity of established production systems.
What EveryO Is Not
I want to be transparent about the project's limitations.
EveryO is primarily intended for:
- Learning neural-network fundamentals
- Studying automatic differentiation
- Teaching deep-learning concepts
- Small-scale CPU experiments
- Exploring framework architecture
- Numerical research and prototyping
It is not currently a production training runtime.
For large-scale training, extensive GPU acceleration, or production-critical applications, mature frameworks such as PyTorch, TensorFlow, and JAX are generally better choices.
EveryO is still evolving, and some of its advanced capabilities require additional testing and validation.
I believe being clear about those limitations is important when sharing open-source software.
What's Next for EveryO?
There are several areas I'd like to continue improving.
One is performance.
NumPy provides a useful foundation, but there's still a lot to explore around efficient tensor computation and accelerator integration.
Another priority is documentation.
I want the project to be approachable for developers who are curious about neural-network internals but may not have experience building a framework.
I'm also interested in improving examples, expanding tests, and making the contribution process easier.
EveryO is an ongoing learning experience, and I expect the project to continue changing as I explore new ideas.
Open Source and Contributions
EveryO is available under the MIT License.
If you're interested in neural computing, Python, deep learning, or numerical programming, I'd be happy for you to explore the repository.
You don't need to contribute a major feature to get involved.
Bug reports, documentation improvements, tests, suggestions, and code reviews are all valuable.
Here are some useful links:
GitHub Repository
https://github.com/krishanth7/EveryO
Issues and Discussions
https://github.com/krishanth7/EveryO/issues
Contribution Guidelines
https://github.com/krishanth7/EveryO/blob/main/CONTRIBUTING.md
Documentation
https://github.com/krishanth7/EveryO/tree/main/docs
Supporting Open-Source Development
If you find EveryO interesting, there are several ways to support the project.
You can star the repository, share it with other developers, report bugs, or contribute code.
I also have a GitHub Sponsors page for anyone who would like to support my broader work in AI, robotics, and open-source engineering.
Support My Open-Source Work on GitHub Sponsors
There is absolutely no obligation to sponsor.
Even taking the time to explore the repository or provide feedback is appreciated.
Final Thoughts
Building EveryO has been an interesting way to explore the mathematics and engineering behind neural networks.
It has also reminded me how much complexity is hidden behind the APIs we use every day.
There's still a lot I want to learn and improve.
My hope is that EveryO becomes a useful resource for developers who want to understand neural-network frameworks from the inside.
If you've ever wondered how automatic differentiation works, how neural-network layers are implemented, or what goes into building a deep-learning framework, I hope you'll find something interesting in the project.
Feel free to check it out, experiment with the code, and share your thoughts.
Thanks for reading!
Krishanth
Independent Developer | AI Research | Robotics | Open Source
GitHub: https://github.com/krishanth7




Top comments (0)