It trains the LeNet-5 neural network on the MNIST dataset from scratch, and afterwards you can give it newly hand-written digits 0 to 9 and it will hopefully recognize the digit for you.
Ciro Santilli created a small fork of this repo at lenet adding better automation for:
- extracting MNIST images as PNG
- ONNX CLI inference taking any image files as input
- a Python
tkinterGUI that lets you draw and see inference live - running on GPU
Install on Ubuntu 24.10 with:We use our own
sudo apt install protobuf-compiler
git clone https://github.com/activatedgeek/LeNet-5
cd LeNet-5
git checkout 95b55a838f9d90536fd3b303cede12cf8b5da47f
virtualenv -p python3 .venv
. .venv/bin/activate
pip install \
Pillow==6.2.0 \
numpy==1.24.2 \
onnx==1.13.1 \
torch==2.0.0 \
torchvision==0.15.1 \
visdom==0.2.4 \
;pip install because their requirements.txt uses >= instead of == making it random if things will work or not.On Ubuntu 22.10 it was instead:
pip install
Pillow==6.2.0 \
numpy==1.26.4 \
onnx==1.17.0 torch==2.6.0 \
torchvision==0.21.0 \
visdom==0.2.4 \
;Then run with:This script:
python run.pyIt throws a billion exceptions because we didn't start the Visdom server, but everything works nevertheless, we just don't get a visualization of the training.
The terminal outputs lines such as:
Train - Epoch 1, Batch: 0, Loss: 2.311587
Train - Epoch 1, Batch: 10, Loss: 2.067062
Train - Epoch 1, Batch: 20, Loss: 0.959845
...
Train - Epoch 1, Batch: 230, Loss: 0.071796
Test Avg. Loss: 0.000112, Accuracy: 0.967500
...
Train - Epoch 15, Batch: 230, Loss: 0.010040
Test Avg. Loss: 0.000038, Accuracy: 0.989300One of the benefits of the ONNX output is that we can nicely visualize the neural network on Netron:
People will be more interested if they see how the stuff they are learning is useful.
Achieving novel results for science, or charitable goals (e.g. creating novel tutorials) are also equaly valid. Note that those also imply you being able to make a living out of something, just that you will be getting donations and not become infinitey rich. and that is fine.
Projects don't need of course to reach the level of novel result. But they must at least aim at moving towards that.
This is one of the greatest challenges of education, since a huge part of the useful information is locked under enterprise or military secrecy, or even open academic incomprehensibility, making it nearly to impossible for the front-line educators to actually find and teach real use cases.
In degrees Celsius:
- 25+
- 18-25
- "dhb Aeron Short Sleeve Jersey"
- XGC Men's Cycling Shorts
- 2020-04 Giro Rumble VR Off Road Shoe
- 15-18:
- "dhb Aeron Short Sleeve Jersey"
- "dhb Lightweight Mesh Long Sleeve Base Layer"
- XGC Men's Cycling Shorts
- 2020-04 Giro Rumble VR Off Road Shoe
- 10-15:
- dhb Classic Thermal Bib Tights 10 and under. TODO this is a bit too warm for the upper range, need something more intermediate
- "dhb Lightweight Mesh Long Sleeve Base Layer"
- Castelli Perfetto RoS Long Sleeve - Cycling jersey. TODO this is a bit too warm for the upper range, need something more intermediate
- "Karrimor X Lite Run Black Headband"
- "Nike academy hyperwarm gloves"
- "Nevica Skuff". A bit too hot on upper range, but easy to take off.
- 0-10:
- dhb Merino Long Sleeve Base Layer
- Castelli Perfetto RoS Long Sleeve - Cycling jersey
- dhb Classic Thermal Bib Tights 10 and under
- dhb Dorica MTB Shoe (2020-12)
- "Karrimor X Lite Run Black Headband". Head a bit cold on lower range.
- "dhb Neoprene Nylon Overshoes". Feet a bit cold on lower range.
- "Extremities XDRY gloves". Hands a bit cold on lower range.
- "Nevica Skuff"
Subset generators:
- github.com/mf1024/ImageNet-datasets-downloader generates on download, very good. As per github.com/mf1024/ImageNet-Datasets-Downloader/issues/14 counts go over the limit due to bad multithreading. Also unfortunately it does not start with a subset of 1k.
- github.com/BenediktAlkin/ImageNetSubsetGenerator
Unfortunately, since ImageNet is a closed standard no one can upload such pre-made subsets, forcing everybody to download the full dataset, in ImageNet1k, which is huge!
How hard could it be? You just have to learn the encoding of the neural spine/eyes/ear, add an invasive device that multiplexes it, and then the benefits could be mind blowing.
The side effects of ambitious goals are often the most valuable thing achieved by
Ciro Santilli 40 Updated 2025-07-16
A quote by Ciro's Teacher R.:
Sometimes, even if our end goals are too far from reality, the side effects of trying to reach them can have meaningful impact.
If the goals are not ambitious enough, you risk not even having useful side effects so show in the end!
By doing the prerequisites of the impossible goal you desire, maybe the next generation will be able to achieve it.
This is basically why Ciro Santilli has contributed to Stack Overflow, which has happened while was doing his overly ambitious projects and notice that all kinds of basic pre-requisites were not well explained anywhere.
This is especially effective when you use backward design, because then you will go "down the dependency graph of prerequisites" and smoothen out any particularly inefficient points that you come across.
There are of course countless examples of such events:
- youtu.be/qrDZhAxpKrQ?t=174 Blitzscaling 11: Patrick Collison on Hiring at Stripe and the Role of a Product-Focused CEO by Greylock (2015)
The danger of this approach is of course spending too much time on stuff that will not be done enough times to be worth it, as highlighted by several xkcds:
xkcd 1319: Automation
. Source. Non-technical skills were moved to: Ciro Santilli's skills.
This has not been updated since 2016 after Ciro got a job, because it is too hard to put a number on any skill.
What really matters are the most important projects done by Ciro Santilli.
KaTeX is automatically used in OurBigBook Markup.
Ciro like to interpret this as him having "a creative personality" with the tradeoff of generally not being amazing at his well defined jobs.
Ciro is obsessed by that which is "quirky". This also often has a parallel with "naughty". He often fantasizes about an imaginary parallel between that feeling and Jobs and Wozniak's blue box.
Ciro's natural fight-or-flight response is to hide in a little corner, and try to solve the problem out. Then get distracted and start procrastinating. And then he tries to solve the unsolvable. Someone Ciro barely new once told him quite correctly:This is also perhaps why Ciro likes prison decks in Magic: The Gathering. You just sit on your corner, making yourself safer and safer, until the opponent can't do you any harm and concedes.
In the event of war, you would be the type that hides away and makes the bombs.
There are of course infinitely many videos on the "entrepreneurial mindset" online, and it is impossible to know if they are bullshit, or if everyone just feels like that, but OK, just let Ciro feels that he is specially creative will you?
Creative people continuously step outside of the domain of evaluation structures
If you are creative and you go off on tangents all the time, there's some probability that one of those tangents is going to be exactly what is needed at the time, and you are going to become hyper-successful as a consequence[but the probability of that being the right time and place for the idea is extraordinarily low]The sensible thing to tell anybody is "you shouldn't do it, your probability of success is so low, that its better to just to something sensible".
Ciro also one heard a story, likely apocryphal, but still nonetheless resonated with him, that went something like this (TODO find source, Google wasn't helping, stuff that happened before website as usual):
The newly hired manager of some subsection of DuPont (or some other gigantic chemical company) came into the office, and found a chemical engineer, completely drunk in the middle of the day.Outraged, the manager searched for this colleagues who explained.Ah, don't mind John (or some other name), the guy invented Teflon (or some other substance) which accounted for 20% of our revenue last year. Even if he does not do anything else in his entire career, his salary won't make any difference compared to those gains, and we take the chance that he might invent something else later.
Ciro likes this story because although he does not drink, he feels his work mind works in a related way. Often, when there is something really hard he knows needs doing he hides, and distracts himself with less important tasks, or by watching crap on YouTube, because he knows that the hard task will hurt his mind. Then one day he wakes up and says: OK, fuck it, let's do it, and does it.
Once Ciro got a performance review from a colleague that said:This is closely related to effortless effort.
If Ciro spent as much effort on his job as he does on side projects, he'd be the most amazing worker.
Yes, low conscientiousness, give it to me.
And I am not and never have been 'familiar' scene from The Big Short (2015)
. Source. Ciro's ideal city to live in contains the following in order of decreasing importance:
- high tech
- beach and warm weather, influenced by Ciro's love for the City of Santos where he once lived
- enough recent Chinese immigrants to sustain Chinese cuisine
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 3. Visual Studio Code extension installation.Figure 4. Visual Studio Code extension tree navigation.Figure 5. Web editor. You can also edit articles on the Web editor without installing anything locally.Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.Video 4. OurBigBook Visual Studio Code extension editing and navigation demo. Source. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact








