Skip to content
CBT Nuggets

Explore Deep Learning Foundational Concepts

This skill provides an in-depth exploration of foundational deep learning concepts, building on prior knowledge of machine learning, Python, and TensorFlow. Key topics include artificial neurons, neural networks, convolutional neural networks (CNNs), and natural language processing (NLP). The course also touches on generative AI and large language models (LLMs), offering practical examples and TensorFlow code implementations to solidify understanding.

Full lesson from Introduction to Deep Learning. Preview the IT training 23,000+ organizations trust.

44m 7 Videos 7 Questions

Skill 1 of 38 in Introduction to Deep Learning

Welcome to the Introduction to Deep Learning course, where you'll Explore Deep Learning Foundational Concepts! This course follows the Introduction to Machine Learning course so you should have completed that course or have some basic Python and TensorFlow machine learning skills under your belt to get the most out of this course. In this first video, we'll review everything you're going to learn in this skill:

  • What is an Artificial Neuron?
  • What is Deep Learning?
  • Neural Network Basics
  • Convolutional Neural Networks (CNNs)
  • Natural Language Processing (NLP)

What is An Artificial Neuron?

From Wikipedia, "Artificial neurons are designed to mimic aspects of their biological counterparts. However a significant performance gap exists between biological and artificial neural networks." In short, it's code we write to mimic weighted synapses to make predictions.

Knowledge Check

Which of the following have inputs and outputs?

  1. AArtificial neurons
  2. BBiological neurons
  3. CBoth artificial and biological neurons
  4. DNone of these

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

What is Deep Learning?

In this video, we'll explore machine learning and its very popular subset, deep learning. We'll also take a sneak peak at Generative AI and Large Language Models(LLMs). See you there?

Knowledge Check

What is deep learning?

  1. AA subset of machine learning focused on artificial networks with multiple layers.
  2. BA subset of machine learning focused on newer and more powerful activation functions.
  3. CA subset of machine learning focused on supervised learning tasks.
  4. DA subset of machine learning focused on unsupervised learning tasks.

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

Neural Network Basics

In this video, we'll explore neural networks with TensorFlow code. If you feel that you already know this, skip ahead, otherwise this will serve as a review as we compare machine learning to deep learning models. See you there!

Knowledge Check

In TensorFlow, how would you start to build a basic neural network?

  1. Amodel = tf.keras.Sequential( )
  2. Bmodel = tf.keras.Flatten( )
  3. Cmodel = tf.keras.Conv2D( )
  4. Dmodel = tf.keras.Dense( )

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

Convolutional Neural Networks (CNNs)

In this video, we'll explore how convolutional neural networks work by looking at an image and comparing how our eyes work and how TensorFlow accomplishes these tasks. In the context of image classification, we'll explore Feature Extraction, Feature Enhancement, Complexity Reduction, and Classification.

Knowledge Check

Which of the following analyzes features in an image?

  1. AConv2D( )
  2. BMaxPooling2D( )
  3. CDense( )
  4. DSequential( )

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

Natural Language Processing (NLP)

In this video, we'll check out Andrej Karpathy's miniGPT and how we can implement it in TensorFlow. Let's do this!

Knowledge Check

What does Andrej Karpathy like to do?

  1. ATrain Deep Neural Nets on large datasets.
  2. BMake lots of money.
  3. CGo surfing, duh!
  4. DWrite code in C for Tesla's Full Self-Driving (FSD) program.

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

Code examples

# NNs

model = tf.keras.Sequential([
    tf.keras.Dense(64, activation='relu'),
    tf.keras.Dense(10, activation='softmax')
])


# Activation Function

tf.keras.Dense(64, activation='relu'),

# Forward Propagation

model = tf.keras.Sequential([
    tf.keras.Flatten(input_shape=(28, 28)),
    tf.keras.Dense(64, activation='relu'),
    tf.keras.Dense(10, activation='softmax')
])


# Loss Function

model.compile(optimizers='adam',
              loss='binary_crossentropy',
              metrics['accuracy'])


# Backpropagation and Gradient Descent

 model.fit(train_images, train_labels, epochs=5)


# Eval Model on Test Data

model.evaluate(train_images, train_labels)


# Convolutional Neural Netowrks (CNNs)

# Feat Extraction
tf.keras.layers.Conv2d(filters, kernel_size, activation)


# Enhancing
tf.keras.layers.Conv2d()


# Reduce Complexity
tf.keras.layers.MaxPooling2d(pool_size)


# Classification
tf.keras.layers.Dense(units, activation)

Challenge

It's time to check your knowledge of everything you have learned so far by completing the challenge questions below. Take a look at the image below and match each step to the appropriate plain language description.

Bridge over partially frozenriver in Winter
Bridge over partially frozenriver in Winter

Knowledge Check

Match the following terms to their respective descriptions outlining convolutional neural network (CNN) steps:

This interactive assessment is available in the full learning experience.

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

Knowledge Check

How would you rate the difficulty of this skill for you on a scale from 1 to 5, with 1 being very easy and 5 being very challenging?

This interactive assessment is available in the full learning experience.

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

View Transcript

Explore Deep Learning Foundational Concepts

0:00Hello and welcome to this skill on how to explore deep learning foundational

0:07concepts.

0:08This skill actually follows the introduction to machine learning course, so you

0:12do need

0:13to have some skills under your belt to get the most out of this.

0:17So let's go ahead and do that first and talk about the differences and make

0:22sure that we

0:23have those prerequisites covered.

0:25And then we'll talk about everything that we're going to learn in this skill.

0:29All right, so this is coming from the ML course.

0:31So that means that you should have some idea of Python and a feel comfortable

0:36programming

0:37Python and the different libraries like pandas, scikit and TensorFlow.

0:50And we will also cover PyTorch in another course.

0:54So here we're really just focusing on TensorFlow and all the related libraries.

1:00And we're going to be using Colab, but in a subsequent course, we're going to

1:04be using

1:05PyCharm.

1:06So if you're interested in the TensorFlow developer certificate, then

1:10definitely keep

1:10an eye out for that course coming up next.

1:13But for now we're going to be using this Colab environment, Google Colab, and

1:17this

1:17is what you would need to know before starting this course.

1:22But first, what is AI and how does deep learning fit into that?

1:26So let me just ask this question.

1:28What is AI?

1:32So we have data science.

1:38Then we talked about machine learning.

1:40So that's what you need to have some sort of foundation there.

1:44And what's interesting here is if you have a little bit of experience with

1:48machine learning,

1:49that means that you also have some experience with data science or data

1:53analysis.

1:54Because machine learning really takes a lot of the skills that you find in data

2:00science.

2:01So there's a lot of overlap here.

2:04Same thing with data analysis.

2:06So now we can talk about deep learning, which is a subset of machine learning.

2:13And that's what we're going to talk about in this skill.

2:15So before I do that, I want to point out that it's a subset of deep learning is

2:20gen AI.

2:23And which is super popular because another subset is LLMs.

2:29And you probably have heard of chat GPT.

2:33And while we're going to be focusing on deep learning, I did want to clarify

2:37that gen AI

2:38is a subset of deep learning and so are LLMs.

2:42So we're not really focusing on LLMs or gen AI at this time.

2:46We're focusing on deep learning and just making sure that you have machine

2:50learning

2:50skills under your belt, just to make sure that you get the most out of this

2:56course.

2:57Let's also compare traditional programming and compare that to AI.

3:09So let's just say AI here, just talking about machine learning and deep

3:13learning and things

3:14like that.

3:15But here you have a program where you write a bunch of scripts or lines of code

3:19and then

3:19you execute that.

3:21And then this program usually just needs to be executed.

3:26Whereas here we're actually passing in an input and we get an output.

3:35So this input is usually something like X and then we get an output Y.

3:40And in this case, it's a different structure.

3:43So it's a different process.

3:44So here we just have this input and then here we have our model.

3:49And this model does the magic and then passes out this output.

3:52We don't have to say anything about how to do that.

3:56That's why we build a model to do that for us.

3:58Whereas here we're explicitly programming.

4:02We're saying here do this.

4:04If this is happening, then do this and so on and so forth.

4:06So that's the main distinction here.

4:08And another important distinction here, I'm going to write ML and here is DL.

4:14So now that we know that in traditional programming, we have all these scripts

4:18or these lines

4:19of code that explicitly tell the program what to do.

4:22But with machine learning, we are basically making a prediction.

4:26You have this input X and then you get an output Y, which is that prediction.

4:31So what's the difference between machine learning and deep learning?

4:34Well, here we're doing the same thing except that we have many hidden layers.

4:45And we'll talk more about these hidden layers.

4:47This should be familiar if you're coming from the machine learning course.

4:51So we're going to the difference is that we're going to have many hidden layers

4:55.

4:56So machine learning and then deep learning really is just about deep neural

5:01networks.

5:02So we're going to use many neural networks.

5:04So that's where the main distinction is here.

5:08And as I said, this is the first skill.

5:12We're going to explore deep learning foundational concepts.

5:14And now that we have this out of the way, what we can do is really continue

5:18with what

5:19we're going to learn.

5:20And I just wanted to just say really quickly here that we will be creating

5:24another course

5:25for the TensorFlow developer certificate.

5:29So keep an eye out for that course coming up soon.

5:32So until then, we're going to talk about this skill and what are we going to

5:37learn in this

5:38skill?

5:40The first thing that we're going to learn is what is an artificial neuron

5:43because we're

5:44going to compare that to the human brain basically.

5:48Let me see if I can draw a brain here.

5:50And we're going to talk about neurons in the brain and then talk about it in

5:54the context

5:55of TensorFlow, really illuminating.

5:58And here we're going to talk about deep learning.

6:01So what is deep learning?

6:02And really dive deeper into those neural networks.

6:05And since we've brought up neural networks, we're going to dive into what are

6:08neural networks

6:09because we have many neural networks, but what really are they?

6:12And then we're going to talk about the different kinds such as deep neural

6:16networks, convolutional

6:17neural networks.

6:18And then we're going to talk about NLP, which is sort of a subset of a lot of

6:22these

6:23things.

6:24So a lot of really exciting stuff to talk about.

6:27And I will see you in the very first video where we talk about what is an

6:32artificial neuron.

What is An Artificial Neuron?

0:00Welcome back. In this video, what we're going to do is compare artificial

0:05neurons

0:05with biological neurons because, well, first of all, that's where we get the

0:09concept of an artificial neuron. And more importantly, we want to compare them

0:14because we're very far away from AGI, meaning that there's a lot more

0:20complexity

0:20to how a neuron works and we're using a very simple form of a neuron. So

0:26without

0:27further ado, let's dive into this. So what is an artificial neuron? And here, I

0:35'm

0:36going to say artificial neuron. And these are basically trying to mimic their

0:44biological counterparts, right? However, there's a huge gap. So we mentioned

0:49that.

0:49So this is nowhere near where the artificial neuron is nowhere near the

0:56biological sort of counterpart. So what we want to do here is kind of draw this

1:01out. So I'm going to try to draw this sort of neuron body here. And then here

1:08is

1:08this sheath and we'll talk about that. And then we have these sort of like

1:12terminals, right? I'm going to define these in just a second. And then here,

1:18this

1:18can go out like this. I've gotten a lot of experience doing this because this

1:24is

1:24what we've been talking about. So here is the body. So here, you can call this

1:29soma, which is the cell body. That's the technical term. And then these are

1:32called

1:32dentrites. And these are the axon terminals. And why am I going through all

1:43of this stuff with you? And so here, I'll explain that in one second. So

1:48here's the myelin sheaths. Let me just put these like this and they get

1:52stronger

1:53as more current goes back and forth. So the inputs, since this is why we're

1:59doing

2:00this, so we would take x whatever x is. And you would have x one, x two, so x n

2:07. So

2:07however many number of inputs that you have go into this neuron. And then they

2:13go through this direction, right up through the sheath into these outputs. And

2:18they get the output is here. And what happens is that it goes through these

2:24acts on terminals out. So this would be y one, y two, and basically y of n. Let

2:30me

2:31put these dots here. All right, so it's your as this becomes more and more used

2:38,

2:38these sheaths get stronger, and then this becomes more and more prevalent. Now,

2:42this is where we end the comparison because now we're going to take a look at

2:46the the counterpart, which is the artificial neuron. And one thing I noticed

2:53here, this is the I should define this, this is the biological neuron. All

3:01right,

3:01and what we're doing here is just talking about the comparison. Okay, so this

3:08is a

3:09biological neuron. And now let's take a look at the artificial neuron. To

3:15compare

3:15the artificial neuron, I'm going to create these little circles, which will

3:19help us to understand this. I'm going to say this is a B C and D. Okay, that

3:26looks

3:26like a B. And again, these are inputs, right? And when we're talking about the

3:34artificial neuron, we have to create these lines, right? And this goes into the

3:42, I

3:42would say this is the body, but really what this is, let me try it like this,

3:49and

3:49then, and label this, this is basically the sum of weighted inputs. And I'm

4:01going

4:01to put plus minus on each one of these. Okay, so this might be a review for you

4:09,

4:09and you might understand this. And so that's great, because every sort of, it's

4:14like a layers of paint. So the more layers of paint that you have, the thinner

4:19and

4:19the more layers, the better. All right, so now that we have these inputs that

4:24are

4:24coming in going into this, the cell body, you could say. And here, I'm going to

4:29add

4:30something that we're going to talk about in a second, which is bias. And then

4:34these

4:35are the weights. Okay, super important stuff. So now that we have these inputs,

4:42and it goes through the net input function, right? So the, the neuron basically

4:46adds

4:47up the weighted inputs, and it receives a, let's just say that it's done in a

4:53task

4:53appropriate way, right? Based on whatever output that we're looking for. And

4:57then

4:58it goes into, and this is another review, activation function. And what happens

5:09here is like, let's say that there's some sort of a threshold, right? Like

5:14right

5:14about here. So if it, if it's above that threshold, right, if it's here, then

5:19it's

5:19going to fire that that activation fire is going to fire. And that's what the

5:24biological neuron would do. And here, the artificial neuron when it fires, what

5:28it

5:28does, is that it produces a output, right? And so we can say here, output. That

5:36's

5:36the final step. So what is the weight in the bias? So here, when we're talking

5:41about the weights, the input values are modified, because we want them to

5:46reflect

5:46how important they are to the output, right? So these weights are going to take

5:52these inputs and give them different weights. Oh, this one's much more

5:55important than this one, right? And we'll get into this as we dive into the

5:59course. But once you have these weights, then we know how important each one of

6:04these inputs are. And then this bias over here is how the neuron learns through

6:10feedback. And what it does is that it makes adjustments to the weights, right?

6:15And the function values. So the, the activation function, or the, so I would

6:20say the bias is back propagation. Remember, we talked about this, how we take

6:27the

6:27output, and then we modify them, because this is a loop. And when we do that,

6:32we

6:32adjust the weights and the function values. And what this does is gives us a

6:37better and better output. For instance, let's say we're trying to bake a cake,

6:43somebody's birthday cake. And we need some ingredients. So if you think about

6:49it

6:49as an ingredients, we want to come up with a final flavor. So what we're doing

6:54is

6:54we're determining how much influence each ingredient will have on the cake,

7:00right? So you want three cups of flour, and maybe one teaspoon of salt, and so

7:07on.

7:08So you can see that these inputs that were going into the cake are going to

7:11have

7:11different weights, right? So this is a lot more important than this one. And

7:17conversely, if you're trying to figure out, in here, we're talking about bias,

7:22and if you're trying to figure out like how much a box weighs, right, and you

7:28have

7:28an average understanding that these boxes usually weighs around 50 pounds. So

7:34you

7:34can just start with that average number, and then adjust your guesses as you

7:38get

7:38more information, right? Like maybe, you know, what's in the box and things

7:43like

7:43that. And if the input is strong enough, then what happens is that it fires,

7:47and

7:47then it creates an output. Otherwise, it doesn't. And to review the weights are

7:52really the importance of the input inputs, like what are the values are

7:56important for each input? And then the bias is just how we use a starting point

8:02,

8:02basically, and start to make adjustments as we get in for more information. And

8:06then we create that cycle, right? That iterative cycle where we get better and

8:11better predictions. All right, so that's about in this video, and I will see

8:15you

8:15in the next video where we answer the question, what is deep learning? See you

What is Deep Learning?

0:00Welcome back. In this video, we're going to check out deep learning. I answer

0:05the question,

0:05"What is deep learning?" Because while we've covered it before in the intro

0:09really quickly,

0:11and we've talked about this before and it's a review, it's really important to

0:14get the

0:15nuances together before we move forward. So let's check that out.

0:20All right, so we're saying what is deep learning, but we're also thinking about

0:30this in the context

0:31of AI. So what is deep learning? And I'm just going to add AI here. Let me add

0:40this a little

0:40bit lower. So AI is the largest domain. So this is the-- oh, didn't get that

0:48circle

0:49in there. How about that? There we go. So here is AI, and this is like the

0:54largest sort of domain

0:55that I guess this term is a very general term, right? So it can mean a lot of

0:59things. So the

1:00first thing that means is machine learning. I guess we'll make that pretty big.

1:05So this would be

1:07ML. Let me write this over here. I think this will make more sense. And machine

1:14learning is,

1:14again, a broad field of AI focused on building systems. And what it does is

1:20make decisions based

1:22on data, right? So that can include supervised learning and unsupervised

1:28learning. And we'll talk

1:31about those real quick. And you may already know what these differences are.

1:38Again, this is a review.

1:39So here we're talking about data that has labels. So labeled data, and we're

1:43trying to make

1:44predictions after we train that data to un-seeing data. So it's going to train

1:50on labeled data and

1:51then make a prediction. Whereas unsupervised has no labels. And really what we

1:58're looking for is

1:59trying to discover patterns, right? Things that we don't know about the data.

2:05So it can do this

2:06for its on its on its own more or less. So these are the two main subcategories

2:12of ML. And we've

2:14already covered things like, and we're talking about supervised learning here.

2:18So we've talked

2:19about classification and regression, and in unsupervised learning, we haven't

2:24really gotten too far into

2:26that. So we can do things like clustering, which is basically taking a group of

2:30similar data points

2:31and clustering them together, and dimensionality reduction, which is basically

2:36simplifying data

2:37by reducing its features. And but the takeaway is that we're going to keep the

2:41most important

2:42information. So you're not taking away the important information, you're just

2:45simplifying data by

2:46reducing the features. All right, so that's ML in this really, in an overview,

2:53right? So then what

2:55is deep learning? So this circle here, we can say this would be deep learning.

3:00And inside of deep

3:01learning, we're focused on artificial neural networks with more multiple layers

3:07. So that's the

3:09difference between machine learning and deep learning. The deep part comes or

3:14is used because

3:15we're working with multiple layers. So deep learning can be applied to both

3:19supervised and

3:20unsupervised. So it's good to know. And it's awesome for complex tasks, and

3:25things like we'll cover,

3:26like image and speech recognition, NLP, which stands for natural language

3:32processing and others.

3:33And because of the popularity of LLMs, we're going to talk a little bit about

3:38Gen AI and LLMs,

3:41not because we wouldn't go into that too much in this course, but just to give

3:44you that context,

3:45because maybe you're interested in learning those, and we're not going to go

3:49into those

3:50too deeply in this course. But at least we can check out the high level

3:54overview of how they fit into

3:56all of this. And here, we can say, Gen AI, and then a smaller circle here for

4:05LLMs, right? And this

4:08LLM's we're referring to is things like chat GPT, they generatively create the

4:15completion and things

4:17like that. And again, this is simply a review to make sure that you have all of

4:23these concepts,

4:24because the learner, you are coming from different places. So I want to make

4:28sure that it cover all

4:29of these steps. So if this is familiar, you can skip through the video or skip

4:34the sections that

4:35you're familiar, but I would also recommend to just review them anyway. All

4:38right, I will see you in

4:39the next video. And on neural network basics, see you there.

Neural Network Basics

0:00Welcome back. In this video and in the next video, we're going to talk about

0:04neural networks

0:06and then deep neural networks. So I felt that the best way to handle that is to

0:12prepare

0:13for the next video by talking about neural network basics in this video. And we

0:17're going

0:17to do that by writing some tensor flow code, which again should be familiar.

0:21And that's

0:22going to allow us to kind of fly through this and really get a good

0:25understanding of neural

0:26network basics so we can dive into deep neural networks. Okay, so here is our

0:36collab notebook.

0:39And you should already have a collab notebook. And if you don't, just make sure

0:42that you're

0:42logged into your Gmail account and then navigate to Google, excuse me, collab.

0:50google.com.

0:51And in that way, you can get started. And then you want to just either you can

0:56copy this

0:57notebook or just create a new blank notebook. And again, this is not super

1:01important that

1:02you actually even open up a collab and start to write code because you're just

1:07going to

1:08follow along and you can actually get through this without using collab. But if

1:11you wanted

1:12to, then, and you don't have it set up, then that's how you can do it. I just

1:15want to make

1:15sure that I'm not like, you know, removing or like blocking opportunities for

1:19learning,

1:20right? So the direct opposite. All right, so what we're going to do is just

1:24write out

1:25a neural network. So a basic neural network and tensor flow. And we can just

1:29define this

1:30like we did in the previous or the introduction to machine learning course. So

1:35here we're

1:35just going to say TF dot Keras. And we're going to use that sequential API.

1:43Because

1:43it we're going to run this in a sequence. And then inside of this, what we're

1:45going to

1:46do is just pass in this object. And then we can say TF dot Keras dot dense. And

1:57I'm going

1:58to just create two of these real quick at a comma there. And this first one,

2:02what we're

2:03going to do is create, let's say 64 neurons in this first one. And then an

2:08activation

2:09function is going to be Ray loop. That's what we're using before. And that's

2:16our first

2:16layer. And what we're going to do here is the second layer, we're just going to

2:20add

2:2010 neurons. And just real quick, this is a part of the MNIST model. So it has

2:2710 outputs.

2:28So this is our output layer. So I just wanted to give you a heads up that that

2:31's why it's

2:3210. In case you were wondering. So the activation function here. It's going to

2:38be

2:39softmax. And if you recall from the earlier video, when we're drawing out the

2:51biological

2:51neuron and then the artificial neuron, we talked about the activation function

2:56and back

2:57propagation, forward propagation, and then adjusting the bias, right, or the

3:01bias adjusting

3:02the weights. And so we're going to go through as many of these as we can to try

3:06to tie those

3:06concepts up to some code. So here, it's this first layer, let me just grab this

3:13right here.

3:19This is the layer that is controlling the neurons output. So the activation

3:23function,

3:24if it gets to a point where it has an, it reaches a threshold, then it's going

3:29to activate.

3:29And what that means is going to pass through to the output. And in a sense,

3:35what we're

3:36doing is basically the neurons output. And that's what's going to make a better

3:40output.

3:41So let's continue down this and we're the activation that we're using here is

3:45Ray-Lue.

3:47And to define forward propagation, what we're going to do is just take that

3:50model and then

3:51add a little bit more to it. So what we're going to do first is add this, a

3:58first layer

3:59here that we didn't add before. And this is a layer that where we're flattening

4:04our input.

4:05And I'm going to say the input shape so that we can see what we're doing here

4:10is 28 by 28.

4:12And this is going to make more sense because we're going to be working with

4:15images. And this is

4:16the pixels, 28 by 28 pixels. And I do need to add a comma here. And let's see.

4:27Yeah, so this is good enough. And so what's happening here is that we're

4:30defining a sequential model.

4:31So it's going to go through these in sequence. And before we can get into back

4:37propagation,

4:38and that's the part where we send the data back to sort of update the weights,

4:43right, to so that

4:45we have a better sum of weighted inputs. We need to look at the loss function,

4:53then back

4:54propagation and gradient descent. So this is the four propagation where we take

4:59everything and pass

4:59it through in a sequence. And now we're going to add in the other steps. So let

5:05's go ahead and

5:06add a loss function, in this case, binary cross entropy. So model dot compile.

5:13Optimizers. And here, we're going to use Adam for the optimizer.

5:22comma. And then the loss. Here's where we define the binary cross entropy.

5:26function,

5:31And comma as well. And then here, finally, we're going to define the metrics.

5:41And what we've

5:43been using is accuracy. So let's use that. And now that we've set up our loss

5:51what we need to do is optimize, optimize model by minimizing the loss. So what

5:59we can do,

5:59with TensorFlow, is by using the internal models process, basically training.

6:05So we would say

6:06model dot fit train images. So this is the name. We haven't gone through this.

6:15So just

6:16understand that this is the input. The images and then train labels. So x, y.

6:23And then epochs is how many times that we're going to do this. So we're going

6:28to

6:28go through the data set five times. And when we do this, TensorFlow performs

6:36back propagation

6:37and gradient descent to optimize model. So that's what we're talking about. So

6:41then it goes through

6:42that iterative cycle, right? It updates the weights in the bias. And this cycle

6:49gives us better and

6:51better outputs. But you're probably asking yourself, what about deep neural

6:57networks?

6:58And that's exactly what we're going to talk about in the next video. See you

7:02there.

Convolutional Neural Networks (CNNs)

0:00Welcome back. This is probably the takeaway of this skill. However, the last

0:05video, the next one,

0:06is going to be a lot of fun. And we're going to talk about NLP. Here in this

0:11video, we're

0:11going to talk about convolutional neural networks. And we're going to talk

0:15about it conceptually.

0:16And then also side by side use a practical application. So we're going to look

0:22at a photo and try to

0:23do the same thing that a convolutional neural network is doing. And we're going

0:27to compare that

0:28with tensorflow code. Alright, so let's take a look at that and do this

0:33together. So first,

0:35I wanted to mention that we didn't do this. Let me comment this out. So we need

0:39to complete the

0:40code, which is basically the evaluation on the training and labeled data. But

0:45here is convolutional

0:47neural networks. And what we're going to do is write a little piece of code and

0:51then really talk

0:52about what our eyes are doing. Like, you know, when we look at this and also

0:57like what the steps

0:58are for a convolutional neural network to process and observe the scene.

1:04Alright, so to do that,

1:06we're going to start with, I guess, this would be feature extraction. And the

1:12way that we would

1:15do this is TF dot Keras, like we've done, and then layers. And here's where it

1:22's different,

1:23com 2d. And this is basically, it's the CNN layers that we're going to use here

1:33. And then it takes in

1:36filter or filters and kernel size. And then the activation. Okay, so let's talk

1:48about this step

1:49by step. So here's the idea. So we're going to look at this photo and try to

1:54scan different

1:55parts of this photo, like maybe the trees or the road or the color of the

2:00bushes, right? These

2:01are where this kind of stand out. This is obviously very colorful and stands

2:05out. This green does

2:07too, a little bit of red. So and then also this this shape, you know, the

2:11bushes going around the

2:12road. And just like our eyes are focusing on these different features, we're

2:18extracting those

2:19features, this piece of code up here is actually the com 2d is actually doing

2:24the same thing,

2:26right? And the filters and the kernel size is what determine the exact features

2:33, right? Like if

2:33we're looking at these bushes here or the road or something to that effect. So

2:39it's kind of like

2:41putting on, let's talk about the next step actually. So the next step would be

2:46enhancing the feature.

2:50And again, we're going to just be talking about this here, this object. And I

2:58guess we could do

2:59it like this if you want to be proper. And so what's happening here is that it

3:05's kind of like

3:06when we're using filters, it's like putting on some sunglasses, right, or like

3:10putting a visual

3:12filter in front of a camera, right? And what this does is it'll, if for example

3:18, with photography,

3:19it might accentuate the colors more, right? So we're basically enhancing

3:24certain features and

3:25specific features in that in that image. And that's all again happening with

3:29this com 2d,

3:31the convolutional neural networks. And then you might want to actually do the

3:36opposite, which is

3:38reduce complexity, which might be okay. So I've noticed all these individual

3:46features. And now I'm

3:46going to step back and try to see the big picture. Like what am I looking at

3:50here, right? It's okay.

3:51So this is some sort of a park and it's the betrayal. But you're not really

3:55looking at all the details,

3:56you're kind of ignoring those details. And this is called pooling, which we're

4:01going to talk about

4:02later, complexity. There we go. And here we're going to talk about, let me just

4:10grab this.

4:10And this is max pooling 2d. And maybe it might take in pool size, to that

4:23effect.

4:24So what's happening here? Well, what we're doing is reducing the size of the

4:30data by focusing on

4:31the most important features, right? Much like you would distill the scene,

4:37right? Like, okay,

4:38this is a park, but you're not like, Oh, I'm looking at this red, yellow. That

4:42's not going to tell you

4:42what the big picture is. But we haven't classified that. So we're not calling

4:47this a park, we're kind

4:48of stepping back and putting all of these objects together or these features

4:52together so that we

4:53can finally make a classification or classify this because we can, we've say

4:58that we've gathered

4:59the information, right, to make a decision or about the scene, such as the, you

5:06know, every

5:07individual feature that we've talked about, which is similar, like the decision

5:10making part of the

5:11brain. So we're going to now we're going to classify the image based on the

5:15features that we've

5:16actually extracted. Let's go through the list that we've extracted enhance and

5:21then we reduce their

5:23complexity. Now we can get into classification. And then we can say, Oh, this

5:31is a picture of a

5:32park with a trail. That code might look something like this, which again, this

5:42is whatever units

5:43and the activation function. So this should be familiar. And basically, we're

5:49classifying this

5:50image based on the features that we've analyzed, that we've extracted and

5:54enhanced and so on and so

5:55forth. All right, so that's about it for this video. And that's a conceptual

6:00and practical

6:01application of how this works. And I'll see you in the next video on NLP, which

6:07stands for natural

6:08language processing.

Natural Language Processing (NLP)

0:00Welcome back and congratulations on making it to the final video and the

0:05challenge,

0:06which is a little bit different than most challenges because this skill is

0:10mostly conceptual.

0:11So the challenge is going to be a conceptual challenge in the sense that you're

0:14going to answer

0:15questions or answer questions about conceptual, about concepts. There we go.

0:22Normally that these

0:23challenges are like code base, you do something, right? They're like steps and

0:27you get to do something

0:28and then you execute that code and you see if you did it or not, you know? And

0:32then I show you

0:33that solution. But in this case, it's just going to be quiz questions testing

0:37you on the concept

0:38or giving you a challenge, I should say, on that concept. But before we do that

0:42, we're going to

0:43dive into NLP, which stands for natural language processing. And we're going to

0:49talk about mini

0:50GPT, which is going to be awesome. It's a lot of fun. So let's do this.

0:57All right, so this is mini GPT down here. And we're going to talk about this.

1:02But here is saying that

1:03it's a pie torch reimplementation of GPT from scratch, basically, both training

1:08and inference. And it

1:11tries to be small, clean, interpretable, and educational, which is pretty

1:14awesome. So if you

1:15want to read more about this, definitely check it out. You can go to github.com

1:20/carpathie/mini GPT.

1:23GPT is all caps. And this link will also be below the video. But let me show

1:30you this

1:31github first that you should definitely follow. This is Andre Carpathie. So

1:36here it says,

1:37"I like to train deep neural nets on large data sets, and this is true. And I

1:42would definitely

1:43follow him on Twitter as well. He's also the lead at the..." I guess I'm not

1:51sure what the title is,

1:52but he's the head of AI at Tesla and working on this full self-driving and FSD

2:00and all that

2:00good stuff. So this is something somebody should definitely follow if you want

2:04to learn more about

2:05deep neural nets. Because if you follow him on Twitter, you're going to get

2:09updates about new

2:09things happening almost every week, sometimes every day. Not necessarily from

2:14Andre personally,

2:15but there's a lot going on in this space. All right, so now back to mini GPT.

2:20So mini GPT,

2:21let me go all the way back up here. You can see here that there's a lot of code

2:26. And what this

2:26is trying to do is showing you how to do this from scratch. So it says here

2:31that trains a GPT

2:32from scratch to add a number inspired by the addition of section in the GPT

2:36three paper.

2:37So this is really cool. There's a lot of information. I'm not going to really

2:41get into all of this

2:41here. What we're going to do is a little bit different. I'm going to take you

2:46through a tensor

2:47flow sort of tutorial on how to do this, but in tensor flow. And this is

2:53something that is going

2:54to be conceptual. And I'm just going to write it out and the dried out in the

2:58blackboard.

2:59But this is something that you could actually do. So after you take this course

3:02, you could

3:03actually go back to this and try to recreate this using tensor flow. You'll see

3:08what I mean

3:08when we outline this together. All right, so let's draw this out. So number one

3:14, step one would be

3:17data pre-processing. And so we would take that text data and start pre-

3:26processing it. And what

3:29does that mean? Tokenization or tokenizing. And this is basically creating and

3:36basically

3:37word chunks that we can connect them together, like words and characters. And

3:46you convert

3:47these into numbers. Right? So we're very familiar with that. Oops, let me write

3:53this correctly numbers.

3:54In step two, we're going to build a model. And we've done this a bunch with

3:59tensor flow. And

4:01what's cool here is that we can build a simplified transformer model. Right?

4:05And this is really

4:07important for handling sequential data. So here we're going to say transformer.

4:16Which is the attention mechanism.

4:19And we've already talked about that. But definitely, if you want to refresh her

4:26,

4:27check it out transformer attention mechanism or the paper attention is all you

4:31need.

4:32And this is basically showing you how deep learning models can learn from

4:37basically language text, language data, right? And this is basically learning

4:44from language

4:44patterns. And that's an NLP task. So we can see that. All right, then number

4:50three, we train the model.

4:51And then number four, this is the evaluation and inference.

4:59Okay, so here, when we're training the model on the pre-process data, we

5:07configure an optimizer,

5:12loss function. And then we run the training loop. Okay, so I'm just going to

5:21make a loop like this.

5:22And then finally, we measure the performance, right? Because we want to improve

5:33it to get it to the

5:33point where we can actually release this. And that allows us to have a model

5:38that can

5:40perform NLP tasks like generating coherent tasks without any problems, right?

5:45And this is just a

5:46quick example of how you can use Carpathi's tutorial and TensorFlow to build

5:52and to better

5:52understand neural networks, right, in the context of NLP tasks. So I just kind

5:59of wanted to lay that

6:00out and to show you how they're related NLP and deep learning how you can,

6:04their subsets,

6:05we've talked about that. And we're not going to get too deep into that in this

6:08course. We will

6:09get into NLP, but not so much generative AI and GPT sort of models. We did

6:15cover that a little bit

6:16in the introduction to machine learning course because it just came out. And I

6:19felt like, well,

6:20better cover this a little bit because otherwise you're going to want to do

6:24that. So we covered

6:25it a little bit, but we're going to dive deeper into NLP because that's a

6:28better path to fully

6:29understand deep learning and then get into NLP and then you can get into LLMs.

6:34All right,

6:34Until next time, I hope this has been informative and I'd like to thank you for

6:37viewing.

Challenge

0:00Congratulations on making it to the end of this skill and the challenge.

0:05And before we start the challenge, I just want to sort of front load that this

0:09is a different challenge.

0:11Most of the challenges are going to be code-based or task-based where you have

0:16a challenge and you do something and then you execute the code and then you'll

0:19see whether or not you did something or with the performances, something like

0:22that.

0:23And then it also includes a solution video. In this case, there's no solution

0:27video because we're just going through a concept or the various concepts and

0:31using it in this example where we look at a picture and we go through how we

0:35would look at that picture and then compare it to what we would do in Tensor

0:38Flow when working with a convolutional neural network.

0:42Alright, so you got this, go ahead and check out the picture, the description

0:46and answer the questions and then you're done. And until next time, I hope this

0:50has been informative. I'd like to thank you for viewing.

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 Introduction to Deep Learning? Enroll from $300/yr (38 skills)

Request a Demo