Coeus
Neural network library written in Python.
Coeus is a library for creating and training neural networks written in Python. No NumPy, no nothing. Model parameters are stored in lists. Crazy right?
This is the oldest project I still seem to have source code for, and it will be on my GitHub once it’s been formatted. I wouldn’t recommend using it yourself but if you do anything cool with it I’d love to hear about it.
This project was started the summer before my senior year of high school and continued throughout the following school year. At the time I also hadn’t taken a linear algebra or calculus class so I was feeling my way blindly through the math and trusting a book that I have since lost the link to unfortunately.
This project went through a couple stages:
- hard-coded xor network
- SimpleSig
- Coeus
- Coeus + Ken
XOR #
The hard-coded xor is pretty self explanatory. A XOR is pretty much the simplest problem that isn’t linearly separable that you can solve with a neural network. It takes a whopping 9 parameters.
SimpleSig #
Once that was working I wanted to be able to flexibly define networks so I made a library where you could define networks with a given shape. I called it SimpleSig because the only activation function it supported was a sigmoid. At this point I could freely create fully connected feed forward networks of any shape and this library even included functionality to save and load models. It did unfortunately do this by dumping all of the model parameters into a single json document which obviously doesn’t scale well but these networks were all small and I was but a wee lad at the time. After verifying the code worked with another xor, I used SimpleSig to make a project very similar to AsDroid where a network controlled a blue ball that could shoot a little red ball ata a big green ball! The player (blue) could move left and right at the bottom of the screen and shoot a tiny red ball at a falling green target to score points. The network had 3 inputs (px, tx, ty), 1 hidden layer with a few neurons (<10), and 3 output neurons (left, right, shoot). Each output was thresholded at 0.5 to take the given action. This setup was trained sort of unsupervised. The training worked by recording state action pairs in a buffer as the code ran (keeping track of roughly the previous 2 seconds worth of frames) and whenever the network scored a point it would be trained for one epoch on the buffer. This worked quite well considering the simplicity of the setup. Later the code was also modified to limit the agent’s lives (lost by missing a target) and to progressively shrink the target throughout a run.
Coeus #
From there I learned about different activation functions and started on a new library which each layer could have different activation functions. This became Coeus. Other than the activation functions it was largely the same but eventually had a lot more training functionality built in. I didn’t do anything memorable with this library besides adding functionality.
Ken #
Eventually after some attempts at image recognition I added support for convolutional layers to Coeus which was implemented in a project I called Ken at the time. I did some simple shape recognition with this but again nothing too memorable.
State Of The Project #
As of now (early 2026) the project sits long abandoned as I mostly use PyTorch now (though I will need to learn some JAX basics for a current project which I’m excited about). It might be fun to go back and see how painfully slow it would be to train an MNIST classifier with this old project. If I ever do I will modify this write up with a link to however that turned out.