Daily Archives: February 24, 2024

TMDNE

TMDNE: This Mathematician Does Not Exist

It’s like the math is the seeds or DNA and the code is the fertile ground and the sun shines, or in our case electricity flows to CPUs and GPUs.

Ever pondered the possibilities when algorithms dabble in the divine art of mathematics? Prepare yourselves for TMDNE – where Stable Diffusion meets the blackboard of the mind! 🧮🤯

Inspired by the brilliance of projects like “This Waifu Does Not Exist” (TWDNE) by Gwern Branwen, TMDNE takes a quantum leap into the realm of imaginary mathematicians. These aren’t your conventional number crunchers; they’re the brainchildren of algorithms, immersed in the ethereal dance of imaginary theorems and proofs. 🎨➗

Much like TWDNE introduced us to AI-generated characters that captured our otaku hearts, TMDNE invites you to witness the magic of machine learning as it conjures up mathematical maestros who never attended a single conference. 🤓📚

Get ready for a symphony of computational creativity, where algorithms showcase their virtuosity in crafting mathematicians who not only ponder the mysteries of prime numbers but might just solve the Riemann Hypothesis over a cup of virtual coffee. ☕📏

Embark on this intellectual odyssey where Stable Diffusion meets the abstract canvas of mathematical imagination, proving that in the world of artificial intelligence, even mathematicians can be a product of algorithmic brilliance! 🔢🤖

 

Grid Search in Stable Diffusion

The images in the following video were created by doing a grid search with Stable Diffusion, with slight variations of words in the prompt and scanning the guidance scale. The seed value remained constant. The images were also audited manually for obvious artifacts and flaws.

Finally a slideshow was created by using the following ffmpeg command:

ffmpeg -framerate 1/3 -pattern_type glob -i "image\([0-9]*\).png" -c:v libx264 -r 30 -pix_fmt yuv420p slideshow.mp4

This results in a slide show with a change every three seconds on the images.

The Idea

Math -> AI -> Imaginary Mathematicians

OK, AI is math really, a bunch of chain rule linkage and matrix multiplies for the most part and to make it do something useful the math gets worked into code as the substrate. It’s like the math is the seeds or DNA and the code is the fertile ground and the sun shines, or in our case electricity flows to CPUs and GPUs. In 2024, it’s gotten really good. imagine generation that is. I did some AI image modification years ago but, Stable Diffusion has gone way far, fast. So wouldn’t it be interesting and humorous to generate images of math being worked on, by a mathematician generated by AI. As can be seen from the images, this points out a weakness too. People, it kind of nails it, backgrounds too. Text and numbers, not so much. I’ll be interested in seeing it nail this too, only a matter of time.

Grid Search & Ground Rules

As an AI researcher, I am always interested in pushing the boundaries and grid search is something that is a normal event for me. I’ve played with Stable Diffusion for quite a while and I was interested in seeing what a semi-serious grid search would reveal now that it is seriously capable of generating graphics. I decided to stick with images that are not ‘fantasy’ or too enhanced to keep them real looking so that they are easier to judge.Keeping the ‘look’ in the same zone also helped keep some degree of uniformity but, Stable Diffusion varies the image within a range that seems to work well.

Yet another sidequest

This started as a bit of a sidequest as I am working on a project called TinyMath that is all about identifying how small a GPT model can get and get a passing grade for math. This way it is possible to score objectively and see how model size and loss stack up against the ground truth of taking an ‘exam’. I just happened to create an image using Stable Diffusion of Misato Katsuragi from Neon Genesis Evangelion at a blackboard working out some math when I was pondering this, kind of a nod to TWDNE on a document I wrote on makemore. That combined with an image that I saw in 2020 when my partner Renee was searching for a new hair style, was another inspiration. The image below only shows a partial view of the woman and I often wondered if the other views were out there somewhere, or could AI come close to generating the other views.

The Two Images that got TMDNE going

Misato Katsuragi as a Math Teacher
Misato Katsuragi as a Math Teacher
Layered Stacked Bob for thick hair. Great style and color.
Layered Stacked Bob for thick hair. Great style and color.

 

Notes & References

TWDNE

“This Waifu Does Not Exist” (TWDNE) is a project created by Gwern Branwen. It involves the generation of images of fictional characters using Generative Adversarial Networks (GANs). GANs are a type of artificial intelligence algorithm that can generate realistic-looking images based on patterns learned from a dataset.

In the case of TWDNE, the GANs are trained on a dataset of anime-style characters, and the output is entirely computer-generated images of characters that do not exist in reality. The term “waifu” is a romanization of the Japanese word for “wife” and is often used in fandom to refer to fictional characters, especially those from anime and manga, for whom someone has a strong emotional attachment.

It’s worth noting that the images generated by TWDNE are not real individuals, but rather creations of the algorithm based on the patterns it learned during training. The project is an interesting example of the capabilities of AI in generating realistic-looking content.

Prompts, Seed and Range for Guidance

Styles Tried:

sai-photograpic
None
cinematic-default

Seed: 52794693

Positive Prompts:
young woman with short red hair in graduated bob style teaching math at a blackboard

young woman with short red hair in posh bob style teaching math at a blackboard

young woman with short red hair in victoria beckham posh bob style teaching math at a blackboard

young woman with short red hair stacked  with very short stacked layers in the back   teaching math at a blackboard

young woman with short red hair stacked  with very short stacked layers in the back   teaching math at a blackboard

Negative Prompt:
bangs curls

…. bangs were sometimes screwed up and curls caused artifacts, so these were filtered on.

Guidance range: 5-18.5 ( found to be best)

Additionally, the results were judged by looking at the images for excess artifacts or distortions such as missing fingers, awkward postures and anything else unrealistic beyond the fact that Stable Diffusion is still limited in terms of representing numbers and letters.