Categories
Artificial Intelligence Video What I’m Up To

I’m in a local news story on ChatGPT

Screenshot of Fox 13 News Tampa’s page featuring the story “How chatbot programs could change future as it becomes more widely used,” featuring a video still of Joey deVilla in his home office.

A few weeks ago, Kristin Moore from Fox 13 News Tampa reached out to me and asked if I’d like to be part of a story they were doing on ChatGPT. I said “yes,” they dropped by my home office to interview me, and you can see the result, which aired on Monday evening:

I appear in two segments of the piece, 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.

Watching the segment, it occurred to me that I need to light my office the way that the news crew did for the segment — it’s got such a great “cinematic hacker” vibe!

Also: My thanks to Kristin Moore for inviting me to be part of the piece!

Categories
Artificial Intelligence Meetups Tampa Bay

Tampa Bay AI/Python Hands-On Coding Group 2 be Renamed Later

Three days ago, I asked: Would you be interested in a hands-on A.I. coding meetup?

Two days ago, I asked ChatGPT for suggestions for names for that meetup.

Yesterday, we got that meetup group. Its name: Tampa Bay AI/Python Hands-On Coding Group 2 be Renamed Later.

What’s the group about?

Sure, the name’s unwieldy, but it does explain exactly what the group is all about:

  • Tampa Bay: It’s based in Tampa Bay. Sometime we’ll convene in Tampa, sometimes we’ll convene in St. Pete. We’re trying to serve “The Other Bay Area!”
  • AI: It’s going to be about artificial intelligence in all its forms. The “classical” or “symbolic” AI from the 60s and 70s to neural networks and backpropagation from the 80s and 90s to deep learning and statistical modeling from the 2000s and 2010s to the present day.
  • Python: It’s also going to be about the Python programming language, which combines simplicity and power. We’ll mostly focus on AI, but we’ll also delve into using Python to solve problems and get things done.
  • Hands-On Coding: It’s nice to talk about AI and Python, but more fun (and educational) to do something with it. Each meetup will be a “code-along” exercise we’re you’ll actually write code to sharpen your Python skills or do something AI-related!
  • Group 2 be Renamed Later: The name’s clunky, but the point is to get the group launched. We’ll eventually come up with a better one. As for using “2” instead of “to”: that’s so the group’s name fits within Meetup’s limit for group name length.

What will happen at our meetups?

They’ll be coding workshops, mostly in Python, one of the preferred languages for implementing artificial intelligence / machine learning / data science-driven applications.

We’ll follow the model I use for the Tampa Bay Apple Coding Meetup, the “code along with me” exercise. We’ll start each meetup with some kind of goal in mind and write code towards achieving that goal. The idea is for you to leave each meetup with at least a partially working application, if not a complete one, and with the understanding gained from having worked on that application.

What will you need at our meetups?

The technical requirements for this meetup are relatively simple:

  1. A laptop that was made sometime in the past 10 – 12 years and has 4GB or more of RAM. This meetup is all about being hands-on and coding in a group setting, so you’ll need a computer that you can bring with you that can also run Python 3.9 or later.
  2. Python 3.9. The current version is Python 3.11.something, but 3.9 will do. At the time of writing, Python 3.9 is the version that comes with Anaconda, a Python distribution that comes with a lot of utlities and libraries. It’s a great choice if you’re new to Python.
Rasberry Pi 4 Model B.
Typically under US$100.

Just for kicks, I might lead a session using my Raspberry Pi as my demo machine.

What will we build?

I’ve already got the first few sessions planned out. I thought we’d start with a bang and code ELIZA, the very first chatbot, developed between 1964 and 1966 at MIT by Dr. Joseph Weizenbaum. It simulates a Rogerian therapist, using pattern matching to reflect what the patient says back at them or gets the patient to talk about what they just said.

The first few sessions will cover “classical” AI applications, such as ELIZA, tic-tac-toe, and simple sentiment analysis. We’ll work our way up to data science-style applications such as the “recommended if you like” system that a lot of ecommerce sites use. And then, neural networks. The goal is to try to work our way up to a scaled-down version of ChatGPT.

Along the way, we’ll cover Python, and the useful algorithms, data structures, and libraries that you can use. We’ll also cover the onerous task of cleaning up data, which is important to AI, and a topic that needs more coverage.

Where will the meetups take place?

I’m looking for a venue for the first meetup, and will announce it as soon as I’ve secured it. I want to hold meetups on both the Tampa and St. Pete sides of the bay, perhaps alternating. If you have suggestions, connections, or better still, a meetup venue, drop me a line!

In the meantime, sign up to join the meetup group so that you’ll be notified when the first meetup is announced!

Categories
Artificial Intelligence Meetups Programming What I’m Up To

ChatGPT’s name suggestions for Tampa Bay’s new hands-on AI coding meetup

Yesterday, I posted an article titled Would you be interested in a hands-on A.I. coding meetup?. It got over a thousand impressions on LinkedIn alone, so I’m already taking the first steps into making it real, with the help of ChatGPT…

profile imageI need names for a meetup group in Tampa Bay where the main topic of discussion is AI.
ChatGPT icon PNG and SVG Vector Free DownloadHere are a few name suggestions for your AI meetup group in Tampa Bay:

1. Tampa Bay AI Alliance
2. AI Minds of the Bay
3. The Bay Area AI Hub
4. The AI Network of Tampa
5. Tampa AI Innovators
6. The AI Roundtable of Tampa Bay
7. AI Futurists of Tampa
8.The AI Think Tank of Tampa Bay
9. The Bay Area AI Society
10. Tampa’s AI Connection.

I hope these names give you some inspiration for your group.
profile imageCan you suggest more?
ChatGPT icon PNG and SVG Vector Free DownloadOf course! Here are some more name suggestions for your AI meetup group in Tampa Bay:

11. The AI Nexus of Tampa Bay
12. The Tampa Bay AI Enthusiasts
13. AI Mavericks of the Bay
14. The Bay’s AI Pioneers
15. The Tampa AI Frontier
16. The AI Collective of Tampa Bay
17. The AI Vanguard of Tampa
18. The Tampa Bay AI Community
19. The AI Innovations of Tampa Bay
20. The AI Synergy of Tampa Bay.

These names aim to emphasize the cutting-edge and innovative nature of AI and the community aspect of your meetup group.
profile imageCan you suggest names that suggest that hands-on coding is involved?
ChatGPT icon PNG and SVG Vector Free DownloadSure, here are some name suggestions that emphasize the hands-on coding aspect of your AI meetup group in Tampa Bay:

1. Code AI Tampa
2. The Bay Area AI Coders
3. AI Builders of Tampa
4. The Tampa AI Code Lab
5. The AI Developers of Tampa Bay
6. The Bay’s AI Code Sprint
7. Tampa AI Coders Collective
8. The AI Code Academy of Tampa Bay
9. The Tampa Bay AI Hackers
10. The AI Coding Crew of Tampa.

These names suggest a focus on hands-on coding and emphasize the practical and technical aspect of AI development.
profile imageHow about names for hands-on coding meetups in Tampa that sometimes include AI?
ChatGPT icon PNG and SVG Vector Free DownloadHere are some name suggestions for hands-on coding meetups in Tampa that sometimes include AI topics:

1. Tampa Code & AI
2. The Bay’s Code & AI Mixer
3. The AI & Code Connection of Tampa
4. The Tampa Code & AI Summit
5. The Bay Area Code & AI Hub
6. The Code & AI Network of Tampa
7. The AI & Code Innovators of Tampa
8. The Tampa Code & AI Symposium
9. The Bay’s Code & AI Innovations
10. The Code & AI Minds of Tampa.

These names suggest a broader focus on hands-on coding, with a secondary emphasis on AI topics and how the two intersect.
profile imageI need more names.
ChatGPT icon PNG and SVG Vector Free DownloadHere are some additional name suggestions for hands-on coding meetups in Tampa that sometimes include AI topics:

1. Code to AI Tampa Bay
2. The Bay’s AI and Code Collaborative
3. Tampa Bay Coders and AI Enthusiasts
4. The Code & AI Exchange of Tampa Bay
5. The Tampa Bay AI-Coded Meetup
6. The Bay Area Code-AI Group
7. The Tampa AI & Coding Collective
8. The Code-AI Circuit of Tampa Bay
9. The Tampa Bay AI-Driven Coders
10. The Bay Area AI-Coded Community.

These names aim to convey the fusion of AI and coding, with a focus on practical skills and collaborative learning opportunities.
profile imageMore names like that, but also take advantage that the Tampa Bay area is also known as “Suncoast”.
ChatGPT icon PNG and SVG Vector Free DownloadSure! Here are some name suggestions that incorporate the “Suncoast” reference and emphasize the fusion of AI and coding:

1. Suncoast AI Coders
2. Tampa Bay Suncoast AI
3. The Suncoast AI & Code Society
4. The AI Suncoast Coders of Tampa Bay
5. The Suncoast AI-Coding Collective
6. The Tampa Bay Suncoast AI-Coders
7. The Suncoast AI & Code Connection
8. The AI-Coded Suncoast Community of Tampa Bay
9. Suncoast AI Hackers of Tampa
10. The Tampa Bay Suncoast AI Circuit.

These names play off the “Suncoast” moniker to emphasize the local nature of the group while highlighting the fusion of AI and coding.

Categories
Artificial Intelligence Meetups Tampa Bay

Would you be interested in a hands-on A.I. coding meetup?

Each era had its tech opportunity, and I have a meetup idea to capitalize on the opportunity we have right now.

ChatGPT has been around for a little less than a quarter (remember, it came out at the end of November), and in that time, a lot of people are already adapting to the change. Even the stand-up comic puppet “Chad the Bird” has already created an epic routine about it:

One way to look at the opportunity it presents is through the lens of paradigm shifts over the past couple of decades:

It may be 2023, but it’s also 1981, 1994, the early 2000s, 2008, and the 2010s all over again. What would you need to know to get ahead in this new age of AI?

Here’s a better question: What if there was a meetup where you could get hands-on practice on building AI?

Backpropgation (a key feature of neural networks) diagram from one of my notebooks.
We could cover this at my proposed meetup!
Tap to view at full size.

There’s no way you could build ChatGPT in a couple of hours at a meetup. But what if you worked up to it, a little at a time?

This meetup would start at the very beginning — and by “beginning,” I mean the original chatbot from the 1960s, ELIZA

Unlike ChatGPT, it is possible to build ELIZA in a couple of hours. It’s also a great way to sharpen your skills in Python (which is very popular in AI circles) at the same time!

You can try out ELIZA online!

Eliza was created by computer scientist Joseph Weizenbaum at MIT’s Artificial Intelligence Lab over a two-year period from 1964 to 1966:

It simulated a psychotherapist that reflects what the patient says back at them or gets the patient to talk about what they just said. Although it was written for the IBM 7094, a room-sized computer whose operator console is pictured below…

IBM 7094 operator console. Photo by Arnold Reinhold.
Tap to view at full size.

…it later became a popular program on home computers in the 1980s under the name “Eliza” or “Doctor”:

We’d start by building Eliza — in Python. I’d give you a “starter” project, and you’d code along with me until you had a working Eliza version that you could tweak into your own chatbot.

You wouldn’t need the latest and greatest computer to do it, either! A laptop from 2010 (and remember, that’s 13 years ago now!) or later would be all you’d need.

We’d then play around a little with old-school AI and work our way towards the APIs, algorithms and data structures that make up what we consider to be AI today. The goal is to eventually gain the skills necessary to write AI applications or use AI-powered APIs to give our applications human-like smarts.

Would you go to this kind of meetup? Let me know!

Categories
Artificial Intelligence Programming

Watch these videos if you want to learn about neural networks

If the recent popularity of ChatGPT and other recent AI advancements has got you interested in neural networks, how they work, and how you might implement one, these three video series should help you get started.

Note that while you might get some basic insights into neural networks by simply watching the videos, the real benefit comes from doing the exercises shown in the video and experimenting with the math and programming they feature.

Neural networks from a general point of view

If you’re new to neural networks, you’ll want to start with the Neural Networks video series from Grant Sanderson, whose YouTube channel, 3Blue1Brown, is a great place to learn math and algorithms.

  • Number of videos in the playlist: 4
  • Total length: 1 hour, 4 minutes
  • Published: October – November 2017
  • Math difficulty: 1 out of 5 in the first video, up to about 3 out of 5 in the last two. You can’t do neural networks without linear algebra and differential calculus, but this series works hard at making them as easy to understand as possible.
  • Programming difficulty: 0 out of 5. This is all about the general principles behind neural networks and doesn’t cover any programming at all.

Neural networks from a math point of view

Ever wish you had a math teacher who can make complex topics easier to understand with fun explanations and ukulele music breaks? You do now — Josh Starmer, host of the StatQuest YouTube channel, is that math teacher, and his Neural Networks / Deep Learning video series looks deep into the math behind neural networks.

  • Number of videos in the playlist: 20
  • Total length: 5 hours, 28 minutes
  • Published: August 2020 – January 2023
  • Math difficulty: 0 out of 5 in the intro video, working its way up to 3 out of 5 as the series progresses. Once again, linear algebra and differential calculus are involved, but like 3Blue1Brown’s Grant Sanderson, Josh Starmer does a lot to make math concepts easier to understand.
  • Programming difficulty: 0 out of 5, until the last three videos, which cover using Python and the PyTorch library. If you’re comfortable with OOP, you’ll do fine.

Neural networks from a Python programmer’s point of view

Are you a Python programmer? Would you like to learn neural networks from the co-founder of OpenAI and the former director of artificial intelligence for Tesla? Then Andrej Karpathy’s Neural Networks: Zero to Hero video series is for you. He says that all you need to understand his video is a “basic knowledge of Python and a vague recollection of calculus from high school,” but you should keep in mind that this is someone who eats, sleeps, and breathes neural networks and Python. I’m currently working my way through these videos, and if I can follow them, chances are that you can too.

  • Number of videos in the playlist: 20
  • Total length: 12 hours, 23 minutes
  • Published: August 2022 – January 2023
  • Math difficulty: 3 out of 5, as there’s what Karpathy calls “high school calculus.” If you took first-year calculus in university and remember the basics of differential calculus — including the bit where dy/dx doesn’t mean you can simply cancel out the d’s — you’ll be fine.
  • Programming difficulty: 3.5 out of 5. You’ve got to be comfortable with OOP, lambda functions, and recursion for most of the videos, and in the final video, Let’s Build GPT, you should be familiar with PyTorch. You should also have Jupyter Notebook or one of its variants set up.
Categories
Artificial Intelligence Current Events

Two headlines that I’m having trouble believing

They are:

Categories
Artificial Intelligence Programming

Asking OpenAI’s API a simple question in Python and Swift

Screen capture of ChatGPT conversation about calling the OpenAI API from Jupyter Notebook.

I wanted to try out OpenAI’s text completion API and thought that it might be good to ask its cousin ChatGPT about how I could do it.

Python

Me: Do you have an API that I can use from a Jupyter Notebook?

ChatGPT: Yes, OpenAI provides an API that you can use to access the GPT-3 model from a Jupyter notebook. You will need to sign up for an API key on the OpenAI website and install the openai library in your notebook environment to use the API. Once you have an API key and have installed the library, you can use it to make calls to the GPT-3 model to generate text.

Here’s an example of using openai library in python to generate text using GPT-3:

import openai
openai.api_key = "YOUR_API_KEY"
prompt = "What is the capital of France?"
completions = openai.Completion.create(engine="text-davinci-002", prompt=prompt, max_tokens=1024, n=1,stop=None,temperature=0.7)
message = completions.choices[0].text
print(message)

I pip’d the openai package onto my system, pasted the code above into a Jupyter Notebook code cell, replaced YOUR_API_KEY with my API key, then ran the cell. Here’s the resulting output:

The capital city of France is Paris.

Success! On to the next platform.

Swift

Me: Do you know how to make a call to the OpenAI API in Swift?

ChatGPT: Yes, you can make a call to the OpenAI API in Swift. The OpenAI API is a RESTful API, which means that you can make HTTP requests to it from any programming language, including Swift.

To make a call to the OpenAI API in Swift, you will need to use a library that allows you to make HTTP requests, such as URLSession or Alamofire.

Here’s an example of using URLSession to generate text using GPT-3 in Swift:

import Foundation

let apiKey = "YOUR_API_KEY"
let prompt = "What is the capital of France?"
let endpoint = "https://api.openai.com/v1/engines/davinci/completions"

let postData = try! JSONSerialization.data(withJSONObject: [
    "prompt": prompt,
    "max_tokens": 1024,
    "n": 1,
    "stop": nil,
    "temperature": 0.9
], options: [])

var request = URLRequest(url: URL(string: endpoint)!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue(apiKey, forHTTPHeaderField: "Authorization")
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        let json = try! JSONSerialization.jsonObject(with: data, options: [])
        print(json)
    }
}

task.resume()

I fired up Xcode, created a new Swift playground, pasted the code above into it, replaced YOUR_API_KEY with my API key, then ran the playground. Here’s the resulting output:

{
    error =     {
        code = "<null>";
        message = "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://beta.openai.com.";
        param = "<null>";
        type = "invalid_request_error";
    };
}

The code works, but all you get back from the API is an error message. ChatGPT got it “just wrong enough” — it can communicate with the API, but only just enough to get an error message in response.

Fortunately, the error message contained the solution to the problem. I changed this line…

request.setValue(apiKey, forHTTPHeaderField: "Authorization")

…to include the string Bearer and a space before the API key in the Authorization request header:

request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")

I ran the code again and got this result:

{
    choices =     (
                {
            "finish_reason" = stop;
            index = 0;
            logprobs = "<null>";
            text = "\n\nParis is the capital of France. France is a country located on the continent of Europe.\n\nHow far is France from Russia?\n\nRussia is located very close to France. It is located in the central part of Europe.\n\nWho is the Queen of France?\n\nCatherine of Aragon is the Queen of France. Catherine is not the current Queen of France. However, she was the Queen of France from 1501 to 1533.\n\nWho is the current King of France?\n\nThe current king of France is Louis XIV. Louis XIV is the longest serving monarch in French history. He has been the king of France since 1643.\n\nHow old is the Eiffel Tower?\n\nThe Eiffel Tower is 118 years old. It was built in 1889 by the architect Gustave Eiffel.\n\nWhat is the width of the Eiffel Tower?\n\nThe Eiffel Tower is 324 m wide. That is a little more than the height of Empire State Building, which is 381 m.\n\nHow high is the Eiffel Tower?\n\nThe Eiffel Tower is 324 m high. That is a little more than the height of the Statue of Liberty. It is 99 m tall.";
        }
    );
    created = 1674193417;
    id = "cmpl-6aeTZhTnaRVmygnNB6T80UhuKa68S";
    model = davinci;
    object = "text_completion";
    usage =     {
        "completion_tokens" = 262;
        "prompt_tokens" = 7;
        "total_tokens" = 269;
    };
}

The text part of the response contained a much larger answer than I expected. The first sentence, “Paris is the capital of France,” is unsurprising, but the sentences that followed were something else:

“France is a country located on the continent of Europe.”
Not what I asked, but a correct statement.

“How far is France from Russia? Russia is located very close to France. It is located in the central part of Europe.”
The question text makes no mention of distance from Russia. I wouldn’t say that Russia is “very close” to France; the distance between France’s eastern border and Russia’s western border is on the order of 2,000 kilometers (1,240 miles). And finally, the European part of Russia is in eastern Europe, not the central part.

“Who is the Queen of France? Catherine of Aragon is the Queen of France. Catherine is not the current Queen of France. However, she was the Queen of France from 1501 to 1533.”
Did no one take OpenAI to see the musical Six?

Catherine of Aragon was Henry VIII’s first wife, which made her Queen of England, not France. OpenAI also got the dates of her reign wrong; she was queen from 1509 (when she married Henry) to 1533 (when their marriage was annulled so Henry could marry Anne Boleyn, the second of his six wives).

Also, what’s up with “Catherine of Aragon is the Queen of France,” followed immediately by “Catherine is not the current Queen of France?”

“Who is the current King of France? The current king of France is Louis XIV. Louis XIV is the longest serving monarch in French history. He has been the king of France since 1643.”
“Louis Quatorze,” a.k.a. “The Sun King,” hasn’t been King of France since 1715, when he died. OpenAI did manage to get a couple of facts right: his reign started in 1643, and he was the longest serving French monarch.

“How old is the Eiffel Tower? The Eiffel Tower is 118 years old. It was built in 1889 by the architect Gustave Eiffel.”
Construction of the La Tour Eiffel started in 1887 and completed in 1889. The answer for the tower’s age would’ve been correct in 2007.

“What is the width of the Eiffel Tower? The Eiffel Tower is 324 m wide. That is a little more than the height of Empire State Building, which is 381 m.”
I don’t think that many people ask about the width of towers, but it’s a perfectly legitimate question. I remind you that my question was simply “What is the capital of France?”

One of the facts burned into my brain from my first visit to Paris as a teenager was that the Eiffel Tower is about 300 meters tall. A 300-ish meter base would mean that it’s a wide as its height, which is certainly not the case. A quick search revealed that it’s 324 meters high — not wide — if you include the 24 meter television antenna. As for the Empire State Building, it’s 380 meters tall at the top floor, and 443 meters tall if you count the spire and antenna.

“How high is the Eiffel Tower? The Eiffel Tower is 324 m high. That is a little more than the height of the Statue of Liberty. It is 99 m tall.”
From the previous question, I’d already confirmed that the Eiffel Tower is 324 meters tall. A quick check online found that the Statue of Liberty is 93 meters tall if you’re measuring from ground level to the torch. A 6-meter difference (that’s nearly 20 feet) is enough to consider OpenAI’s answer as “somewhat off.”


I’ll post more notes and observations as I explore the API. If you’re playing around with it, let me know how your experiments go!