Monthly Archives: February 2024

Hacker Cat

Using AWK to pull data from a field within a text file

Intelligence is the power which gives us the ability to distinguish when we are not conscious.

# awk -F” ” ‘{print $11}’ pressure-delta.txt
tail -1 $PLOTTABLE_DIR/$PRESSURE_DELTA_TAIL_FILE > $PLOTTABLE_DIR/pressure-delta-tail-one-line.txt

# Use awk with -F” “, which uses space as field seperator.
# pressure delta in inHg is in the 11th field.
# Multiply by 1000 because bash does not do floating point math natively and we want to compare so use milli-inHg to do the bash math.
# Operate on the file $PLOTTABLE_DIR/pressure-delta-tail-one-line.txt

pressure_delta=`awk -F” ” ‘{print $11*1000}’ $PLOTTABLE_DIR/pressure-delta-tail-one-line.txt`

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.

 

 

Buddigar

Buddigar: Stable Confusion

Humor is the weapon of self-control.

Budgierigar
Budgierigar

While playing around with Stable Diffusion, I realized that I must have misspelled “Budgerigar” and was surprised to see the monstrous images that it generated. Perhaps I accidentally typed “Buddigar” or some other variation, resulting in the strange images below. Some of them resemble monsters, while others appear to be stores from a distant land outside of the USA.

These images fall into the uncanny valley of creepiness. For instance, I heard on a Lex Fridman podcast that image generators sometimes struggle with creating realistic facial expressions. It’s fascinating to observe what Stable Diffusion produces when prompted to generate an image of a person with a surprised expression. Although the results can be unsettling and bizarre, they’re also quite amusing, like this one….

OMG, a Buddigar!!!!!
OMG,I spot a Buddigar!!!!!

Buddigars

The first one is my favorite in terms of shock and awe.

Buddigar: It's like Golem's Pet.
Buddigar: It’s like Golem’s Pet.

Buddigar tale by ChatGPT (mostly, just with a bit of prompting and edits)

There is a mischievous creature named Buddigar. It’s small and furry, with sharp claws and bright, beady eyes that seemed to sparkle with mischief. Buddigar loves nothing more than causing trouble, and it has a talent for doing so in the most unexpected ways.

If you can’t find your keys, Buddigar is probably to blame. It has a habit of sneaking into people’s pockets and snatching whatever shiny object catches its eye. It wasn’t that Buddigar has any use for these trinkets – it simply enjoys hoarding them, like a dragon with its treasure.

And if your computer is running slow, you could bet that Buddigar had something to do with it. It has a knack for hiding files, moving icons, and generally wreaking havoc on any device it comes across. Even the most tech-savvy of users are no match for Buddigar’s cunning ways.

But Buddigar’s mischief isn’t limited to material possessions. It has a strange talent for causing physical ailments, too. If you have a pain in your hip, for instance, you could be sure that Buddigar has something to do with it. It’s not that Buddigar means to hurt anyone – it simply enjoys the chaos that its actions cause.

The funny thing is, Buddigar doesn’t try to hide its misdeeds. When caught in the act, it simply grunts and declares its mischievous intent proudly. “Buddigar!” it exclaims, with a mischievous twinkle in its eye. “Buddigar take keys! Buddigar slow computer! Buddigar make hip hurt!” And then it scampers away, leaving behind a trail of chaos and confusion.

Despite its mischievous nature, however, Buddigar is impossible to hate. There is just something endearing about its playful antics, and the way it seemed to revel in the chaos it caused. Even Gollum, the famously twisted and corrupted creature from Lord of the Rings, would have adored Buddigar’s mischievous ways. It is so ugly it’s almost gone full circle to cute in an uncanny way.

And so, Buddigar continues to roam the land, causing trouble wherever it goes. Some curse its name, while others simply laugh and shake their heads in amusement. But love it or hate it, there was no denying that Buddigar is one of a kind – a little creature with  a talent for mischief that it’s unmatched by any other.

 

More Buddigars…