Skip to content
CBT Nuggets

Compare AI Vs. Machine Learning

This skill provides an in-depth comparison between Artificial Intelligence (AI) and Machine Learning (ML), exploring their subdomains such as Deep Learning and Generative AI. It covers the foundational concepts of AI, including neural networks and their applications in computer vision, facial recognition, and fraud detection. The skill also delves into advanced topics like transformers and diffusion models, highlighting their role in creating new content like text and images. Learners will gain insights into the architecture and mechanisms behind AI technologies, preparing them for practical applications in AI development.

Full lesson from AWS AI Practitioner. Preview the IT training 23,000+ organizations trust.

52m 8 Videos 8 Questions

Skill 3 of 19 in AWS AI Practitioner

Introduction

Welcome to the next skill in the AWS Certified AI Practitioner Course! In this skill, we'll Compare AI with Machine Learning and explore how rule-based system are not machine learning—but they are both considered AI. We'll explore the subdomains of AI: machine learning, deep learning, and generative AI.

AI vs Machine Learning

Now that we've covered cloud versus local and core AI concepts and tools we'll begin to compare AI versus machine learning by asking the question: Is AI the Same as Machine learning? See you in the video!

Knowledge Check

Which type of AI is used in facial recognition systems?

  1. ADeep learning using convolutional neural networks
  2. BTraditional machine learning using decision trees
  3. CRule-based systems
  4. DReinforcement learning

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

What is Machine Learning?

In this video, we'll answer the question, What is Machine Learning? As we explore and demystify machine learning we will unpack concepts like regression, classification and rule-based AI.

Knowledge Check

What is the primary difference between machine learning and rule-based AI systems?

  1. AMachine learning learns patterns from data, while rule-based AI uses predefined rules.
  2. BMachine learning uses predefined rules, while rule-based AI learns patterns from data.
  3. CMachine learning is a subset of rule-based AI.
  4. DRule-based AI can improve over time by learning from data.

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Deep Learning Explained Simply

In this video, we'll explore how Deep Learning is really just software modeled after the brain. We will analyze artificial neural networks in simpler terms to give you the intuition you need to understand how you can use to build your own models—from object detection to sentiment analysis.

Knowledge Check

What is a key requirement for deep learning to work effectively?

  1. ALarge amounts of data and powerful GPUs
  2. BMinimal data and standard CPUs
  3. COnly a few layers of neurons
  4. DManual adjustment of neuron weights

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Recognizing Handwritten Digits

In this video, we explore how Deep Learning can recognize handwritten digits by learning to detect different patterns, such as lines and edges. We begin by passing in an image with a number that travels through a neural network to ultimately make a prediction. As Arthur C. Clarke said, "Any sufficiently advanced technology is indistinguishable from magic". Let the magic begin!

MNIST Digits Dataset:

MNIST Fashion Colab Notebook:

Knowledge Check

What is the primary purpose of the first layer in the neural network when analyzing the MNIST dataset?

  1. ATo detect lines and edges
  2. BTo recognize digit shapes
  3. CTo determine the most likely number
  4. DTo convert images into pixel values
  5. ETo perform one hot encoding

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

What is Generative AI?

In this video, we explore one of the most exciting parts of artificial intelligence—Generative AI. Instead of just analyzing data, Generative AI creates brand new content like text, images, and even music. We'll explore the powerful foundation model behind transformers, diffusion models, and the multi-modal model driving tools like GPT–4o.

Links:

Knowledge Check

What is a key advantage of the transformer architecture in generative AI models like GPT?

  1. AIt uses self-attention to understand the entire sentence at once.
  2. BIt processes words one at a time, similar to RNNs.
  3. CIt requires labeled data for training.
  4. DIt is primarily used for binary classification tasks.

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Challenge 🎉

Congrats on making it to the end of the skill and to the challenge! Your challenge is to leverage the power of generative AI to learn more about the transformer architecture:

1. Search for the white-paper titled "Attention is All You Need" and download the PDF.

2. Upload the white-paper PDF to Google's Notebook LM.

3. Create a podcast to learn all about the self-attention mechanism.

Solution

Knowledge Check

What is the primary focus of the white-paper titled 'Attention is All You Need'?

  1. AThe transformer architecture
  2. BThe evolution of AI tools
  3. CThe history of machine learning
  4. DThe development of Google's Notebook LM

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

Which of the following statements best describes machine learning?

  1. AMachine learning is a subset of AI that learns patterns from data instead of being explicitly programmed.
  2. BMachine learning is a rule-based system that follows hard-coded instructions.
  3. CMachine learning is a type of AI that uses handcrafted rules to make decisions.
  4. DMachine learning is a process that relies solely on logical reasoning without using data.

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

Knowledge Check

Which of the following is considered a subdomain of AI?

  1. ADeep Learning
  2. BProgramming
  3. CCloud Computing
  4. DData Warehousing
  5. EBlockchain

Verify your team's readiness — Request a Demo to verify practice assessments, completion reporting, and CSV / SCORM exports on the Team plan.

View Transcript

Introduction

0:00Hello and welcome to the next scale in the AWS Certified AI Practitioner course

0:07.

0:07In this scale, we're going to compare AI with machine learning.

0:11Up to this point, we've talked about cloud versus local and all of the related

0:17AI core

0:18concepts and tools.

0:20Now we'll begin to compare AI versus machine learning and we'll do that by

0:26asking is AI

0:28the same as machine learning.

0:31And in this scale, we'll break everything down and explore AI in its different

0:35subdomains

0:37at a deeper level.

0:38But first, let's talk about everything we're going to cover in this scale.

0:42Number one, we're going to talk about AI versus machine learning and really ask

0:47what

0:48is the difference.

0:49Then we'll talk about real world AI and we're going to do that with use cases

0:54again.

0:55This time, we're going to compare it to the subdomains.

0:58Now we need to understand what is AI, generally speaking, what is machine

1:03learning and what

1:04is deep learning and what is gen AI.

1:07These are all important subdomains and we need to start to understand where

1:11they fit

1:12into in the real world of AI.

1:15Then we'll dive into deep learning and explain it simply.

1:18We've talked about it in the context of software modeled after the brain.

1:23This is also what we described as software 2.0 because it learns from data

1:29using neural

1:30networks.

1:31And next, we'll dive into how AI recognizes handwritten digits.

1:35There's a lot to talk about when we're talking about CV and what is that?

1:40Computer vision.

1:41If you remember, we said CNN, that's part of computer vision and we'll talk

1:46about that

1:46with some amazing visualizations.

1:48In number 5, we're going to talk about generative AI, also abbreviated as gen

1:55AI and how machines

1:57create text, images and more.

2:00And then we're going to really just tie it down with humans plus AI, which is

2:05prompting

2:06software 3.0 and the future.

2:09And then number 7, I'm just going to put it up here.

2:11This is the challenge just to make sure that we don't have any knowledge gaps

2:16and that

2:17we understand all of this as we start to get more granular and start to talk

2:21about deep

2:22learning more of the neurons or the deep layers and then computer vision.

2:28So the way I like to think of it as NLP or natural language processing is how

2:32we teach

2:33the computer to read and write.

2:37And then computer vision is how we teach the computer to see the world.

2:41So number 6, when we get into the humans plus AI, it's a great tool, I would

2:47say, to think

2:47about all of these deep learning concepts as if it were in your mind.

2:53Because we do have biological neural networks and you can think about computer

2:57vision, you

2:58can think about NLP.

3:01And I think it's a really great way to internalize these concepts.

3:05If it feels alien at all, always just remember there's a biological version

3:10inside of you.

3:11All right, so I'll see you in that next video,

3:13AI versus machine learning.

AI vs Machine Learning

0:00Welcome back. We already know that AIs a field that creates systems that mimics

0:04human intelligence

0:06or you can think of it as software modeled after the brain. And these systems,

0:11much like human

0:12minds can perceive, think of cameras seeing like eyes, reason, chess playing AI

0:20or AlphaGo

0:20beating the best Go player, and learning when we say learning, we mean learning

0:25from data and

0:26rules. Also, they can solve problems and make decisions. Artificial

0:31intelligence is a field of

0:33computer science focused on building systems capable of performing tasks

0:37typically that require

0:39human cognitive abilities. And remember, we talked about software 1.0, 2.0, and

0:453.0.

0:45Those are all inside of this main term artificial intelligence. And I think we

0:51have a good understanding

0:52of what AI is. But first, let's expand on the AI use cases, because I'd like to

0:58make sure that

0:59we understand which type of use case is using which type of artificial

1:04intelligence. So let's start

1:06with computer vision. Computer vision is using AI to analyze images and videos.

1:12And you can think

1:13of video as a series of images. If you know what 24 FPS means, that means 24

1:20frames per second.

1:21And that's normally how many frames per second that we see when we're watching

1:25movies. So they're

1:2624 images. So if you think of it like that, computer vision is really just

1:30working with images. It

1:32can be one at a time or many in a series. So what kind of machine learning do

1:36you think this is?

1:38Let's break it down. It extracts patterns like edges, textures, and objects

1:43from pixels. It's

1:44using autonomous cars to detect lanes, signs, and pedestrians. And neural nets

1:50process video

1:52frame by frame to make driving decisions. Again, it's set frame by frame. But I

1:57think the takeaway

1:58here is that we said neural nets. So if you said that this was deep learning,

2:02then that's correct.

2:03No logic, just learning from the data. All right. So now how about facial

2:09recognition?

2:10Here, AI identifies and matches human faces. You've probably seen movies where

2:15they're trying to

2:16find somebody and they look at all the public camera feeds. So what kind of AI

2:21is this? Let's

2:22talk about how it works. It converts facial features into numerical factors

2:27called face prints. These

2:30are then compared using cosign similarity or nearest neighbors. These are again

2:35algorithms.

2:36And this is used often to unlock phones, right? It looks at your face and you

2:40can unlock your

2:41phone with the face. Airport security to find people that are not supposed to

2:46be in the airport

2:47and even surveillance systems. So what kind of AI is this? If you were thinking

2:52about face images

2:53and convolutional neural networks, neural nets that is correct, this is also

2:58deep learning.

2:58All right. So now how about raw detection? Here AI spots abnormal behaviors in

3:04transactional data.

3:06Here, we're using models like decision trees or random forests or others called

3:12XG boost and all

3:13of these learn spending patterns. Remember that we looked at a random forest

3:17earlier? That might

3:18ring a bell. They flag transactions that differ from normal patterns. That

3:22means automates, weird

3:24times or strange locations. For example, let's say that you bought a pizza, you

3:29're in New York City,

3:31and then 15 minutes later, someone in China bought a Tesla. Well, probably not

3:36the same person,

3:37right? You went from a pizza to a car in a completely different continent. So

3:41that might be

3:42something that gets flagged and they don't need images, just structured tabular

3:47data. So that's

3:48the clue. In this case, this is traditional machine learning, also software 1.0

3:53, because you are

3:55writing the logic, you are writing the code. All right. So now let's move to ID

3:59P or intelligent

4:00document processing. This is a little bit trickier. Let's try to think through

4:04it. AI extracts text

4:06and meaning from form and it's using something called OCR. This is optical

4:11character recognition.

4:13What it's doing is recognizing the characters and it's converting scanned

4:18images to text.

4:19In short, it transforms messy documents into clean, usable digital records. All

4:25right. So this

4:27is interesting because it's a mix of deep learning plus machine learning. Let

4:31me explain how this works.

4:33So the deep learning is for the image in text parsing, and then the machine

4:37learning is for

4:38classification and tagging. So the OCR uses deep learning to convert scanned

4:45images to text,

4:46then the machine learning part, which can also be rule based systems, labels,

4:52fields like dates,

4:53totals, and names. So what it's doing is combining both deep learning and

4:58machine learning. So here's

4:59the last one, robotics. What do you think? Well, the difference between

5:03computer vision and robotics

5:05is very similar because it's using computer vision to navigate the real world.

5:11And so this is much

5:12harder than chat GPT deep learning again is used for robotics. And so what's

5:17the takeaway? They all

5:19use some kind of AI, but now we know which are using which. And also we know

5:24that they could be

5:25mixed. Now let's talk about the AI system layers, also known as AI components.

5:33So let's start at

5:33the bottom here with a data layer. So here's where we have the data and the

5:37data scientist.

5:38This is where we collect, store, and organize structure and unstructured data.

5:44These are data

5:46structures. There's different kinds. And so these are the two that we're going

5:50to really focus on

5:51in this skill. So what does a data scientist do with the data? Well, you have

5:56to frame a problem

5:57and try to solve a problem, but using machine learning in this case, that's the

6:02framework layer.

6:03Do we want to use deep learning and in TensorFlow and PyTorch? Or are we going

6:07to use

6:08traditional machine learning and algorithms using scikit learn? So we choose

6:13the tools,

6:14libraries, and algorithms for the development of the model. And then we move

6:18into the model

6:19component. And here we train and define the model architecture. We do some

6:24tuning and loss

6:25functions to get the model to be performant. We want to increase the

6:29performance as much as

6:30possible. We really want to minimize error and maximize orments. So builds,

6:35trains, and tests

6:37the machine learning model. And finally, we have the application layer. And

6:41that's where users can

6:42access the model. So we deploy the train model for real time or scheduled use.

6:48So these are the

6:49ones that I'm checking that are important. Let me just put asterisks here and

6:52here. We're going to

6:53revisit these to real quick note on the application layer. There's two ways

6:57that we can handle this

6:59application layer that can be an API where two computers are talking to each

7:03other or UI user

7:05interface where someone is using a website or mobile phone or an interface

7:10directly for users.

7:12All right. So that's it for this video. And I'll see you in the next video

7:15where we answer the

7:16question, what is machine learning?

What is Machine Learning?

0:00Welcome back. In this video, we're going to talk about machine learning and how

0:03machines learn from data so that we can compare it to rule-based systems and

0:08how

0:09Rule-based AI is not machine learning. One is a rule-based system and the other

0:14one learns from data.

0:16All right, so we know that machine learning is a subset of AI that learns

0:20patterns from data instead of being

0:23Explicitly programmed it improves over time and it can make predictions. For

0:28instance, instead of following hard-coded rules

0:31Machine learning learns from examples. They use past data

0:35So we're talking about historical data to recognize patterns and make

0:40predictions

0:40Machine learning is a part of AI focused on learning from experience

0:45So we're going to dive into regression here in classification to further

0:49illustrate these differences and the process relies on statistics

0:53There is programming, but it's using statistics and to clarify this. We're not

0:59using logic to find these patterns

1:02We're using statistical programming. So first of all, what is regression

1:07regression predicts continuous numerical values?

1:11So real quick, what is a continuous value?

1:13This is something with a decimal point and that could be housing prices

1:18temperature sales stock prices

1:20So our example is predicting house prices, but you could also use temperature

1:25or sales if you'd like

1:26So input features could be size

1:29Location or the age of the house

1:32So you would feed those input features to your model and then the model finds a

1:36relationship between the input and the output

1:39A common algorithm that we would use here is linear regression

1:43And that's why in this image you see a line going through those data points as

1:47we discussed before in

1:49In addition to linear regression, we can use decision trees and X cheap boost

1:53This is what we've been talking about when we're talking about machine learning

1:57Classification on the other hand predicts discrete labels or categories

2:02So the example here is it spam or not spam so the model learns from labeled

2:08examples and the outputs will be something like spam or not spam

2:12Hot dog or not hot dog and we explored this in a fun example with teachable

2:17machine

2:17So you should have a good idea of how this works

2:20Common algorithms include logistic regression support vector machines random

2:26forests and naive base

2:27Now I'm saying that regression and classification are machine learning

2:32But remember that machine learning is a form of AI in a subset of machine

2:36learning as deep learning

2:38So we were using deep learning for classification now that we have a really

2:43good idea of how machines learn from data

2:45Let's compare it to rule based systems. So what are rule based systems or what

2:52is rule based AI?

2:54We can say that it's classic AI and by that I mean no learning no data just

3:00rules

3:01So you manually program logic and that would be something like if X and Y then

3:08do

3:08Z and that is programming logic it follows flow charts or decision trees and

3:15Everything has to be coded up front. It doesn't improve with experience. It's

3:20just following rules

3:21So here the user inputs information and then the expert system does the rest

3:27Let's say that this non expert users

3:29Interacting with a UI or a user interface and then there's this rules engine in

3:35a knowledge base

3:36But all of that knowledge base was coming from an expert

3:41They literally had to add all of those rules and then once the rules engine

3:47Communicates to the knowledge base it flows back to the UI and back to the user

3:51and then provides of advice

3:53So let's take an example then draw is an expert system and it was designed in

3:59the 1960s for chemistry

4:02It analyzed mass spectrometry data to guess molecular structures and in this

4:09example

4:09It used over a thousand handcrafted rules and that means no learning just

4:15reasoning from fixed logic

4:17All right, so let's go through this dental expert system

4:21It engaged in scientific discovery by analyzing organic compounds and

4:26identifying their structure

4:27Which is pretty complex, but it did so using a collection of over a thousand

4:32rules and these rules apply to data using

4:36Logical reasoning and you can call that an inference engine in this case

4:40It was developed for mass spectrometry and it was used to generate the chemical

4:44structure

4:45Hypothesis from data and so the takeaway here is that dendral was rule based

4:51and used structured lab data

4:54Not machine learning to infer possible molecular structures

4:58So let's compare rule based AI with machine learning

5:02So we know that this one used rules and we can ask a question that it learned

5:07from data and the answer here is no

5:10And here we're learning patterns and did it learn from data?

5:14Yes, how about deep learning and prompted AI?

5:18So deep learning is using neural nets. I'll just use NN for that and

5:23Does it learn from data?

5:26Yes, even more so than machine learning. How about prompted AI?

5:31It uses large language models and does it learn from data? Yes

5:36Even more so than deep learning because there's no code. So this is software 1.

5:440

5:44This is software 2.0 and this is 2.0 because it learns from data

5:49You're not explicitly programming it and this is 3.0 because you're using

5:54prompts to do the programming

5:56There's no explicit code

5:58So the takeaway is that rule based is logic written by humans

6:02Machine learning is logic learned from data

6:06Deep learning is logic that is learned end to end from data and prompted AI

6:12You just give it goals and plain English and it accomplishes them

6:16So I would say that rule based AI is fixed machine learning is flexible

6:22Deep learning is powerful and prompted AI is creative and language driven

6:29All right, so that's it for this video and I'll see you in the next video when

6:33we talk about deep learning

Deep Learning Explained Simply

0:00Welcome back. In this video, we're going to dive into deep learning.

0:04And we're going to start to think about human neurons or our biological neural

0:08network to help us understand artificial neurons.

0:12First of all, you might be asking, "What does a neuron even do?" So let's talk

0:16about that.

0:17So let's say that this is a neuron and it's taking in an input.

0:21And we're going to say that there's weight to this input.

0:25Meaning, how important is this piece of information, this input?

0:30And we'll give this a threshold of 0.5.

0:34So if this input is more important or has a higher value than 0.5, let's say

0:40that the weight is 0.6.

0:43That means that it's going to go into the neuron, and when it reaches this

0:46neuron, it's going to fire forward.

0:49But let's say that instead of 0.6, it's 0.2.

0:54Well, below the threshold.

0:56That means when it gets into the neuron, this input, since it's below the

1:00threshold, it just won't fire.

1:02And so what happens in a neural network is these weights get adjusted over time

1:06.

1:07And that's how it learns.

1:09Understanding the neuron is the first part.

1:12So deep learning uses artificial neurons which are computational units.

1:17And remember, all they do is decide whether or not something goes through or

1:21does not.

1:22That's it.

1:24And they're designed to simulate the way the human neurons process information.

1:28And that's how human neurons do it.

1:30They either pass it to the next neuron or they don't.

1:33So these artificial neurons are organized in layers to analyze and learn from

1:38data.

1:39So the deep part is that there's many, many layers of these neurons.

1:43You can think of this as a neural network.

1:46So you have the input going here into these layers.

1:50And it says, how important is this input?

1:53Let's say this is like horsepower miles per gallon and cylinders.

2:00And it's some sort of a neural network to understand if a car is fuel efficient

2:03or something like that.

2:05So this is not important.

2:07This is important.

2:09This is not important.

2:10And so there are going to be many hidden layers like many of these.

2:14That's why it's called deep.

2:15And it's going from the input and then eventually you'll get this output that

2:19will tell you something that you want to know about the input, so the

2:23relationship.

2:24And it does this through these neural networks.

2:27Now that's a very simplified version.

2:29But the reason I explain it like this is that we need to understand what the

2:32neurons are doing.

2:34And they're acting like a filter or a gate.

2:37You know, just think of, just think of Gandalf.

2:40Thou shall not pass.

2:42Or thou shall pass.

2:44Think of a neuron as Gandalf.

2:46All right.

2:47Deep learning finds complex patterns and data more than traditional machine

2:51learning methods.

2:53And you can really think of deep learning as the newer version of machine

2:56learning.

2:57So it's more powerful.

2:58It uses multiple layers to process information.

3:02And that's why it's called deep.

3:04And these layers, we're thinking about networks of these artificial neurons.

3:09It needs large amounts of data to work well.

3:12And it requires a GPU.

3:14This is a powerful processor to handle the calculations.

3:18And the good news is that we can use GPUs for free and co-lab.

3:23We're also going to use AWS, of course, but as I said, this is an industry

3:28standard in machine learning and deep learning.

3:31So some examples of deep learning include computer vision, which we've talked

3:36about.

3:37It identifies objects or dividing images into parts.

3:41And then this is like teaching the computer to see.

3:45And this is teaching the computer to read and write.

3:49And that's natural language processing.

3:51And these are tasks like translating languages or analyzing feelings and texts

3:56that's called sentiment analysis.

3:59What's important to take away from deep learning is that they require lots of

4:04data and powerful GPUs.

4:06I think that's the most important part and how these neurons are working.

4:11They're basically ganned off. They're allowing you to pass or not allowing you

4:15to pass depending on some threshold.

4:18Alright, so now here we have a neural network and we can examine how it works.

4:25So nodes, these are small units that are interconnected.

4:29These nodes are the neurons.

4:31So you have the input going into these hidden layers and you can have not just

4:35four, but you can have a bunch of these.

4:37The more you have, the deeper your neural network would be.

4:41And as you can see, they're interconnected.

4:43These nodes are organized in layers.

4:46And when the neural network sees a lot of data, what it's doing is that it

4:50identifies patterns and changes the connections between the nodes or these

4:56neurons.

4:57How does it change that?

4:58By changing the weight. And what is weight?

5:01How important is this connection to this one?

5:04So if the connection is not important, well, it's not going to pass to the next

5:09neuron.

5:10And so it'll change the weight of that feature and it'll give another feature,

5:16which is more important, more weight.

5:18So it can do that over and over and over in order to classify digits.

5:23And we're going to do that together using Google Colab.

5:27It can get to the point where it says this curvature is important, but this

5:31straight line is not important for this input.

5:36And that's how it makes this prediction.

5:38And so what's cool here is that these nodes are talking to each other.

5:42That's what happens in our brains as well.

5:44And they do so by passing or not passing data to the next layer.

5:50So that's that Gandalf action that we're talking about.

5:53And the math and the parameter tuning behind deep learning is beyond the level

5:57of this course.

5:59But the good news here is that we don't have to talk about this in this course

6:04because we're using AWS and it abstracts a lot of this.

6:08And that's what makes this such a good entry level course to get started with

6:14building and architecting AI applications on AWS.

6:19And finally, neural networks can have billions of nodes or neurons.

6:24So the takeaway here is that the data flows through these neurons and these

6:29connections between the neurons change as it learns.

6:33And that's about it for this video.

6:35And I'll see you in the next video where we explore a deep learning example,

6:40the MNIST data set.

6:42And that's going to be the handwritten digits.

6:45See you there.

Recognizing Handwritten Digits

0:00In this video, we're going to explore two examples. Here we have the MNIST

0:05dataset of hand-written

0:06numbers. This is a classic example. And we're also going to look at the fashion

0:11dataset, also an

0:12MNIST dataset. And this way, we can compare and contrast between the two. We're

0:17going to look at

0:18it from a high level and try to understand conceptually what's happening by

0:23looking at the neural network

0:24that we've been discussing, these artificial neurons. And then we'll go into

0:29Google Colab and look at

0:30different fashion items and try to understand how it's done programmatically.

0:35And I'll guide you

0:36through each part of the code. You don't have to write the code. It's just to

0:39get you to understand

0:41what it does at each stage in order to make these predictions. When we're

0:45looking at this example

0:47for the neural network, the first layer detects lines and edges. And what that

0:52means is that each

0:52layer is learning from the features or these inputs. We can call them input

0:57features. So the

0:58first layer detects lines and edges and the deeper layers recognize digit

1:03shapes. And then the final

1:05layer chooses the most likely digit. So when we're thinking about hand-written

1:10numbers, these are

1:11going to be the input data or the input features. And the process begins with

1:16an input layer consisting

1:18of pixel values. So each one of these images turns into a pixel. And then the

1:24data is analyzed through

1:26hidden layers that detects lines and curves. As you can see, zero has a lot of

1:31curves. And one

1:32is just pure lines. Finally, the output layer determines the most likely number

1:37. And that's

1:38this output here. Each layer recognizes a distinct pattern within the data. And

1:44pattern examples

1:45include vertical lines for the numbers one, four, seven, and a curved bottom

1:52for the numbers six,

1:54eight, and zero. Now this works is that the neural network learns to identify

1:59all of these

2:00patterns. Now let's take a look at the MNIST data set for fashion in Google Col

2:06ab. If you want to

2:07learn more about the MNIST database of the hand-written digits, here is the

2:12Wikipedia page. And I'll

2:14share this link below. And we're going to look at a similar MNIST data set but

2:19fashion. And here's

2:20a good view of all the items. You have shirts, pants, shoes. And this is a

2:25representation of the

2:27data set in a vector space. And we'll talk more about that as we progress

2:30through the course. But

2:32now let's take a look at the Google Colab here. So this first cell, we're going

2:37to shift enter,

2:38or you can hit the play button. What we're doing is importing TensorFlow. That

2:42's the framework we're

2:43going to use for our model. And then matplotlib to visualize and NumPy. This is

2:48something that

2:49we often use in machine learning and deep learning. And here we're going to

2:52load the data from the

2:54fashion MNIST from TensorFlow. Let me run this. And there we have our data

2:59makes it really easy.

3:01And then we can look at the classes. So I know that it's T-shirt, tops, trouser

3:06, pullover, dress,

3:07coat, sandals, shirts, sneakers, bags, and ankle boot. So if we run this, now

3:12we can see that this

3:13is the classes that we're working with. One, two, three, four, five, six, seven

3:17, eight, nine, 10.

3:19So 10 classes. And now let's take a look at our images. And we can kind of

3:24search through eight

3:25images. And that's what we were doing here. Number of rows and columns just to

3:28look at the

3:29images and see what we have. And now we have our model. So here we're going to

3:33create a train

3:34test split, meaning we're going to have training data. This is where the model

3:38learns the patterns.

3:40We have the test data. And this is where the model is measured or tested to see

3:47how well it does.

3:48If it does really well on the test, then that means that it has a good chance

3:52of making predictions.

3:53Let's go through each one of these. So let me go ahead and run this. And now we

3:58're going to

3:58convert the labels to one hot encoding. This is pre processing. We have to

4:04change the data.

4:05And that's what we did here. We did normalizing whenever you change the image

4:10to numbers,

4:11there's some pre processing that you have to do. And now here is the model. So

4:15what's really cool

4:16here is that we're using a sequential model, meaning we're doing one layer at a

4:21time. So here is the

4:22input layer. And 28 by 28 means each image for each garment is 28 by 28 pixels.

4:30Here we have our

4:32first layer in what this number is for neurons. So we have one layer for

4:36neurons, another layer

4:38of four neurons, right? So this is our neural network. It's pretty cool. So we

4:43have two layers

4:44of four neurons. So we have eight neurons in this neural network. But 10 is the

4:49number of classes

4:51that we had. So the output is going to be 10. Let's go ahead and run this. So

4:55all this does.

4:56Okay, so this is this code. I wrote it a while ago. We don't need this anymore,

5:01because it's changed. The code has changed. So they updated it. So you don't

5:06need the input

5:06shape anymore. But I'm glad I had that there because I was able to explain that

5:10there was 28

5:11pixels by 28 pixels. Okay, so this has to do with optimization and the loss

5:16function. We're

5:17not going to talk about this right now. But what we're going to do here is

5:20train the model. So

5:22let me, okay, so right now I'm just going to take off callbacks. Well, actually

5:26, let me run this.

5:28And then I can run this again. That is not important for right now. But what is

5:32important,

5:32it's this part. This is the first epoch of 25. And this is where it's learning

5:38the patterns

5:38of all of the different classes that we looked at. This is the machine learning

5:43part in action.

5:45So what's happening is going through each one of these neural network layers,

5:49and it's adjusting those weights. And that's how the neurons are talking to

5:52each other.

5:53And then here you can see that we have a validation accuracy and in general

5:58accuracy. What this means

5:59is this is the performance of the model. So you can see that it's getting

6:02better and better and

6:03better. And here is being tested on unseen data. It's kind of like taking a

6:09test and

6:11memorizing the answers. You don't want to do that because then when you see new

6:15answers,

6:15you've never seen you'll do poorly. So that's why you want to compare the

6:19accuracy with the

6:20validation accuracy. The accuracy of this model is pretty good. It's already at

6:2470%. And it's also

6:26the same for validation accuracy. So when we get to the 25th epoch, we should

6:31be at a pretty good

6:32percentage. And this model will make predictions. For example, we give it a

6:37picture of, let's say,

6:38sandals or a shirt, it should accurately predict that. All right, so it got to

6:44the very end and it

6:45got to almost 74% and 71% for validation accuracy. That's pretty good. And the

6:52takeaway here is that

6:53you don't have to learn what the code does exactly. And my other courses, like

6:59introduction to machine

7:00learning and introduction to deep learning, we really code all of this together

7:05. So you understand

7:06every line of code. If you want to do that, then I've listed those courses as a

7:10resource.

7:11The reason we're doing this is because in AWS, it abstracts a lot of this. That

7:16means that

7:17you can just give it images and you could tell it what you want it to do. And

7:22it'll do it.

7:23I'm going to give you all of the foundational concepts that you need to not

7:27only pass the AWS

7:30certified AI practitioner, but also to build awesome AI applications and tools

7:37using AWS

7:39services. So I'll leave this link below this video so that you can run this

7:43code if you like.

7:44And you can take this code and put it into a large language model. It'll

7:48explain what normalization

7:49is, what one hot encoding is, if you want to learn more, you can do that. Or

7:54you can just take

7:54one of my courses, I'll leave it up to you. All right, so that's it for this

7:58video. And I'll

7:59I'll see you in the next video on generative AI.

What is Generative AI?

0:00Welcome back. Generative AI is probably one of the most exciting parts of AI.

0:06So let's take a look at the different parts of the architecture and also some

0:11of the fun stuff

0:12like Dolly that creates images. When I think about generative AI, I think about

0:17it not

0:18analyzing but instead creating like creating text, images, sound, movies, and

0:25even code.

0:26We discussed earlier vibe coding and that's where people that don't have any

0:31programming background

0:32can talk to the different language models to generate new code. And I've seen

0:38complete entire

0:39worlds where people are collaborating in a game environment flying multiple

0:44different aircraft.

0:45And I'm talking like thousands of people and that was built with code but no

0:50coding experiences.

0:51So generative AI has a definite magical quality to it. And it's powered by deep

0:57learning architectures

0:58like the transformer. And in the challenge, we're going to use generative AI to

1:04learn about the

1:05transformer. But also I'm going to show you a couple of visualizations that

1:09really show how

1:11the transformer architecture works. It's super fascinating. Just like humans

1:17have attention,

1:18this transformer architecture uses attention to create weight for each word.

1:25And it completely

1:26understands a whole entire sentence at once, unlike other architectures which

1:32go token by token.

1:33And they can't remember the context for very long. And we know that foundation

1:38models are trained

1:39on large scaled or unlabeled or mixed data. And they can be adaptable to

1:44specific tasks via fine

1:46tuning or prompting. And so prompting is one example of creating vibe coding.

1:53So what's happening

1:54behind the scenes? So you have all of this data which can be unlabeled or mixed

2:01data types,

2:02videos, text, images, or structured or unstructured data. And here the pre-

2:09trained, this is where

2:10there's fine tuning that can go on in the foundational model. And then that

2:14means that you can adapt

2:16it to text generation summarizing image generation, which we're going to look

2:21at now and chat GPT and

2:24question and answering. So here's an example of generative AI that's pretty

2:29well known,

2:30which is Dolly. And as you can see, this is an amazing image. And we create

2:34these with these

2:35prompts. For example, here is one that we can grab and then go to chats GPT and

2:42then paste it in

2:43here. And that I kind of like a little bit better than this one, to be honest,

2:48wow, that's pretty

2:48cool. So now here I created another prompt. Let's go ahead and run this and see

2:53what happens.

2:54A hyper realistic, highly detailed photograph of a lifelike T-Rex, smoothly

3:01roller skating on a

3:02sunny day in Central Park, New York City. And I use this dictate. So we just

3:07performed a speech

3:09to text. And now we're going to get this image. So I like this line here, other

3:13dinosaurs in the

3:14background with people running and terra dactyls in the sky. This should be

3:19pretty interesting.

3:20And that's pretty cool. So I'm definitely going to download this and add it to

3:24the skill.

3:25Now let's talk about the transformer models. And this is the very architecture

3:30that started at all.

3:32When chat GPT took off, that T and GPT stands for the transformer. And the

3:38transformer architecture,

3:40when they created the white paper, people really didn't take it serious. They

3:46didn't know that it

3:47was going to take off. And that's what's so cool about the white paper. And we

3:51'll talk about that

3:52white paper in the challenge so that you can create a podcast in that challenge

3:56so that you can learn

3:57more about the transformer architecture using generative AI. And what's cool

4:02about this

4:03transformer architecture is that it leverages hardware. And it wasn't until we

4:09had sufficient

4:10compute power that we saw the power of the transformer. So next time that you

4:15're totally amazed by

4:17chat GPT, that's because of the attention mechanism in the transformer. Let's

4:22check it out. The reason

4:24that the transformer changed everything is because the model pays attention to

4:29every word in a sentence

4:31and not just one at a time. And this is how chat GPT writes such good text and

4:37can understand

4:39context. So it understands the entire sentence at once instead of step by step,

4:45which is what

4:45RNNs did. And these RNNs or recurrent neural networks are the older models that

4:53processed

4:53words one at a time and they forgot earlier information. Then comes the

4:58transformer. And they

4:59look at the whole sentence at once. And this is called self attention. And we

5:04have it right here.

5:05And another cool attribute of the self attention mechanism is that it enables

5:11faster, more

5:12efficient training and generation. And it uses that attention mechanism to

5:17weigh which words in a

5:18sentence matter most. So here we have an input and it goes into an embedding.

5:24And this is how we

5:25convert text into a format that we can feed into the model. And then we have

5:31self attention. And

5:32this self attention then encodes the information, which is basically numbers,

5:38and then passes it to

5:39the decoder. And then it has the self attention again, and decodes it and then

5:44produces an output.

5:46And softmax is going to give you a list of words. So what it is is a

5:51probability distribution

5:53that says which one is the most probable, right? So that self attention

5:58mechanism is what gives the

5:59weight to these different words. Let's take a look at a visualization so that

6:04we could try to

6:05understand this a little bit better. Okay, so here we have the transformer

6:10explainer from polar club,

6:11which this allows us to go into great detail. I was just talking about the soft

6:17max probability

6:18distribution. And that's right here. So what it does is that it gives each word

6:23a different

6:24percentage. So here's softmax. And you can see that each word has a different

6:28percentage. And so

6:29it picks visualize. So data visualization empowers users to visualize. That's

6:35what's happening behind

6:37the scenes. So if I click on generate, you can see what's happening with the

6:41attention mechanism.

6:42And then you can see that it shows a comma because data visualization empowers

6:47users to visualize,

6:49comma, organize, comma, and visualize. So you see, it's literally taking you

6:56through and adding

6:58these embeddings. If you want to learn more about embeddings, it creates tokens

7:03, which are these

7:04numbers, and then it has positional encoding. And then that's what goes into

7:09the multi head

7:11self attention mechanism. And we're not going to get too far into this, but you

7:15can see the

7:15intention mechanism, which then takes all of these words and puts them into

7:20this probability

7:21distribution. And then it tells you that the next most probable word is going

7:25to be visualize.

7:26I will definitely link this so that you can play with it below and check this

7:30out. You can,

7:31it'll explain what it is more about embeddings, transformer blocks, and the

7:36output probabilities,

7:37the softmax, more visualizations, and tokens and tokenization. We're going to

7:42get into all of this

7:43stuff in a later scale. But I did want to give you this resource for now. All

7:48right, now on to

7:49diffusion models, diffusion models, generate images by starting with pure noise

7:55and gradually

7:56turning that noise into meaningful images. So there's two key steps. So the

8:02training. And this is where

8:03we take a real image and then slowly add noise until we get a box that

8:08resembles something like

8:11this. And the reason they do this is that the model learns how the noise

8:16changed the image. And

8:18then it can do this amazing thing by flipping it in reverse. So then it starts

8:24with noise here. And

8:26then it ends up with this image here. So the model reverses the noise step by

8:32step. And then we get

8:33that bunny image that was generated from this prompt using a diffusion model.

8:39And I'm getting

8:40all of these amazing visualizations from the Polo Club of data science. And if

8:45you scroll down,

8:47you'll see that this is where I got the transformer explainer. I'll definitely

8:51share this with you

8:52as well, because we also have the diffusion explainer. And this is showing you

8:57step by step how it goes

8:58from noise to an image. And this is the part where it reverses. This is not the

9:04training part. If you

9:05want to learn more, this goes into great detail. And this is a wonderful

9:10resource. So what are

9:11multi model models? So good examples are cloth three from anthropic, grok from

9:18X AI,

9:20Gemini from Google DeepMind. And they can understand more than one kind of

9:25input. So we're talking about

9:27a prompt, maybe an image or audio. And then you have this prompt generate a

9:33video with the picture,

9:34make the bunny speak in the included audio file. And then this multi model

9:40model will generate a

9:41video, including all of the different types of data. And it can generate words,

9:46pictures,

9:47audio. And in this case, video. And what's really exciting is that you can

9:51speak to the model,

9:53show it a photo, ask it to respond. And it will respond with text, voice,

9:58drawings, or videos.

9:59And one good example of a multi model model is lava, which is a large language

10:05and vision

10:06assistant. And you can check that out from old llama. So how do human brains

10:11compare to AI?

10:13I find it really useful when learning about AI to think about my biological

10:18neural network,

10:19because that's a form of reverse engineering. All of the software was created

10:25from us. So we can use

10:27their software and their algorithms to try to understand it by thinking about

10:32our biological

10:32version. So we can say when we're thinking about classic AI, that would be

10:39clear rules. If this

10:40happens, do that. If you're driving a car, you're probably going to see a red

10:44light. And that means

10:46stop. But when you're thinking like machine learning, this would be like

10:50learning that touching a hot

10:51pan hurts. So probably don't touch it again. Now when you're thinking about

10:56deep learning,

10:57this might be more subtle, like recognizing a pet that's in a different

11:02lighting. So you're

11:04in a darker surrounding at a park, but you can still recognize that that is

11:08your pet. And then

11:09finally generative AI, we can use what we've learned, like writing a poem

11:14painting a picture

11:16or coding from scratch. This allows us to create new things. So all of this is

11:21really not as foreign

11:23as it might seem. It really is a very intimate connection with biological

11:28neural networks and

11:29software modeled after the brain. Finally, we have some key machine learning

11:34terms to remember.

11:36So again, is a generative adversarial network. And it creates new synthetic

11:42data by learning to

11:44mimic the training data. You can think of it as a forger or a twin maker. And

11:50this is good for

11:51creating fake faces or synthetic art. And this is an example of that. If you

11:56look down here,

11:57it's a style again. This is definitely a fake face, because the website is

12:01called this person

12:03does not exist. So every time I reload this, you're going to get a different

12:07person. This is interesting,

12:08because this is a very young person, but they seem to have facial hair here. So

12:12you can kind of tell

12:13that's you don't usually see those giveaways. And these are great examples of a

12:17generative

12:18adversarial network. Next, we have GPT. And we talked about that because we

12:24looked at the

12:25transformer architecture, and we can think about chat GPT. Next, we have BERT.

12:31This is

12:31bi-directional encoder representation from Transformers. And this is very

12:36similar to chat GPT. But I

12:39would think of it more of a reading comprehension expert. It's really good for

12:44search classification

12:45and summaries. And then we have WaveNet. I like to think of WaveNet as a sound

12:50designer,

12:51because it's good for voice synthesis and music. And here we have ResNet, which

12:57I like to think of

12:57as a vision specialist. And it's a deep neural network built for recognizing

13:03images,

13:04detecting objects, and facial recognition. Next, we have XG Boost. And I like

13:09to think of this for

13:11tabular data prediction, because it's a fast and efficient version of gradient

13:16boosting,

13:16which is used for structured data. So data inside of tables. And then RNN, we

13:22talked about this

13:23briefly, which is a recurrent neural network. We were talking about the

13:28transformer model,

13:30and how good it is at understanding the context of sentences. We said that the

13:35older model,

13:36the RNN, wasn't as good, because it processes sequences like text or time-sene

13:42arest data,

13:43but it did so one at a time. And it's also useful in speech and forecasting,

13:49but it's not as good as

13:50the GPT because of the transformer architecture. And last but not least, we

13:56have the support

13:58vector machine, which is a classical algorithm. And you can think of this as a

14:02decision maker.

14:04It's good for binary classification. And it's mostly associated with early

14:09machine learning,

14:10used to classify data or make predictions. All right, so that's it for this

14:15video. And I will

14:16see you in the next video, which is the challenge.

Challenge 🎉

0:00Congrats on making it to the end of the skill and the challenge. This has been

0:04a

0:04fun skill for me. I hope you enjoyed it as well. There's so many mind-blowing

0:09concepts and AI tools and versions of artificial intelligence in this skill

0:15one after the other. So let's go ahead and switch gears. Right now we're gonna

0:20check out Google LM and we're going to check out the transformer architecture

0:25the white paper and try to create a podcast and it's something that's very

0:30useful for learning. Let me go ahead and break it down now. Alright so here we

0:35are notebook.google.com and all you need to do is search for attention is all

0:40you

0:40need and download this PDF and try to figure out how to make a podcast using

0:46notebook LM. It should be pretty straightforward and then after you do this

0:51I'll see you in the solution video in case you get stuck and there'll be some

0:55quiz questions to answer in the rest of the challenge. See you in the solution

Solution

0:00Alright, congrats on completing the challenge.

0:02And now let's go ahead and create a new notebook.

0:06I'm going to upload that attention is all you need PDF, white paper.

0:11And there it is.

0:12And you can do a bunch of stuff.

0:15You can actually type here and give it some more instructions or ask it

0:20questions.

0:21Or you can customize this audio overview.

0:25So you want to shorter.

0:26Let's do a shorter one.

0:28So you can add things here like you can say focus on a specific source or maybe

0:32target audience like

0:34explain it to me like I'm five years old.

0:37You can do all kinds of stuff.

0:38So let's just leave it like that.

0:40I'm just going to say shorter and then generate.

0:42And it'll take a few minutes and then you'll have a podcast and you can

0:46download it and you can

0:47share it with people.

0:48And this can be a useful educational assistant as well.

0:52Okay, until next time, I hope this has been informative and I'd like to thank

0:57you for viewing.

Team training path

Turn this skill into assignable team training

This free skill is a preview of the courses your team can assign, track, and report on with CBT Nuggets.

What's next?

Ready to keep going?

For your team

Bring this training to your team

See how CBT Nuggets helps IT teams close skills gaps, hit compliance targets, and prove training ROI.

Request a Demo

Just need AWS AI Practitioner? Enroll from $300/yr (19 skills)

Request a Demo