Categories
Artificial Intelligence Math Programming

You want sum of this? (or: What does the Σ symbol mean?)

If you’ve been perusing LinkedIn or a programming site like Lobste.rs, you may have seen that the professors who teach Stanford’s machine learning course, CS229, have posted their lecture notes online, a whopping 226 pages of them! This is pure gold for anyone who wants to get up to speed on machine learning but doesn’t have the time — or $55K a year — to spend on getting a Bachelor’s computer science degree from “The Cardinal.”

Or at least, it seems like pure gold…until you start reading it. Here’s page 1 of Chapter 1:

This is the sort of material that sends people running away screaming. For many, the first reaction upon being confronted with it would be something like “What is this ℝ thing in the second paragraph? What’s with the formulas on the first page? What the hell is that Σ thing? This is programming…nobody told me there would be math!”

If you’re planning to really get into AI programming and take great pains to avoid mathematics, I have good news and bad news for you.

First, the bad news: A lot of AI involves “college-level” math. There’s linear algebra, continuous functions, statistics, and a dash of calculus. It can’t be helped — machine learning and data science are at the root of the way artificial intelligence is currently being implemented, and both involve number-crunching.

And now, the good news: I’m here to help! I’m decent at both math and explaining things.

Over the next little while, I’m going to post articles in a series called Math WTF that will explain the math that you might encounter while learning AI and doing programming. I’m going to keep it as layperson-friendly as possible, and in the end, you’ll find yourself understanding stuff like the page I posted above.

So welcome to the first article in the Math WTF series, where I’ll explain something you’re likely to run into when reading notes or papers on AI and data science: the Σ symbol.

Σ, or sigma

As explained in the infographic above, the letter Σ — called “sigma” — is the Greek equivalent of our letter S. It means “the sum of a series.”

The series in question is determined by the things above, below, and to the right of the Σ:

  • The thing to the right of the Σ describes each term in the series: 2n + 3, or as we’d say in code, 2 * n + 3.
  • The thing below the Σ specifies the index variable — the variable we’ll use for counting terms in the series (which in this case is n) — and its initial value (which in this case is 1).
  • The thing above the Σ specifies the final value of the index variable, which in this case is 4.

So you can read the equation pictured above as “The sum of all the values of 2n + 3, starting at n = 1 and ending with n = 4.”

If you write out this sum one term at a time, starting with n = 1 and ending with n = 4, you get this…

((2 * 1) + 3) + ((2 * 2) + 3) + ((2 * 3) + 3) + ((2 * 4) + 3)

…and the answer is 32.

You could express this calculation in Python this way…

# Python 3.11

total = 0
for n in range(1, 5):
    total += 2 * n + 3

Keep in mind that range(1, 5) means “a range of integers starting at 1 and going up but not including 5.” In other words, it means “1, 2, 3, 4.”

There’s a more Pythonic way to do it:

# Python 3.11

sum([2 * n + 3 for n in range(1, 5)])

This is fine if you need to find the sum of a small set of terms. In this case, we’re looking at a sum of 4 terms, so generating a list and then using the sum function on it is fine. But if we were dealing with a large set of terms — say tens of thousands, hundreds of thousands, or more — you might want to go with a generator instead:

# Python 3.11

sum((2 * n + 3 for n in range(1, 5)))

The difference is the brackets:

  • [2 * n + 3 for n in range(1, 5)] — note the square brackets on the outside. This creates a list of 4 items. Creating 4 items doesn’t take up much processing time or memory, but creating hundreds of thousands could.
  • (2 * n + 3 for n in range(1, 5)) — note the round brackets on the outside. This creates a generator that can be called repeatedly, creating the next item in the sequence each time that generator is called. This takes up very little memory, even when going through a sequence of millions, billions, or even trillions of terms.

Keep an eye on this blog! I’ll post more articles explaining math stuff regularly.

Worth reading

For more about generators in Python, see Real Python’s article, How to Use Generators and yield in Python.

Categories
Artificial Intelligence Editorial

The bias in AI *influencers*

One of the challenges that we’ll face in AI is bias — not just in the data, but the influencers as well. Consider this tweet from @OnPageLeads:

@OnPageLeads’ tweet.
Tap to view the original tweet.

Take a closer look at the original drawing made by the child…

The original child’s drawing of the hand. Make note of the skin tone.
Tap to view the source.

…and then the AI-generated photorealistic image:

The AI’s photorealistic rendering of the child’s drawing.
Again, make note of the skin tone.
Tap to view the source.

Tech influencer Robert Scoble, societally-blind gadget fanboy that he is, was quick to heap praise on the tweet. Thankfully, he was quickly called out by people who saw what the problem was:

Robert Scoble’s poorly-considered response, followed by some righteous retorts.
Tap to view the original tweet.

Of course, this kind of structural racism is nothing new to us folks of color. The problem is criticism of this kind often gets shut down. The most egregious case of this was Google’s firing of AI ethicist Timnit Gebru, who has warned time and again that unmoderated AI has the power to enhance societal racism.

You may have heard of recent ex-Googler Geoffrey Hinton, who’s making headlines about sounding the alarm about possible existential threats about AI. He was oddly silent when Google was firing Gebru and others for saying that AI could harm marginalized people.

In fact, he downplayed their concerns in this CNN interview:

“Their concerns aren’t as existentially serious as the idea of these things getting more intelligent than us and taking over.”

Geoffrey Hinton, CNN, May 2, 2023.

My only reply to Hinton’s remark is this:

The Audacity of the Caucasity

For more about Timnit Gebru and her concerns about AI — especially a lack of focus on ethics related to it — check out this podcast episode of Adam Conover’s Factually, featuring Gebru and computational linguistics professor Emily Bender:

Categories
Artificial Intelligence Current Events Video What I’m Up To

My interviews on artificial intelligence and ChatGPT on local news

Chris Cato and Joey deVilla on Fox 13 News Tampa. The “lower third” caption reads “Benefits and concerns of artificial intelligence.”

In case you missed it, here’s that interview I did for the 4:00 p.m. news on FOX 13 Tampa on Monday, April 10th with anchor Chris Cato:

It’s a follow-up to this piece that FOX 13 did back in March:

In that piece, I appeared along with:

  • Local realtor Chris Logan, who’s been using ChatGPT to speed up the (presumably tedious) process of writing up descriptions of houses for sale
  • University of South Florida associate director of the School of Information Systems and Management Triparna de Vreede, who talked about its possible malicious uses and what might be possible when AI meets quantum computing.
  • IP lawyer Thomas Stanton, who talked about how AI could affect jobs.

All of this is a good preamble for the first Tampa Artificial Intelligence Meetup session that I’ll be running — it’s happening on Wednesday, May 31st!

Categories
Artificial Intelligence Humor The Street Finds Its Own Uses For Things

AI ad of the moment: “Beer Party in Hell”

Hot on the heels of the AI-generated pizza ad Pepperoni Hug Spot, here’s a beer commercial from an artifical intelligence that clearly has never been invited to a back yard party:

https://www.youtube.com/watch?v=Geja6NCjgWY

There seem to be two versions of this ad online. One has Smash Mouth’s All Star as its backing track, while the other one (which is presented above) is on YouTube and is backed by generic southern rock-esque music — presumably to avoid getting a copyright “strike”.

As with Pepperoni Hug Spot, the visuals in the beer ad are located deep inside the uncanny valley:

This is how best friends drink a beer.
Tap to view the weirdness at full size.
Clearly the AI has never shotgunned a beer before.
Tap to view the weirdness at full size.
To an AI, beer and fire are pretty much the same thing.
Tap to view the weirdness at full size.
“I’m drinking from a bottle! No — a can! Wait — a bottle can!”
Tap to view the weirdness at full size.
Multiple fingers and a cap/hair blend that doesn’t exist outside of “JoJo’s Bizarre Adventure.”
Tap to view the weirdness at full size.
“Don’t stop…be-lieeeeving…”
Tap to view the weirdness at full size.
“I need more lighter fluid on the grill.”
Tap to view the weirdness at full size.
“NOW it’s a party!”
Tap to view the weirdness at full size.
“Is anyone gonna help clean up?”
Tap to view the weirdness at full size.
Categories
Artificial Intelligence Deals Programming Reading Material

Humble Bundle’s deal on No Starch Press’ Python books

Banner for Humble Bundle’s No Starch Press Python book bundle

I love No Starch Press’ Python books. They’re the textbooks I use when teaching the Python course at Computer Coach because they’re easy to read, explain things clearly, and have useful examples.

And now you can get 18 of their Python ebooks for $36 — that’s $2 each, or the cost of just one of their ebook, Python Crash Course, Third Edition!

Check out the deal at Humble Bundle, and get ready to get good at Python! At the time of writing, the bundle will be available for 20 more days.

Banner for Tampa Artificial Intelligence Meetup

Consider these books recommended reading for the Tampa Artificial Intelligence Meetup, which is now under my management, and holding a meeting later this month!

Categories
Artificial Intelligence Humor The Street Finds Its Own Uses For Things

AI ad of the moment: “Pepperoni Hug Spot”

Actual still from the AI-generated ad.
It’s so, SO wrong.

Good news, creatives — if this completely AI-generated TV ad for a fictitious pizza place is any indication, you won’t be replaced by artificial intelligence just yet.

Just watch it. It’s so…off. The people’s eyes are off-kilter, the chef’s arm appears to be on fire, and the scenes of people eating pizza slices are so off that they will haunt my dreams from the next week.

Pepperoni Hug Spot is a TV ad created by a YouTuber (or group of YouTubers) going by the name “Pizza Later” using the following combination of AI tools:

My favorite Twitter response to the ad comes from none other than Pizza Hut:

Of course, this being the age of Late-Stage Capitalism, PizzaLater has quickly created a site for Pepperoni Hug Spot, where you can buy merch.

Categories
Artificial Intelligence Editorial

Computing innovations happen every 13 years, and we’re at the start of a new one

Infographic titled “Every 13 years, an innovation changes computing forever.” The infographic shows “The Mother of All Demos (1968),” “IBM PC (1981),” “Mosaic and Netscape Navigator (1993/1994),” “iPhone (2007/2008),” and “GPT-3 (2020/2022)”.
Spread this idea and share this infographic!
Tap to view at full size.

Almost exactly three years ago and about a month into the pandemic, Startup Digest Tampa Bay published my article where I suggested that the 2020 pandemic might be hiding some world-changing innovations that we didn’t notice because of everything going on, just as the 2008 downturn did.

The book “Thank You for Being Late,” by Thomas Friedman

My article, titled Reasons for startups to be optimistic, was based on journalist Thomas Friedman’s theory: that 2007 was “one of the single greatest technological inflection points since Gutenberg…and we all completely missed it.” It’s an idea that he put forth in What the hell happened in 2007?, the second chapter of his 2016 book, Thank You for Being Late.

In case you’re wondering what the hell happened around 2007:

  • The short answer is “in the tech world, a lot.”
  • The medium-sized answer is this list: Airbnb, Android, the App Store, Bitcoin, Chrome, data bandwidth dropped in cost and gained in speed, Dell’s return, DNA sequencing got much cheaper, energy tech got cheaper, GitHub, Hadoop, Intel introduce non-silicon material into its chips, the internet crossed a billion users, the iPhone, Kindle, Macs switched to Intel chips, Netflix, networking switches jumped in speed and capacity, Python 3, Shopify, Spotify, Twitter, VMWare, Watson, the Wii, and YouTube.
  • You’ll find the long, detailed answer in my article. Go ahead, read it. What happened in 2007 and 2008 will astonish you.

It’s hard to spot a “golden age” when you’re living in it, and it may have been even more difficult to do so around 2007 and 2008 because of the distraction of the 2008 financial crisis.

In 2020 — 13 years after 2007 — we had the lockdowns and a general feeling of anxiety and isolation. I was about a week into unemployment when Murewa Olubela and Alex Abell approached me with an opportunity to write an article for Startup Digest Tampa Bay.

I took the optimistic approach, my preferred approach to life, and wrote about how there could very well be world-changing developments happening at that moment, and that we might not notice them because we were dealing with COVID-19, improvising masks and PPE, hoarding toilet paper and Clorox wipes, and binge-watching Tiger King.

A lit “Edison”-style lightbulb.

When ChatGPT was released in late November 2022, I showed it to friends and family, telling them that its underlying “engine” had been around for a couple of years. The GPT-3 model was released in 2020, but it went unnoticed by the world at large until OpenAI gave it a nice, user-friendly web interface.

That’s what got me thinking about my thesis that 2020 might be the start of a new era of initially-unnoticed innovation. I started counting backwards: 2007 is 13 years before 2020. What’s 13 years before 2007?

Netscape Navigator icon.

1994. I remember that year clearly — I’d landed a job at a CD-ROM development shop, and was showing them something I’d seen at the Crazy Go Nuts University computer labs that had just made its way to personal computers: the browser, and more specifically, Netscape Navigator. What’s 13 years before 1994?

Original IBM PC.

1981. That’s the year the IBM PC came out. While other desktop computers were already on the market — the Apple ][, Commodore PET, TRS-80 — this was the machine that put desktop computers in more offices and homes than any other. What’s 13 years before 1981?

Photo of Douglas Englebart from “The Mother of All Demos,” with the text “DEMO” below it, in the style of Shepard Fairey’s “HOPE” posters.
Creative Commons image by Jeremy Keith. Tap to see the source.

1968. You don’t have any of the aforementioned innovations without the Mother of All Demos: Douglas Englebart’s demonstration of what you could do with computers, if they got powerful enough. He demonstrated the GUI, mouse, chording keyboard, word processing, hypertext, collaborative document editing, and revision control — and he did it Zoom-style, using a remote video setup!

With all that in mind, I created the infographic at the top of this article, showing the big leaps that have happened every 13 years since 1968.

If you’re feeling bad about having missed the opportunities of the desktop revolution, the internet revolution, or the smartphone revolution, consider this: It’s 1968, 1981, 1994, and 2007 all over again. We’re at the start of the AI revolution right now. What are you going to do?

Worth watching

The Mother of All Demos (1968): What Douglas Englebart demonstrates is everyday stuff now, but back when computers were rare and filled whole rooms, this was science fiction stuff:

The iPhone Stevenote (2007): Steve Jobs didn’t just introduce a category-defining device, he also gave a master class in presentations:

What the hell happened in 2007? (2017): Thomas Friedman puts a chapter from his book into lecture form and explains why 2007 may have been the single greatest tech inflection point:

Here’s the money quote from his lecture:

I think what happened in 2007 was an explosion of energy — a release of energy — into the hands of men, women, and machines the likes of which we have never seen, and it changed four kinds of power overnight.

It changed the power of one: what one person can do as a maker or breaker is a difference of degree; that’s a difference of kind. We have a president in America who can sit in his pajamas in the White House and tweet to a billion people around the world without an editor, a libel lawyer or a filter. But here’s what’s really scary: the head of ISIS can do the same from Raqqa province in Syria. The power of one has really changed.

The power of machines have changed. Machines are acquiring all five senses. We’ve never lived in a world where machines have all five senses. We crossed that line in February 2011, on of all places, a game show in America. The show called Jeopardy, and there were three contestants. Two were the all-time Jeopardy champions, and the third contestant simply went by his last name: Mr. Watson. Mr. Watson, of course, was an IBM computer. Mr. Watson passed on the first question, but he buzzed in before the two humans on the second question. The question was “It’s worn on the foot of a horse and used by a dealer in a casino.” And in under 2.5 second, Mr. Watson answered in perfect Jeopardy style, “What is a shoe?” And for the first time, a cognitive computer figured out a ton faster than a human. And the world kind of hasn’t been the same since.

It’s changed the power of many. We, as a collective, because we’ve got these amplified powers now, we are now the biggest forcing function on and in nature — which is why the new geological era is being named for us: the anthropocene.

And lastly, it changed the power of flows. Ideas now flow and circulate and change, at a pace we’ve never seen before. Six years ago, Barack Obama said marriage is between a man and a woman. Today, he says, bless it so, in my view marriage is between any two people who love each other. And he followed Ireland in that position! Ideas now flow and change and circulate at a speed never seen before.

Well, my view is that these four changes in power: they’re not changing your world; they’re reshaping your world, the world you’re going to go into. And they’re reshaping these five realms: politics, geopolitics, the workplace, ethics, and community.

Worth attending

Banner graphic for the Tampa Artificial Intelligence Meetup.

Yup, I’m tooting my own horn here, but that’s one of the reasons why Global Nerdy exists! I’m the new organizer of Tampa Bay Artificial Intelligence Meetup, and it’s restarting with a number of hands-on workshops.