diff --git a/01-introduction.html b/01-introduction.html index b50c8622..867839ba 100644 --- a/01-introduction.html +++ b/01-introduction.html @@ -167,7 +167,6 @@


Introduction to Deep Learning

-

Last updated on 2024-02-14 | +

Last updated on 2024-02-23 | Edit this page

@@ -330,15 +329,9 @@

Objectives

are many more.

The techniques break down into two broad categories, predictors and classifiers. Predictors are used to predict a value (or set of values) -given a set of inputs, for example trying to predict the cost of -something given the economic conditions and the cost of raw materials or -predicting a country’s GDP given its life expectancy. Classifiers try to -classify data into different categories, or assign a label; for example, -deciding what characters are visible in a picture of some writing or if -an email or text message is spam or not.

-

Training Data -

-

Many, but not all, machine learning systems “learn” by taking a +given a set of inputs whereas classifiers try to classify data into +different categories, or assign a labelcond env.

+

Many, but not all, machine learning systems “learn” by taking a series of input data and output data and using it to form a model. The maths behind the machine learning doesn’t care what the data is as long as it can represented numerically or categorised. Some examples might @@ -377,18 +370,18 @@

Callout

Concept: Differentiation between traditional Machine Learning models and Deep Learning models:

-

Traditional ML algorithms can only use one (possibly -two layers) of data transformation to calculate an output (shallow -models). With high dimensional data and growing feature space (possible -set of values for any given feature), shallow models quickly run out of -layers to calculate outputs.

-

Deep neural networks (constructed with multiple -layers of neurons) are the extension of shallow models with three -layers: input, hidden, and outputs layers. The hidden layer is where -learning takes place. As a result, deep learning is best applied to -large datasets for training and prediction. As observations and feature -inputs decrease, shallow ML approaches begin to perform noticeably -better.

+

Traditional ML algorithms, known as shallow models, +are limited to just one or maybe two layers of data transformation to +generate an output. When dealing with complex data featuring high +dimensions and growing feature space (i.e. many attributes and an +expanding set of potential values for each feature), these shallow +models become limited in their ability to compute accurate outputs.

+

Deep neural networks are the extension of shallow +models with three layers: input, hidden, and outputs layers. The hidden +layer(s) is where learning takes place. As a result, deep learning is +best applied to large datasets for training and prediction. As +observations and feature inputs decrease, shallow ML approaches begin to +perform noticeably better.

@@ -418,10 +411,11 @@

Callout

Deep Learning Workflow


To apply Deep Learning to a problem there are several steps to go @@ -450,12 +444,12 @@

Step 3. Prepare dataEpisode 02 Introduction to Image Data.

For this lesson, we will use an existing image dataset known as -CIFAR-10. We will introduce this dataset and the different data -preparation tasks in more detail in the next episode but for this -introduction, we want to divide the data into training, -validation, and test subsets; -normalise the image pixel values to be between 0 and 1; and one-hot -encode our image labels.

+CIFAR-10 (Canadian Institute for Advanced Research). We will introduce +this dataset and the different data preparation tasks in more detail in +the next episode but for this introduction, we want to divide the data +into training, validation, and +test subsets; normalise the image pixel values to be +between 0 and 1; and one-hot encode our image labels.

Preparing the code

It is the goal of this training workshop to produce a Deep Learning @@ -467,28 +461,27 @@

Preparing the codePYTHON

# load the required packages
-from tensorflow import keras # library for neural networks 
-from sklearn.model_selection import train_test_split # library for splitting data into sets
-import matplotlib.pyplot as plt # library for plotting
-import numpy as np # library for working with images as arrays
-
-# load the CIFAR-10 dataset included with the keras library
-(train_images, train_labels), (test_images, test_labels) = keras.datasets.cifar10.load_data()
-
-# normalise the RGB values to be between 0 and 1
-train_images = train_images / 255.0
-test_images = test_images / 255.0
-
-# create a list of class names
-class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
-
-# one-hot encode labels
-train_labels = keras.utils.to_categorical(train_labels, len(class_names))
-val_labels = keras.utils.to_categorical(val_labels, len(class_names))
-
-# split the training data into training and validation sets
-# NOTE the function is train_test_split() but we are using it to split train into train and validation
-train_images, val_images, train_labels, val_labels = train_test_split(train_images, train_labels, test_size=0.2, random_state=42)
+from tensorflow import keras # for neural networks +from sklearn.model_selection import train_test_split # for splitting data into sets +import matplotlib.pyplot as plt # for plotting + +# load the CIFAR-10 dataset included with keras +(train_images, train_labels), (test_images, test_labels) = keras.datasets.cifar10.load_data() + +# normalise the RGB values to be between 0 and 1 +train_images = train_images / 255.0 +test_images = test_images / 255.0 + +# create a list of class names +class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] + +# one-hot encode labels +train_labels = keras.utils.to_categorical(train_labels, len(class_names)) +val_labels = keras.utils.to_categorical(val_labels, len(class_names)) + +# split the training data into training and validation sets +# NOTE the function is train_test_split() but we are using it to split train into train and validation +train_images, val_images, train_labels, val_labels = train_test_split(train_images, train_labels, test_size=0.2, random_state=42)
@@ -543,7 +536,7 @@

PYTHON