ACTL3143 & ACTL5111 Deep Learning for Actuaries
Lecture Outline
Artificial Intelligence
Deep Learning Successes (Images)
Deep Learning Successes (Text)
Classifying Machine Learning Tasks
Neural Networks
Artificial intelligence describes an agent which is capable of:
Thinking humanly | Thinking rationally |
Acting humanly | Acting rationally |
AI eventually become dominated by one approach, called machine learning, which itself is now dominated by deep learning (neural networks).
There are AI algorithms for simple tasks that don’t use machine learning though.
Source: Wikipedia page for the Shakey Project
At its core, a pathfinding method searches a graph by starting at one vertex and exploring adjacent nodes until the destination node is reached, generally with the intent of finding the cheapest route. Although graph searching methods such as a breadth-first search would find a route if given enough time, other methods, which “explore” the graph, would tend to reach the destination sooner. An analogy would be a person walking across a room; rather than examining every possible route in advance, the person would generally walk in the direction of the destination and only deviate from the path to avoid an obstruction, and make deviations as minor as possible. (Source: Wikipedia)
Source: Wikipedia page for the A* search algorithm.
Who’s winning this game?
5 × 1 = 5 | |
0 × 3 = 0 | |
2 × 3 = 6 | |
2 × 5 = 10 | |
0 × 9 = 0 | |
1 × 0 = 0 | |
White | 21 |
Just add up the pieces for each player.
6 × 1 = 6 | |
1 × 3 = 3 | |
1 × 3 = 3 | |
2 × 5 = 10 | |
0 × 9 = 0 | |
1 × 0 = 0 | |
Black | 22 |
Overall: 21 − 22 = −1.
Source: codeRtime, Programming a simple minimax chess engine in R, and Sebastian Lague (2018), Algorithms Explained – minimax and alpha-beta pruning.
Deep Blue (1997)
Sources: Mark Robert Anderson (2017), Twenty years on from Deep Blue vs Kasparov, The Conversation article, and Computer History Museum.
Tried making a computer smart, too hard!
Make a computer that can learn to be smart.
Source: Edureka (2020), AI Vs Machine Learning Vs Deep Learning Edureka.
“[Machine Learning is the] field of study that gives computers the ability to learn without being explicitly programmed” Arthur Samuel (1959)
Source: Randall Munroe (2017), xkcd #1838: Machine Learning.
Lecture Outline
Artificial Intelligence
Deep Learning Successes (Images)
Deep Learning Successes (Text)
Classifying Machine Learning Tasks
Neural Networks
What is this?
Options:
Note
Hover over the options to see AI’s prediction (i.e. the probability of the photo being in that category).
Source: Wikipedia
What is this?
Options:
Source: Wikipedia
What is this?
Options:
Source: Wikipedia
ImageNet and the ImageNet Large Scale Visual Recognition Challenge (ILSVRC); originally 1,000 synsets.
Source: James Briggs & Laura Carnevali, AlexNet and ImageNet: The Birth of Deep Learning, Embedding Methods for Image Search, Pinecone Blog
“Two years later, the first version of ImageNet was released with 12 million images structured and labeled in line with the WordNet ontology. If one person had annotated one image/minute and did nothing else in those two years (including sleeping or eating), it would have taken 22 years and 10 months.
To do this in under two years, Li turned to Amazon Mechanical Turk, a crowdsourcing platform where anyone can hire people from around the globe to perform tasks cost-effectively.”
Sources: Editors of Encyclopaedia Britannica, The Mechanical Turk: AI Marvel or Parlor Trick?, and
James Briggs & Laura Carnevali, AlexNet and ImageNet: The Birth of Deep Learning, Embedding Methods for Image Search, Pinecone Blog
A graphics processing unit (GPU)
“4.2. Training on multiple GPUs A single GTX 580 GPU has only 3GB of memory, which limits the maximum size of the networks that can be trained on it. It turns out that 1.2 million training examples are enough to train networks which are too big to fit on one GPU. Therefore we spread the net across two GPUs.”
Source: Krizhevsky, Sutskever and Hinton (2017), ImageNet Classification with Deep Convolutional Neural Networks, Communications of the ACM
Deep Blue was a win for AI, AlphaGo a win for ML.
I highly recommend this documentary about the event.
Source: Patrick House (2016), AlphaGo, Lee Sedol, and the Reassuring Future of Humans and Machines, New Yorker article.
https://thispersondoesnotexist.com/
Source: Dall-E 2 images, prompts by ACTL3143 students in 2022.
Same prompt: “A beautiful calm photorealistic view of an waterside metropolis that has been neglected for hundreds of years and is overgrown with nature”
Dall-E 3 rewrites it as: “Photo of a once-majestic metropolis by the water, now abandoned for centuries. The city’s skyscrapers and buildings are cloaked in thick green vines…”
Lecture Outline
Artificial Intelligence
Deep Learning Successes (Images)
Deep Learning Successes (Text)
Classifying Machine Learning Tasks
Neural Networks
Homework Get ChatGPT to:
Compare to Copilot.
Source: ChatGPT conversation.
Source: GitHub Blog
A student post from last year:
I strongly recommend taking a photo holding up your Academic Statement to your phone’s front facing camera when getting verified for the student account on GitHub. No other method of taking/uploading photo proofs worked for me. Furthermore, I had to make sure the name on the statement matched my profile exactly and also had to put in a bio.
Good luck with this potentially annoying process!
Homework It’s a slow process, so get this going early.
Source: GitHub Education for Students
Source: JetBrains, The State of Developer Ecosystem 2023.
Lecture Outline
Artificial Intelligence
Deep Learning Successes (Images)
Deep Learning Successes (Text)
Classifying Machine Learning Tasks
Neural Networks
New ones:
Source: Kaggle, Getting Started.
The main focus of this course.
Source: Matthew Gormley (2021), Introduction to Machine Learning Lecture Slides, Slide 67.
Data which ‘labels itself’. Example: language model.
Source: Amit Chaudhary (2020), Self Supervised Representation Learning in NLP.
Other examples: image super-resolution, denoising images.
See Liu et al. (2018), Image Inpainting for Irregular Holes using Partial Convolutions.
Source: Deoldify package.
Source: Deoldify package.
Lecture Outline
Artificial Intelligence
Deep Learning Successes (Images)
Deep Learning Successes (Text)
Classifying Machine Learning Tasks
Neural Networks
Source: Marcus Lautier (2022).
\begin{aligned} z~=~&x_1 \times w_1 + \\ &x_2 \times w_2 + \\ &x_3 \times w_3 . \end{aligned}
a = \begin{cases} z & \text{if } z > 0 \\ 0 & \text{if } z \leq 0 \end{cases}
Here, x_1, x_2, x_3 is just some fixed data.
The weights w_1, w_2, w_3 should be ‘learned’.
Source: Marcus Lautier (2022).
Source: Marcus Lautier (2022).
Brains and computers are binary, so make a perceptron with binary data. Seemed reasonable, impossible to train.
Replace binary state with continuous state. Still rather slow to train.
Note
It’s a neural network made of neurons, not a “neuron network”.
One can show that an MLP is a universal approximator, meaning it can model any suitably smooth function, given enough hidden units, to any desired level of accuracy (Hornik 1991). One can either make the model be “wide” or “deep”; the latter has some advantages…
Source: Murphy (2012), Machine Learning: A Probabilistic Perspective, 1st Ed, p. 566.
Doesn’t mean deep learning is always the best option!
Sources: Marcus Lautier (2022) & Fenjiro (2019), Face Id: Deep Learning for Face Recognition, Medium.
In this ANN, how many of the following are there:
What is the depth?
Source: Dertat (2017), Applied Deep Learning - Part 1: Artificial Neural Networks, Medium.
from watermark import watermark
print(watermark(python=True, packages="keras,matplotlib,numpy,pandas,seaborn,scipy,torch,tensorflow,tf_keras"))
Python implementation: CPython
Python version : 3.11.9
IPython version : 8.24.0
keras : 3.3.3
matplotlib: 3.9.0
numpy : 1.26.4
pandas : 2.2.2
seaborn : 0.13.2
scipy : 1.11.0
torch : 2.3.1
tensorflow: 2.16.1
tf_keras : 2.16.0