AI, ML.Net,
GPT, Stable-
Diffusion
A leap around AI with
Dennis Vroegop
Don’t be afraid AI will steal your job…
Be afraid the other guy/girl who knows about
AI will steal it
A bit of history
Just adding some context
1956
At Dartmouth Conference, John McCarthy claims the term “AI” AI is born!
1980-1990
Expansion due to good hardware,
enabled neural networks
1990-2000
The rise of the internet
enabled huge scale up of
resources.
2000-2010
Deep learning and machine learning makes AI much more powerful
2018 - Today
OpenAI hugely improves communications, AI for the masses.
But… why?
What are we going to do with it?
2 billion cameras
connected to AI
• (NVIDIA said that by 2025 there will
be 2 billion video cameras in cities
around the world, they want to
connect those to gather data about
flow of traffic, crime and so on)
25% of the companies will
dedicate workers to oversee AI
systems
• (Gartner said, “AI continues to drive
change in how businesses and
governments interact with
customers and constituents”. AI is
already heavily used in spotting
breast cancer, in such a way that this
can be detected a year earlier than it
would have been normally
diagnosed)
AI Market will be over
$60 billion in 2025
• (Research company Tractica says the
AI market will skyrocket from $1.4
billion in 2016 to nearly $60 billion
in 2025, but markets related to AI
will grow as well. For instance,
Machine Learning as a Service will
be worth $19.9 billion by the same
year)
Smart Voice Assistants will be
in 15 billion devices in 2025.
• (RBC Capital Markets predicts Alexa
alone could be worth $20 billion
2025, both from sales and spending
on the Amazon AI platform)
AI in driverless cars could save 300,000
lives in America each decade
• (NVIDIA, Alphabet’s Waymo and
Tesla are already using computer
vision and deep learning
technologies to allow vehicles to
both react to what they see and learn
from their experiences. We’ll see a
huge decline in number of traffic
fatalities on the road)
30% of companies could have
their revenues reduced
• (Gartner predicts that companies
that perform software services right
now could become irrelevant, or a
least less useful, once machines start
figuring out how to do things better
and faster than they can. AI will
cannibalize revenues from some
current market leaders)
38% of jobs in the U.S. could be
vulnerable to AI by the early 2030s.
• (Price Waterhouse Coopers says that
the most at-risk jobs are in
transportation and storage,
manufacturing and wholesale and
retail)
Building a neural
network.
By hand…
Meet
Morris…
Our 9 year old Labradoodle,
who is afraid of water.
Rain in mm
and outside
time in
minutes
Other factors
• Have I already had my
steps today?
• What time of day is it?
Quantization
Rain (in mm) < 5 5-10 > 10
1 2 3
Steps done < 5000 5000-10000 >10000
1 2 3
Time of day Morning Afternoon Night
1 3 2
Input A
Input B
Input C
Output
A
B
C
Input A
Input B
Input C
Output
A
B
C
Input A
Input B
Input C
Output
A
1
B
2
C
3
Input A
Input B
Input C
Output
1
2
3
4
3
5
7
6
8
9
1
2
6
30
72
1
1
1
282
1
2
3
4
3
5
7
6
8
9
1
2
18
60
144
3
2
2
570
1
2
3
4
3
5
7
6
8
9
1
2
End results..
Walking time 5 – 10 minutes 10 – 20 minutes > 20 minutes
< -1.5 -1.5 – 0.8 > 0.8
2,5
1
-0,5
2
1
3
-0,5625
-1
-1
0,5
0,5
-1
0,5
-0,75
0,5
-0.75
-0.75
2,5
1
Party time!
We solved it!
How does it work?
I mean, internally…
“Old school”
“Knowledge systems…”
Introducing the neuron
The hero of our story
A
B
C
𝑆 =
𝑖=0
𝑛
𝑤
But a whole lot
of them…
• This simple model has:
• 8 inputs
• 3 hidden layers, each having 9
neuros
• 4 outputs
• 270 lines, thus weights
• 27 bias values
• In total 297 parameters…
What???
• Input: the number from your
model
• Bias: just a number to add to it
(weight)
• Activation Function: a simple
math function to apply
• Next Layer: do it all over
again, or use it as output
𝑆 =
𝑖=0
𝑛
𝑤
Activation functions
• Binary step: 0, if X < 0, or 1 if X > 0
• Linear Activation: f(x) = x
• Non-linear Activation: f(x) = sin(x)
• ReLU (Rectified Lineair Unit): f(x) = max(0,x)
• Parametric (ReLU): f(x) = max(ax, x)
• And so on…
Workflow…
(part 1)
• Create a model
• Set up number of input neurons
• Define number of layers
• Define number of neurons per layer
• Define number of output neurons
• Define initial weight / activation functions
• Define optimization model (more on this
later)
Workflow…
(part 2)
• Feed data into system
• Run through all layers
• Check outcome with known-results
• Tweak weights in neurons
• Do it all over again
Optimization
models
• There are hundreds of models
• Pick one that is ‘good enough’
• Each scenario requires its own
Machine
learning: it’s a
process, not a
tool!
WORKFLOW
Ask
Data
Clean
Train
Evaluate
Retrain
ASK THE
RIGHT
QUESTION
• Rephrase your question to
match ML paradigm
• Make it obvious
• Think of the genie in the lamp
FIND THE
RIGHT DATA
• Big data is the most-used
source
• Use sample data or pre-
selected data
• OpenData initiative
• In NLD: CBS data
• Google for ML Datasets and
be amazed
CLEAN UP
THE DATA
• Clean up missing values
• Substitute
• Remove rows
• Calculate medians / averages / and so on
• Remove outrages values
• Clip data
FIND THE
RIGHT
MODEL
• Anomaly detection
• Regression
• Clustering
• Two-class classification
• Multi-class classification
Let’s build
something
… and make it good!
Cats and dogs...
"Hello world" for AI Image Classification
Demo time!
Show me the code
ChatGPT
… or: the next step?
ChatGPT
• Chat… it’s about, uhm, chatting?
• Generative: it generates something
new
• Pre-trained: it has been trained
before
• Transformative: the model behind it
all
Generative
• The system generates
something new.
• Other options are:
• Predictive
• Classification
• … well, we’ve talked about
those
Pre-Trained
• It has been trained on a large
dataset
• Training was unsupervised
• Then finetuned on known samples
• Other options:
• Supervised learning: labeled
data
• Unsupervised. Used for
clustering
• And others…
Transformative
• The model.
• Lots of jargon about dual layer, each
with 2 sub-layers, that feed on each
other…
• If you really, really, want to
know:
[1706.03762] Attention Is All You
Need (arxiv.org)
Some numbers
• Trained on 45 terabytes of text
• 1.5 billion parameters
• Since released, answered over 1
billion questions
• Backed by Microsoft for over
$10.000.000.000
• A single training-run costs
$12.000.000
• Hit 1 million users in the first 5
days….
A demo
conversation
Stable Diffusion
Reverse AI, making new art
How it works:
• Generate non-uniform random noise
• Feed the keywords in a reverse
neural network
• Work back to see if parts of the
image fire certain regions
• Use an AI system to de-noise the
image
• Repeat de-noising until satisfied.
First we
generate
random
noise.
Then we
look for
boundaries.
(that satisfy our neurons)
The image
becomes
clear.
Almost
there…
Final result!
(Yes, I have
oversimplified
it massively…)
Try it out!
• Mage.Space. https://mage.space
• MidJourney Discord,
https://www.midjourney.com
• Stable-Diffusion running locally.
https://github.com/AUTOMATIC
1111/stable-diffusion-webui
• Dall-E (works slightly different,
same results)
https://labs.openai.com/
Conclusion
And thanks for listening!
Reach me at
dennis@vroegop.org

A leap around AI