code like im 5: but how do we actually talk to computers! (article 1)

ai like im 5
12 min readFeb 2, 2024

--

before i start, a couple things:

  1. this is a machine learning, deep learning, and ai focused coding series.
  2. machine learning coding can be a lot different than software development, software engineering, and the other fields of programming (will take more about this later)
  3. i will be covering python and it’s many packages and frameworks!
  4. and in the future c++ and some common ml stuff like docker, sql, and potentially mojo!
  5. a link to my machine learning + deep learning articles which the code will be based on: https://medium.com/@ailikeim5/list/ai-like-im-5-in-order-87ef4064afe8

once again, this content is not aimed at 5 year olds but instead simple!

anyways,

so before when i introduced data i told a very important story.

i am going to tell it one more time just to refresh:

i am going to drop you off in a foreign country, lets say italy, with 1 task: get home before the end of the week… easy right?

but there’s a catch

  • you do not speak the language of anyone in this place, there is not a single soul that can understand you!
  • everything is in italian: signs, stores, etc
  • technology does not exist… there are no phones
  • and you have no money… you are broke!

hopefully, you can recognize that there is only one way to be successful with this very hard challenge: learn how to communicate.

  1. the first thing you might do is to draw pictures and shove them in people faces

2. but that really doesn’t work, so you start using gestures, facial expressions, charades, and body language

3. after harassing enough people with your charades and gibberish, you finally meet someone who is very nice and they hand you a book, a translation from english to italian.

  • you are saved, for the most part, and you begin to read the book and learn!
  • you finally feel confident enough to ask for help and you go up to a random stranger and forget everything
  • you then open up the book, going page by page, and word for word in order to complete one sentence. then you hand the stranger the book and back and fourth you guys go until you reach a full conversation
  • so after conversation and conversation with different strangers, writing notes, and learning signs, you end up getting enough money, finding the airport, and getting home safely

establishing communication is important…

having the ability to communicate efficiently and quickly is crucial

  • if we want to communicate and talk to computers, we need a vessel for this communication
  • before i said that these computers love numbers, and now i can finally expand on that thought

some really smart people long ago established an amazing method so that computers can communicate with themselves and their parts.

and this was great, but what does this machine code, called binary, actual look like

ah so this binary language is plain english for machines but the average person cannot understand it, and the smartest people alive can only get so far for it?

so it’s a lot like this conversation:

or in other words: we were passing a book back and fourth just to communicate with a machine:

and then some really smart people came along and realized:

hey maybe, we could create a translator for the machine code!

we call these magic translators:

programming languages

programming languages convert human instruction into machine code (binary)

let me tell a story to better explain this!

picture this, you are a young boy named harry potter!

and you find out you are a wizard!

  • i want you to think about the magic wond as the machine code and binary!
  • the wond channels the magic (communication within the computer)
  • but without the proper techniques and instructions (programming code), we can’t get far and it can be very destructive!

for that reason, we have dedicated schools teaching people how to properly channel their magic!

and dedicated schools and bootcamps teaching people to program!

i want you to conceptualize a programming language like the spells and special wond movements that create the magic!

it is a better vessel for the instructions we give to our machines!

but these instructions are a bit complicated!

code cannot be ambiguous or in plain english: the instructions must be clear, concise, and consistent if we want to do things actually really quick and efficient!

or in harry potter terms!

and for this reason, learning to code can feel like being dropped off in a foreign country with no form of communication

  • especially if your introduction to code is by a guy who spoke better code than he did english!!!

here is a visualization of one of my first interactions with code!!!

this happens a lot because there is a problem with programming:

to help people outside of the loop, we moved toward

  • a lot of standard coding practices
  • coding languages that are easier for beginners
  • there are thousands of resources online to teach you how code!

but a lot of these standard practices, languages, and resources are designed by people that love to code and think in code, leading a lot of people to get lost for really no reason!

and sometimes it’s hard to break this initial barrier!

a great example of this is documentation:

  • documentation was designed to be explanation behind the code
  • every major programming language, project, and company has some sort of documentation
  • this is a standard process in the programming community, and we would be lost without it

the vast majority of documentation is only catered towards people inside the loop!

and this is crucial for companies, ideal for niche projects, and the backbone of a lot of programming languages…

why waste time re-explaining things your audience should know?

but what if told you one the easiest to learn and most beginner friendly languages had very beginner unfriendly documentation!

no this is not a joke, here is the first page of the documentation called a tutorial!

there are so so so many words in that you will not truly understand until you actually code for a good amount of time!

a great reddit post about this lol: “I recommend the official Python tutorial for certain learners

certain learners??? i thought this was a tutorial!

and this gets into my next point:

this is the real reason that keeps people away from programming!

your brain might be wired differently! that’s okay but you are going to have to expend more effort and time to rewire it!

here is an amazing video about this!!!

i will talk more about this in the future, but let’s dive into a important thing about programming languages!

what makes programming languages so complicated:

sadly we do not have 1 unified programming language

we had to take a different direction due to many tradeoffs we will talk about later!

here’s a good visualization of this

and this cycle continued on forever and now there are 1000s of programming languages, each with their own:

  • strengths and weaknesses
  • different levels of difficulty, syntax, flexibility and more!
  • some catered towards a specific reason and some more universal!

there is a specialized programming language behind your favorite things:

  • that app that let’s you sell feet picks
  • that video game that you spend your life savings just for a virtual skin

and that ai that sounds like the famous presidents:

and this is amazing!

like golf and my happy gilmore analogy:

all that matters in golf → who can hit the ball in the hole the best:

the essence of programming → can you build that product or do that task as best and most efficient as possible!

as a result, if making that new programming language can make everything so much easier, so much faster and better, or everyone happier, we will just create a new programming language!

so don’t get too wrapped inside the languages syntax and memorizing it in this, the concepts will transfer over from language to language!

most programming languages find themselves in two categories or somewhere in between

and as a result!

  • note: these pros and cons exist on a spectrum so there are some occasional exceptions!

in this series, we will mainly use an interpreted language (python) due to ease of use, community, support, and time!

but we will dive into a compiled language in the future, allowing us to relearn and master the models, and implement them much more efficiently!

there are other types of languages that exist beyond this scope too!

but let’s get into the next important idea:

in machine learning, the programming language we use to build and train our models doesn’t really matter!

i had a professor talk about his day job the other day and he mentioned a very interesting project:

they were working on building an advanced ai for a system

but he expressed the process had to be broken into two parts:

  1. actually building and training the ai:
  2. implementing the ai into the system:

recall, making an ai is a very complex task, and can be attributed to making a cake

it needs

  1. great data like a cake needs great ingredients
  2. great model like a cake needs great recipe
  3. and great parameters like a cake needs great steps and execution of that recipe

master the cake before you implement into the system!

you have 3 major hurdles you have to jump over!

so this process was done in two different programming languages:

  • the system was built in a complex programming language that is incredibly quick and fast and necessary for this system (compiled language)
  • but does not have a lot of support for machine and deep learning and even doing simple ai tasks is time confusing!
  • and so for actually building and training an ai, this difficult problem, they decided to go with a much slower, but easier to use programming language. (interpreted language)

there are three options below, if you had to take a guess what would be the best solution for a weally weally hard problem.

this is not rocket science, the clear option is number 3.

especially if you are in the field of ai, where you care about 1 thing: hitting the ball in the hole!

after they solved the problem, they had everything they needed to implement it using the more complicated programming language!

and although it would take lots of time to still implement it, they saved hundreds of hours of time by using the easier language for solving the problem!

the key takeaway:

  • for machine learning and ai tasks, we will solve the problem in the language that is best suited for that problem
  • it really doesn’t matter what the language is, we can chose whatever we want in all honesty!
  • some are better supported than others though… do not reinvent the wheel!

and so although this coding like im 5, i really want to emphasize coding in plain english!

  • before we even code the project, we will build, draw, and illustrate how it works that way you can implement into any programming language
  • don’t get lost in the syntax and techniques particular to a specific language in this series!
  • community support plays a huge factor in this
    i.e what tools are the people in your life using to solve their problems!

syntax and techniques are important but they transfer over!

there are thousands and thousands of resources for learning to code… why teach programming?

i realized there are some key problems in the coding community and what kept me from coding before:

some of the best content and courses on youtube are really really really long

  • all the information in them is so amazing, incredibly visual and the explanations are perfect.
  • teach you how to code super well!
  • and they are super easy to follow along too!!!

so what’s the problem! (the length and structure)

  • a couple years ago, when i was trying to code, these were my first introductions
  • but as a result i got stuck into a very interesting cycle

and i feel theres so many people that fall in this cycle:

and then time and life would go by!

and we lost you!

so let’s dive into our next problem and why i think this happens:

there are so many coding tutorials online right now that lead you into a trap:

  • i know this sounds funny but with the current state of programming, ai and more, programming is becoming too easy!
  • there are so many packages that do all the work for you!

so why is this problem, this actually sounds amazing:

for day to day work this is amazing…

  • i want the best product possible or best solution possible!!!

but for learning, this is not!

it is taking away from a crucial step in the learning process: failure

failure is so so so important, especially for learning the concepts of machine learning and ai!

winners fail, great ai’s fail, the best way to learn is to fail!

  • the best way to learn how to code is to learn the concepts and implement it yourself!
  • and fail, and fail, and fail, and fail until it actually works!

so the best way to learn machine and deep learning is to

  • learning to build machine learning and deep learning models from scratch is crucial to retaining the information
  • there is so much failure involved in this process
  • and i wish i could say it is easy!

do not reinvent the wheel for the complex stuff, but don’t miss out on the better learning!

you got this!!!

so anyways,

this is one of those articles i wish i could time travel and read for the first time. you will start to see as we get deeper into this series, there are so many resources that make coding ai a little too easy and encourage you to skips some steps!

i love looking at this picture

although it is a “bit” exaggerated, this was one of my favorite professors in college.

was he the best teacher? no, but he challenged me to a level no other professor has, and left such a good coding foundation in me. teaching me a valuable lesson, learn to think like a programmer!

the next lesson we will dive into python!

my human moment of the day goes this dweeb!

one of my favorite creators in the software engineering community and a dope person with a incredible story! the video is so funny cuz it sums up python perfectly! python stinks… but it just makes our lives so much easier and is being used to solve some of the hardest problems alive.

have a great day and

godspeed!

--

--