Note that the images must be drawn with white on black. If you use black on white, it the accuracy becomes terrible. This is a good very example of brittleness in AI systems!
We can try the code adapted from thenewstack.io/tutorial-using-a-pre-trained-onnx-model-for-inferencing/ at python/onnx_cheat/infer_mnist.py:and it works pretty well! The protram outputs:as desired.
cd python/onnx_cheat
./infer_mnist.py lenet.onnx infer_mnist_9.png
9
We can also try with images directly from Extract MNIST images.and the accuracy is great as expected.
for f in /home/ciro/git/mnist_png/out/testing/1/*.png; do echo $f; infer.py $f ; done
These are the best articles ever authored by Ciro Santilli, most of them in the format of Stack Overflow answers.
Ciro posts update about new articles on his Twitter accounts.
A chronological list of all articles is also kept at: Section "Updates".
Some random generally less technical in-tree essays will be present at: Section "Essays by Ciro Santilli".
- Trended on Hacker News:
- CIA 2010 covert communication websites on 2023-06-11. 190 points, a mild success.
- x86 Bare Metal Examples on 2019-03-19. 513 points. The third time something related to that repo trends. Hacker news people really like that repo!
- again 2020-06-27 (archive). 200 points, repository traffic jumped from 25 daily unique visitors to 4.6k unique visitors on the day
- How to run a program without an operating system? on 2018-11-26 (archive). 394 points. Covers x86 and ARM
- ELF Hello World Tutorial on 2017-05-17 (archive). 334 points.
- x86 Paging Tutorial on 2017-03-02. Number 1 Google search result for "x86 Paging" in 2017-08. 142 points.
- x86 assembly
- What does "multicore" assembly language look like?
- What is the function of the push / pop instructions used on registers in x86 assembly? Going down to memory spills, register allocation and graph coloring.
- Linux kernel
- What do the flags in /proc/cpuinfo mean?
- How does kernel get an executable binary file running under linux?
- How to debug the Linux kernel with GDB and QEMU?
- Can the sys_execve() system call in the Linux kernel receive both absolute or relative paths?
- What is the difference between the kernel space and the user space?
- Is there any API for determining the physical address from virtual address in Linux?
- Why do people write the
#!/usr/bin/env
python shebang on the first line of a Python script? - How to solve "Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)"?
- Single program Linux distro
- QEMU
- gcc and Binutils:
- How do linkers and address relocation works?
- What is incremental linking or partial linking?
- GOLD (
-fuse-ld=gold
) linker vs the traditional GNU ld and LLVM ldd - What is the -fPIE option for position-independent executables in GCC and ld? Concrete examples by running program through GDB twice, and an assembly hello world with absolute vs PC relative load.
- How many GCC optimization levels are there?
- Why does GCC create a shared object instead of an executable binary according to file?
- C/C++: almost all of those fall into "disassemble all the things" category. Ciro also does "standards dissection" and "a new version of the standard is out" answers, but those are boring:
- What does "static" mean in a C program?
- In C++ source, what is the effect of
extern "C"
? - Char array vs Char Pointer in C
- How to compile glibc from source and use it?
- When should
static_cast
,dynamic_cast
,const_cast
andreinterpret_cast
be used? - What exactly is
std::atomic
in C++?. This answer was originally more appropriately entitled "Let's disassemble some stuff", and got three downvotes, so Ciro changed it to a more professional title, and it started getting upvotes. People judge books by their covers. notmain.o 0000000000000000 0000000000000017 W MyTemplate<int>::f(int) main.o 0000000000000000 0000000000000017 W MyTemplate<int>::f(int)
- IEEE 754
- What is difference between quiet NaN and signaling NaN?
- In Java, what does NaN mean?
Without subnormals: +---+---+-------+---------------+-------------------------------+ exponent | ? | 0 | 1 | 2 | 3 | +---+---+-------+---------------+-------------------------------+ | | | | | | v v v v v v ----------------------------------------------------------------- floats * **** * * * * * * * * * * * * ----------------------------------------------------------------- ^ ^ ^ ^ ^ ^ | | | | | | 0 | 2^-126 2^-125 2^-124 2^-123 | 2^-127 With subnormals: +-------+-------+---------------+-------------------------------+ exponent | 0 | 1 | 2 | 3 | +-------+-------+---------------+-------------------------------+ | | | | | v v v v v ----------------------------------------------------------------- floats * * * * * * * * * * * * * * * * * ----------------------------------------------------------------- ^ ^ ^ ^ ^ ^ | | | | | | 0 | 2^-126 2^-125 2^-124 2^-123 | 2^-127
- Computer science
- Algorithms
- Is it necessary for NP problems to be decision problems?
- Polynomial time and exponential time. Answered focusing on the definition of "exponential time".
- What is the smallest Turing machine where it is unknown if it halts or not?. Answer focusing on "blank tape" initial condition only. Large parts of it are summarizing the Busy Beaver Challenge, but some additions were made.
- Algorithms
- Git
| 0 | 4 | 8 | C | |-------------|--------------|-------------|----------------| 0 | DIRC | Version | File count | ctime ...| 0 | ... | mtime | device | 2 | inode | mode | UID | GID | 2 | File size | Entry SHA-1 ...| 4 | ... | Flags | Index SHA-1 ...| 4 | ... |
tree {tree_sha} {parents} author {author_name} <{author_email}> {author_date_seconds} {author_date_timezone} committer {committer_name} <{committer_email}> {committer_date_seconds} {committer_date_timezone} {commit message}
- How do I clone a subdirectory only of a Git repository?
- Python
- Web technology
- OpenGL
- What are shaders in OpenGL?
- Why do we use 4x4 matrices to transform things in 3D?
- Image Processing with GLSL shaders? Compared the CPU and GPU for a simple blur algorithm.
- Node.js
- Ruby on Rails
- POSIX
- What is POSIX? Huge classified overview of the most important things that POSIX specifies.
- Systems programming
- What do the terms "CPU bound" and "I/O bound" mean?
+--------+ +------------+ +------+ | device |>---------------->| function 0 |>----->| BAR0 | | | | | +------+ | |>------------+ | | | | | | | +------+ ... ... | | |>----->| BAR1 | | | | | | +------+ | |>--------+ | | | +--------+ | | ... ... ... | | | | | | | | +------+ | | | |>----->| BAR5 | | | +------------+ +------+ | | | | | | +------------+ +------+ | +--->| function 1 |>----->| BAR0 | | | | +------+ | | | | | | +------+ | | |>----->| BAR1 | | | | +------+ | | | | ... ... ... | | | | | | +------+ | | |>----->| BAR5 | | +------------+ +------+ | | | ... | | | +------------+ +------+ +------->| function 7 |>----->| BAR0 | | | +------+ | | | | +------+ | |>----->| BAR1 | | | +------+ | | ... ... ... | | | | +------+ | |>----->| BAR5 | +------------+ +------+
- Electronics
- Computer security
- Media
- How to resize a picture using ffmpeg's sws_scale()?
- Is there any decent speech recognition software for Linux? ran a few examples manually on
vosk-api
and compared to ground truth.
- Eclipse
- Computer hardware
- Scientific visualization software
- Numerical analysis
- Computational physics
- Register transfer level languages like Verilog and VHDL
- Android
- Debugging
- Program optimization
- Data
- Mathematics
- Section "Formalization of mathematics": some early thoughts that could be expanded. Ciro almost had a stroke when he understood this stuff in his teens.
- Network programming
- Physics
- Biology
- Quantum computing
- Bitcoin
- GIMP
- Home DIY
- China
Things that are not nice such as:
- Taboola, Outbrain, and other chumbox
- BLOBs
- Europe cookie law
- adhesive inside mobile phones and more generally, planned obsolescence
- Jupyter Notebook
- typographical characters that look like ASCII ones, but are not the ASCII ones, e.g. typographical quotes, em-dash. The non-breaking hyphen is not even whitespace, and by def Why not stick to ASCII when ASCII is good enough?
- excessive encapsulation
- replacement of master and slave terminology from technology
- mailing lists. And to add insult to injury, HTML on mailing list messages instead of plaintext.
- blank lines in code added by people trying to increase clarity, especially when there is already indentation for that. Every blank line must be preceded by a line comment explaining what the following block is about, or removed.
- messaging software that force you to have a mobile phone
- advertisements by telephone/SMS
- "state" such as global variables and object members, long live functional programming?
- mosquitoes, the only intrinsically bad thing about tropical countries
- projects with slow compilation times
- Microsoft Windows
- the 2019 Chinese government
- e-learning websites that only allows verified teachers to write content. Cowards who can't handle ranking algorithms.
- domain-specific language
- a build system without an out-of-tree option
- non-linear Git history: stackoverflow.com/questions/20348629/what-are-advantages-of-keeping-linear-history-in-git
- visual programming languages like Scratch. Waste of time. Text programming languages are already equally as visual due to indentation:Just make good serious gamedev libraries and integrated development environments for those real languages instead.
if x == 0: x = 1
- software that prevents you from running as root. Let me fucking shoot myself in the foot if I want to. It is better than having to deal with your hand holding bullshit, which is done in a different way for every project. E.g.: stackoverflow.com/questions/17466017/how-to-solve-you-must-not-be-root-to-run-crosstool-ng-when-using-ct-ng/53099177#53099177
- Medium
- luxury goods
- euphemism
- closed access academic journals are evil
- websites without OAuth
- shower room without a window to the exterior (mould!!!)
- single programs with their interface split across multiple windows, e.g. GIMP, ZynAddSubFX
- graphical user interfaces
- logograms
- infinitesimals. Just use limit instead, please
- country
- knowledge olympiads
- programming languages without a decent dominating package system
- closed source offline software used by millions
- exams
- security through obscurities
- dots in Gmail address
- things in websites that look like links, and behave like links, but don't let you middle click to open them on a separate tab
- K-pop
- numerical computing language
- fiscal paradises
- when the front-end of an website changes an important permanent state, but the URL does not change
- splash screens: you should show boot messages so that people will know what to Google for when things fail. Do you think computer newbies will be afraid and have nightmares?
- milk chocolate: why would you eat that instead of dark chocolate if you are older than 10?
- to talk about something without giving the real name to not scare off the audience
- mathematical symbol that looks like a Greek letter but isn't. Or perhaps mathematical notation in general
- when more than two people gather to play a board game or video game, and two or more people start chatting on and on about random subjects rather than concentrating on the game
- watching television while eating. Same for reading, or doing basically anything else but eat. The only acceptable activity is talking relaxedly, not about work.
- noises coming out of your bicycle. It is so hard to find where they come to fix them!!!
- code drop
- private cars as opposed to public transport. As a cyclist, you can just see the effect that large roads have on nearby areas, it just destroys nature.
- closed standards
- double consonants that make no difference to sound. Dilema? Dilemma? Dillema? Dillemma? Please!
- social media websites that show stuff from people you don't follow when you don't explicitly want that, including things which are not ads, just random suggestions. Twitter starting being like that cirac a 2022. Facebook got worse around that time. It is a constant fight against those stupid websites.
- socks with short legs that don't protect your ankle/lower calf from cold/scratches/dirt, e.g. liner socks
- Presta valves. Why would such a flimsy tech have become so popular compared to the infinitely superior Schrader!