• Skip to main content
  • Skip to footer

DrTechniko

Train Young Innovators Anywhere Anytime

  • Free Stories & Activities
  • Online Courses
  • Coaching & Workshops
  • Bio
  • Blog

education

April 6, 2024 By drtechniko

How To Train Your AI

Last week I was invited to teach a group of 9th graders on the topic of AI. There is a general concern in schools that kids avoid learning by using a GPT [OpenAI, Gemini, Copilot, etc.] to do their homework. But in my opinion, given that AI is now readily available more than ever, we should adjust how we engage the students and what assignments we give them. AI is a tool they should not shy away from. Or they will fall behind. But, they should also have the wisdom to know how to use it. Or they will not grow. So, instead of telling them what to do, I showed them the real deal so they can make their own conclusions. We built an AI together as I told them a story. I hope my account of this lesson helps school teachers come up with ideas for their own classrooms.

To engage the students, I picked "movies and tv shows" as my story theme. I considered several other candidates: from making soccer predictions to personalized shopping but I felt that movies are a great way to engage both boys and girls in middle school and early high school. Besides, I used to work at Netflix 🙂

The fictional story was simple: "I have a bunch of movies that I watched, some of them I liked and some I didn't. I want to build an AI to tell me which movies I will like next. And because I'm lazy, I will ask an AI to help me build my AI! And then I will tell you how that AI got me in trouble."

It's all about data

First, I introduced myself to the kids to give them some clues: where I grew up, where I lived, what I did for work, etc.

Then I asked them to guess my preferences.

They guessed all the movies correctly except "Mamma Mia!". They thought that since I grew up in Greece I would have liked it. (Sorry, kids. I like my beach and tzatziki without the love drama.)

Then I showed them how I organized all this into data I could feed into the Movie AI using a spreadsheet.

I explained to the students that in order for the AI to decide what types of movies I like we need to tell the AI more information about each movie. We create what we call "features" to organize the information. For example "Is the movie animated?" or "is it high budget"? One of the students asked me "how do you tell if it's a high budget movie?". Good question. It gave me the chance to explain that, as the designer of the AI, I got to choose how to define that. In my case, I decided to call it "high budget" if it cost more than $100M to make. I also need to "label" each movie with "like" (check the box) or "dislike" (uncheck the box). For the computer this means like = 1 and dislike = 0.

Making the AI

Then I exposed them to the real code I wrote together with the GPT AI!

Why did I decide to torture the poor students with complex python code? I just wanted them to see how real engineers work. I explained to them that they didn't need to understand the code. I would just explain the high level idea and then run it together.

But by showing them the code, I also had a hidden agenda...

The GPT AI that I used to generate the initial code for the project made a critical error. It literally generated code that reversed my labels: 1's for the movies I don't like and 0's for the ones I liked. So I removed that "dangerous" piece of code.

It also generated code that trained the model only once, without performing proper Cross Validation, which is not a best practice in general. I let that slide however. It wasn't a big deal for the demonstration.

But it gave me the opportunity to explain to the students that if I didn't know how the code worked and I trusted the AI 100% then I would be in a lot of trouble. Maybe not for movies, but what if I trained an AI used in an autonomous car and then the car crashed??

After this, we trained the model and I showed them how training an AI is basically trying to position a line in such a way that it splits my "likes" from "dislikes" the best way possible by reducing the error of its guesses. That's why I had to train it for 1000 epochs to get there.

I showed them this graph:

At the end, I asked them to guess what my AI was. Was it a smart robot? A sentient being? A digital brain? The Matrix? The students had no clue. So I told them it was nothing this fancy. It was just a bunch of numbers that can help me draw a line to divide my data into two groups. We call them weights and biases.

Something like that:

Having fun with the AI

After we trained the AI together we saw how well it predicted these new movies:

Pretty good!

So then I asked the students to hack my AI. How would we do that? By hacking my data of course!

So here is what they did:

After "uncheck Ready Player One" and "check Barbie", etc. they figured to just simply reverse my labels (as shown at the bottom of my list).

Smart hackers!

And after we retrained the AI we got this:

Naruto was the only one who (barely) survived. He is a persistent little ninja after all!

Next Steps

After the class, I worked with the school teacher on follow-up assignment ideas. Here are some:

  • Create a new data set that has a similar format to the Movies one where you have to make one of two choices. For example, sports. For soccer you can train an AI for a goalie: "Should I dive LEFT or RIGHT?" based on data from opponent shots where the features are "isRightFooted", "runsFast", "wideAngleLeft", etc?
    • The kids then can discuss their data sets with the teacher. They can talk about how to reduce bias in their data or how they could collect and label them.
  • Try to play with the code and relabel and retrain the model to see where the AI gets confused and see if you can add extra movie features in the Feature list (or more movies).

Reference Materials

If you need to recreate this experience in your class or you want to have a conversation with your child here are the materials I used:

  • Presentation
  • Spreadsheet with Data
  • Code on Google Colab

I hope we learned something useful today,

Filed Under: artificial intelligence, class, computer science, education, programming, technology Tagged With: artificial intelligence, education, technology

July 9, 2014 By drtechniko

Teaching the “How To Train Your Robot To Jump” game

How To Train Your Robot To Jump is a very simple game. On purpose.

The point of the game is to teach one simple concept: automation. Not how to write a program to solve a problem, but rather what a program is: a recipe for an automated task. The child uses symbols to express a “mechanical” output. Mom or dad are not jumping until he or she has positioned all the arrows. It is the simplest notion of programming I could think of.

Why not something else?

To figure out how this compared with other available options, I exposed my 2.5 year-old son to iPad apps like Daisy the Dinosaur, but the features were too advanced for him. Toddlers can’t actually read words like “jump” and “roll” so I had to do all the work. He just wanted to press the “play” button. However, if the app developers modified their UI with symbols instead of words, he might have understood what to do. Even then, though, I don’t think I’d have the same connection and fun with him as with jumping up and down together.

I also had my son try to “program in order to solve a problem” using the Angry Birds programming app. There were too many distractions for him. There are too many UI components plus he doesn’t understand what a step or turn signifies and why it’s needed. He just wanted to have the bird move straight to the piggy. Same with Robot Turtles. There were too many moving pieces (i.e., distractions). All these are great options for later, though.

One project where I think the use of technology simplifies the experience for toddlers is Bo & Yana’s robot kit, which I’ve pre-ordered and can’t wait to try with him.

Running the game

In terms of the materials for the game, you need paper, markers and scissors to do some arts and crafts and create arrows like this:

image01 

This is a fun time for the child to work with you to build the arrows. It gives you the chance to talk about what the arrows mean during the game while you make them. Be as creative as you like during this step and build some fancy arrows.

In terms of playing, have the child arrange arrows in sequence like so:

image00

and tell them that if an arrow is pointing up you will jump and if it’s pointing down you will drop (or do a push-up etc.). You should start with a single arrow and add more soon after. We made 4 arrows and we could have used more.

The arrow placement will most likely not be so orderly. That’s OK. Keep the game a low-barrier-to-entry experience for the child. Don’t fixate on having the arrows ordered. Just point to a sequence you are going to do and then do the “workout”. You can also tell them that you want to jump up 3 times and let them figure out how to place the arrows (if you want to engage into light problem solving). Also, it’s possible that they will want you to arrange the arrows and that they do the jumping. This is the perfect hook for them to learn to interpret the “program”. Have them do some jumping, then alternate. The whole game won’t last more than 10-15 minutes.

And feel free to use other symbols for doing new moves or prefix the symbols with numbers to show the effect of counting. When we played the game multiple stuffed animals and dinosaurs were involved 🙂

I hope we learned something useful today,

DrTechniko

 

Filed Under: child, class, computer science, education, programming

February 4, 2014 By drtechniko

How To Train Your Robot To Jump

Can we get a toddler to program?

Experiments in Programming with a 2-year-old

To answer that question I wanted to figure out if my son could “write” a simple program by manipulating symbols. In the spirit of my How To Train Your Robot game, I decided our contract was going to be “If you show me symbol X, I’m going to jump. If you show me symbol Y I’m going to lift my arms.”

The “symbols” ranged from Lego bricks to toys to stuffed animals.

We tried this when he was around 2 years old. It didn’t work. He was more interested in the physical object that represented the symbol rather than the meaning of the symbol in our “game”. I don’t think it had to do with him not being able to interpret rules, because he understood cause-and-effect (grabbing toys from other kids = timeout). I think it had to do more with not being able to interpret an object as something more than its obvious physical attributes (color, shape, and what happens if you smash it onto something).

Experiments in Programming version 2.5

So, I refined my game into “How To Train Your Robot To Jump”. Our contract became “Pretend I’m a robot. If you place an arrow facing upwards, I’ll jump up. If you place an arrow facing down I’ll do a push-up”. I thought that using arrows to face up or down should be less abstract. Also, I waited until he was 2.5 years old. He was better at paying attention.

We tried this new game and it worked!

Take the arrows…

Place them up or down…

And wait for me to execute the program…

Which is what programming is fundamentally about: use a language to describe a task that is automated and whose results you see after you are done.

(Keep in mind, that girls are more advanced than boys at that age, so my son serves as a how-early-can-a-kid-program upper bound of sorts.)

He was so excited that he wanted to do what I was doing. So, he’d place the arrows and then jump up or drop down.

Then we started getting creative. How about putting the arrows facing left or right and I jump to the left or to the right?

(And how about a couple of dinosaurs around to help us debug?)

There was not much action happening with only 3 arrows. He wanted to keep me jumping. Kids around that age understand numbers, so we introduced numbers into the mix and I told him that if he put the number 6 in front of an upward facing arrow, then I’d jump up 6 times.

We were 10-15 minutes into the game by then, and the game started looking like a real workout (physically for me and mentally for him).

At that point he was more interested in how numbers and arrows looked together in large quantities rather than the program itself. We called it a day. A good one indeed.

I hope we learned something useful today,
DrTechniko

Filed Under: child, class, computer science, education, programming Tagged With: children, game, programming class, robot

April 21, 2012 By drtechniko

Teaching the “How to train your robot” class

After popular request, in this post I explain how to teach the “How to train your robot” class.

The class is split in two parts.

Part 1 – Guess The Robot

The first part is a game called “Guess the robot”. I show kids slides of different robots and they have to guess what the robot is or what it’s special ability is. At the end of the presentation I explain to them how robots work. In addition, I had a real robot that moved when kids clapped or screamed at it. I used it to show the robot parts and we had some fun making it move around.

You should be able to finish this part of the class in 15-20 minutes depending how many questions the kids ask.

Part 2 – Train Your Robot

The basic process was to get all the kids together to explain to them the game. I use my slides to do that. Then I hand out the dictionaries and pen and paper. I gather all the kids an parents and we first act through all the moves. Then I write a simple program on a piece of paper “move forward, turn left, move forward” and I ask kids to show me what it does. After that we start doing the obstacle course (which I have setup before starting the class).

After they get their “robots” to bring back the ball you tell the kids to invent their own “moves” and so they have their parents doing funny stuff 🙂

You should be able to finish this part in 30-40 minutes before the kids’ attention span degrades to zero…

Class Materials

The materials I put together to run the class:

  1. Presentation Slides (and Presenter’s Notes) [ΕλληΜÎčÎșÎŹ, Deutsch – Christian Mennerich]
  2. A laptop or iPad to show the slides.
  3. The Robot Language Dictionary [ΕλληΜÎčÎșÎŹ, Deutsch – Rita Freudenberg]
  4. One pen and paper per kid (for kids to write programs and hand them to their robot parents).
  5. A space where you can arrange obstacles (one or two obstacles to make kids add turns to their programs is enough. I used a gym as you can see in the videos posted on Facebook, but I’ve also run the class in a room with chairs arranged as obstacles).
  6. A ball per kid-robot pair (the ultimate goal is for the robot to get the ball and bring it back to the beginning).
  7. Optional yet fun: A real robot. I bought and built my own basic robot ($50). It took about an hour to assemble.

Class Dynamics

  • Five year olds are better when left alone to create their special moves. They get very creative.
  • Seven year olds need more guidance because they have too many ideas. They’d rather be told what moves to invent.
  • I’d recommend no more than 6 kids in the class, so you can have the situation under control.
  • Try to regroup the kids after their robots get the ball. Explain to them that now they can invent new moves.
  • Parents beware, you may have a serious workout. Kids love to make you repeat stuff 100 times. I advise to wear comfortable clothes.

I would love to hear your findings and see photos from you running the class at home or school.

I hope we learned something useful today,
DrTechniko

Filed Under: child, class, computer science, education, programming, technology Tagged With: children, programming class, robot, teaching

April 9, 2012 By drtechniko

How To Train Your Robot

Last Sunday, I taught six kids of ages 5 to 7 how to program. “In what programming language?” you may ask. Well…I didn’t use a programming language, at least none that you know of. In fact, I didn’t even use a computer. Instead, I devised a game called “How To Train Your Robot”. Before I explain how the game works, let me tell my motivation.

I learned how to program during my freshman year at MIT when I was 19. It’s not because I didn’t have a computer at home or I hadn’t heard about programming languages. It was because (a) I thought programming was boring and (b) no one had told me why I should bother. In fact, my computer teacher in high school had told me “you don’t need to waste your time learning how to program. Now we have visual tools to build programs. Programming languages are already obsolete.” That was in 1994 and he was referring to Visual Basic. Luckily for me MIT wiped all that nonsense away in a matter of weeks. But does one need to wait to go to college to get the proper education?

Learning how to program is going to be the most useful new skill we can teach our kids today. More than ever our lives depend on how smart we are when we instruct computers. They hold our personal data and they make decisions for us. They communicate for us and they are gradually becoming an extension of our brains. If we don’t learn programming as part of our childhood, we will never evolve. As the famous futurist, Ray Kurzweil, put it “The only second language you should worry about your kids learning is programming.”

How To Train Your Robot

The game works as follows: every kid is turned into a “robot master” and their mom or dad becomes their “robot”. I give each kid a “Robot Language Dictionary” and explain to them that this is the language their robot understands. The dictionary has symbols for “move left leg forward”, “turn left”, “grab”, “drop” etc.

The goal is for the robots to go through an obstacle course, pick up a ball and bring it back. The kids have to write a program that will tell the robot how to do all that. Every time they write a program, they hand it to their robot and the robot executes it. To do that, I give each kid a pen and paper where they copy symbols from the dictionary to write their programs and off their robots go!

The fun part begins when each robot retrieves the ball. Now I let kids invent their own moves and symbols that they add to their dictionary and then teach their robots. There is no limit to what the kids come up with.

This is my favorite program (written by a five year old girl):

I designed the class to teach some very basic principles of computer science and programming:

  • Programming languages are just another way to communicate to an entity (via programs).
  • Programs are recipes for automating stuff.


However, I was pleasantly surprised on how much more the kids learned. On their own they figured out the following things (in a 30-min session):

  • Program Parametrization: Instead of putting a forward step ten times, they put a 10 in front of the “step” symbol (A five-year-old figure it out and asked me if she could do it).
  • Composition: Grouping of a set of moves (“move left leg forward, then move right leg forward and do this combo 10 times”)
  • Abstraction: “Run in a circle, then say “I’m dizzy!” , then call this the “Run Dizzy” program and do it 100 times. (For some reason, kids loved making their parents repeat stuff 100 times over.)
  • Unit testing: They’d write a test program to get the parents moving a few steps, have their parents run it, then fix it and run it again, and then add a few more steps until they reach the goal.


I’ve ran the class twice now and I’ve seen the same patterns, which support my belief that when kids have fun, they get very smart and creative about programming. Many of the parents plan to play the game at birthday parties. If you have questions about how to set up the game, don’t hesitate to write. You can find my contact info at www.facebook.com/drtechniko.

You can also find instructions on how to teach the class as well as materials I used on this post.

I hope we learned something useful today,
DrTechniko

Filed Under: child, class, computer science, education, programming Tagged With: children, game, programming class, robot

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Footer

  • Facebook
  • Pinterest
  • Twitter

Copyright © 2025 DrTechniko · All Rights Reserved · Contact DrTechniko

 

Loading Comments...