SlideShare una empresa de Scribd logo
1 de 32
vscentrum.be
Introduction to machine
learning/AI
Geert Jan Bex, Jan Ooghe, Ehsan Moravveji
Material
• All material available on GitHub
• this presentation
• conda environments
• Jupyter notebooks
2
https://github.com/gjbex/PRACE_ML
or
https://bit.ly/prace2019_ml
Introduction
• Machine learning is making great strides
• Large, good data sets
• Compute power
• Progress in algorithms
• Many interesting applications
• commericial
• scientific
• Links with artificial intelligence
• However, AI  machine learning
3
Machine learning tasks
• Supervised learning
• regression: predict numerical values
• classification: predict categorical values, i.e., labels
• Unsupervised learning
• clustering: group data according to "distance"
• association: find frequent co-occurrences
• link prediction: discover relationships in data
• data reduction: project features to fewer features
• Reinforcement learning
4
Regression
Colorize B&W images automatically
https://tinyclouds.org/colorize/
5
Classification
6
Object recognition
https://ai.googleblog.com/2014/09/buildin
g-deeper-understanding-of-images.html
Reinforcement
learning
Learning to play Break Out
https://www.youtube.com/watch?v=V1eY
niJ0Rnk
7
Clustering
Crime prediction using k-means
clustering
http://www.grdjournals.com/uploads/articl
e/GRDJE/V02/I05/0176/GRDJEV02I0501
76.pdf
8
Applications in
science
9
Machine learning algorithms
• Regression:
Ridge regression, Support Vector Machines, Random Forest,
Multilayer Neural Networks, Deep Neural Networks, ...
• Classification:
Naive Base, , Support Vector Machines,
Random Forest, Multilayer Neural Networks,
Deep Neural Networks, ...
• Clustering:
k-Means, Hierarchical Clustering, ...
10
Issues
• Many machine learning/AI projects fail
(Gartner claims 85 %)
• Ethics, e.g., Amazon has/had
sub-par employees fired by an AI
automatically
11
Reasons for failure
• Asking the wrong question
• Trying to solve the wrong problem
• Not having enough data
• Not having the right data
• Having too much data
• Hiring the wrong people
• Using the wrong tools
• Not having the right model
• Not having the right yardstick
12
Frameworks
• Programming languages
• Python
• R
• C++
• ...
• Many libraries
• scikit-learn
• PyTorch
• TensorFlow
• Keras
• …
13
classic machine learning
deep learning frameworks
Fast-evolving ecosystem!
scikit-learn
• Nice end-to-end framework
• data exploration (+ pandas + holoviews)
• data preprocessing (+ pandas)
• cleaning/missing values
• normalization
• training
• testing
• application
• "Classic" machine learning only
• https://scikit-learn.org/stable/
14
Keras
• High-level framework for deep learning
• TensorFlow backend
• Layer types
• dense
• convolutional
• pooling
• embedding
• recurrent
• activation
• …
• https://keras.io/
15
Data pipelines
• Data ingestion
• CSV/JSON/XML/H5 files, RDBMS, NoSQL, HTTP,...
• Data cleaning
• outliers/invalid values?  filter
• missing values?  impute
• Data transformation
• scaling/normalization
16
Must be done systematically
Supervised learning: methodology
• Select model, e.g., random forest, (deep) neural network, ...
• Train model, i.e., determine parameters
• Data: input + output
• training data  determine model parameters
• validation data  yardstick to avoid overfitting
• Test model
• Data: input + output
• testing data  final scoring of the model
• Production
• Data: input  predict output
17
Experiment with underfitting and overfitting:
010_underfitting_overfitting.ipynb
From neurons to ANNs
18
𝑦 = 𝜎
𝑖=1
𝑁
𝑤𝑖𝑥𝑖 + 𝑏
𝑥
𝜎 𝑥
activation function
𝑤1
𝑤2
𝑤3
𝑤𝑁
𝑥1
𝑥2
𝑥3
𝑥𝑁
...
𝑏
𝑦
+1
inspiration
Multilayer network
19
How to determine
weights?
Training: backpropagation
• Initialize weights "randomly"
• For all training epochs
• for all input-output in training set
• using input, compute output (forward)
• compare computed output with training output
• adapt weights (backward) to improve output
• if accuracy is good enough, stop
20
Task: handwritten digit recognition
• Input data
• grayscale image
• Output data
• digit 0, 1, ..., 9
• Training examples
• Test examples
21
Explore the data: 020_mnist_data_exploration.ipynb
First approach
• Data preprocessing
• Input data as 1D array
• output data as array with
one-hot encoding
• Model: multilayer perceptron
• 758 inputs
• dense hidden layer with 512 units
• ReLU activation function
• dense layer with 512 units
• ReLU activation function
• dense layer with 10 units
• SoftMax activation function
22
array([ 0.0, 0.0,..., 0.951, 0.533,..., 0.0, 0.0], dtype=f
5
array([ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], dtype=ui
Activation functions: 030_activation_functions.ipynb
Multilayer perceptron: 040_mnist_mlp.ipynb
Deep neural networks
• Many layers
• Features are learned, not given
• Low-level features combined into
high-level features
• Special types of layers
• convolutional
• drop-out
• recurrent
• ...
23
Convolutional neural networks
24
1 ⋯ 0
⋮ ⋱ ⋮
0 ⋯ 1

Convolution examples
25
1 ⋯ 0
⋮ ⋱ ⋮
0 ⋯ 1
0 ⋯ 1
⋮ ⋱ ⋮
1 ⋯ 0
1 ⋯ 0
⋮ ⋱ ⋮
0 ⋯ 1
0 ⋯ 1
⋮ ⋱ ⋮
1 ⋯ 0
Convolution: 050_convolution.ipynb
Second approach
• Data preprocessing
• Input data as 2D array
• output data as array with
one-hot encoding
• Model: convolutional neural
network (CNN)
• 28  28 inputs
• CNN layer with 32 filters 3  3
• ReLU activation function
• flatten layer
• dense layer with 10 units
• SoftMax activation function
26
array([[ 0.0, 0.0,..., 0.951, 0.533,..., 0.0, 0.0]], dtype
5
array([ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], dtype=ui
Convolutional neural network: 060_mnist_cnn.ipynb
Task: sentiment classification
• Input data
• movie review (English)
• Output data
• Training examples
• Test examples
27
Explore the data: 070_imdb_data_exploration.ipynb
/
<start> this film was just brilliant casting
location
scenery story direction everyone's really suited the
part
they played and you could just imagine being there
Robert
redford's is an amazing actor and now the same being
director
norman's father came from the same scottish island
as myself
so i loved the fact there was a real connection with
this
film the witty remarks throughout the film were
great it was
just brilliant so much that i bought the film as
soon as it

Word embedding
• Represent words as one-hot vectors
length = vocabulary size
• Word embeddings
• dense vector
• vector distance  semantic distance
• Training
• use context
• discover relations with surrounding
words
28
Issues:
• unwieldy
• no semantics
How to remember?
Manage history, network learns
• what to remember
• what to forget
Long-term correlations!
Use, e.g.,
• LSTM (Long Short-Term Memory
• GRU (Gated Recurrent Unit)
Deal with variable length input and/or
output
29
Gated Recurrent
Unit (GRU)
• Update gate
• Reset gate
• Current memory content
• Final memory/output
30
𝑧𝑡 = 𝜎 𝑊
𝑧𝑥𝑡 + 𝑈𝑧ℎ𝑡−1
𝑟𝑡 = 𝜎 𝑊
𝑟𝑥𝑡 + 𝑈𝑟ℎ𝑡−1
ℎ′𝑡 = tanh 𝑊𝑥𝑡 + 𝑟𝑡 ⊙ 𝑈ℎ𝑡−1
ℎ𝑡 = 𝑧𝑡 ⊙ ℎ𝑡−1 + 1 − 𝑧𝑡 ⊙ ℎ′𝑡
Approach
• Data preprocessing
• Input data as padded array
• output data as 0 or 1
• Model: recurrent neural network
(GRU)
• 100 inputs
• embedding layer, 5,000 words, 64
element representation length
• GRU layer, 64 units
• dropout layer, rate = 0.5
• dense layer, 1 output
• sigmoid activation function
31
Recurrent neural network: 080_imdb_rnn.pynb
Caveat
• InspiroBot (http://inspirobot.me/)
• "I am an artificial intelligence dedicated to generating unlimited amounts of unique inspirational quotes for endless
enrichment of pointless human existence".
32

Más contenido relacionado

Similar a prace_days_ml_2019.pptx

Deep Learning with Microsoft Cognitive Toolkit
Deep Learning with Microsoft Cognitive ToolkitDeep Learning with Microsoft Cognitive Toolkit
Deep Learning with Microsoft Cognitive ToolkitBarbara Fusinska
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017Roy Russo
 
2_Image Classification.pdf
2_Image Classification.pdf2_Image Classification.pdf
2_Image Classification.pdfFEG
 
Machine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy CrossMachine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy CrossAndrew Flatters
 
DL4J at Workday Meetup
DL4J at Workday MeetupDL4J at Workday Meetup
DL4J at Workday MeetupDavid Kale
 
Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications Intel Nervana
 
1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptxOmer Tariq
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tigerElizabeth Smith
 
Image Classification (20230411)
Image Classification (20230411)Image Classification (20230411)
Image Classification (20230411)FEG
 
Atom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at SupremindAtom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at SupremindAlluxio, Inc.
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tigerElizabeth Smith
 
Data Management - Full Stack Deep Learning
Data Management - Full Stack Deep LearningData Management - Full Stack Deep Learning
Data Management - Full Stack Deep LearningSergey Karayev
 
Agile Data Science: Hadoop Analytics Applications
Agile Data Science: Hadoop Analytics ApplicationsAgile Data Science: Hadoop Analytics Applications
Agile Data Science: Hadoop Analytics ApplicationsRussell Jurney
 
Agile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics ApplicationsAgile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics ApplicationsRussell Jurney
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage SystemsSATOSHI TAGOMORI
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkYan Xu
 
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014The Hive
 
Urs Köster - Convolutional and Recurrent Neural Networks
Urs Köster - Convolutional and Recurrent Neural NetworksUrs Köster - Convolutional and Recurrent Neural Networks
Urs Köster - Convolutional and Recurrent Neural NetworksIntel Nervana
 
Data Science meets Software Development
Data Science meets Software DevelopmentData Science meets Software Development
Data Science meets Software DevelopmentAlexis Seigneurin
 

Similar a prace_days_ml_2019.pptx (20)

Deep Learning with Microsoft Cognitive Toolkit
Deep Learning with Microsoft Cognitive ToolkitDeep Learning with Microsoft Cognitive Toolkit
Deep Learning with Microsoft Cognitive Toolkit
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
2_Image Classification.pdf
2_Image Classification.pdf2_Image Classification.pdf
2_Image Classification.pdf
 
Machine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy CrossMachine Learning with ML.NET and Azure - Andy Cross
Machine Learning with ML.NET and Azure - Andy Cross
 
DL4J at Workday Meetup
DL4J at Workday MeetupDL4J at Workday Meetup
DL4J at Workday Meetup
 
Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications
 
1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx
 
Deep Domain
Deep DomainDeep Domain
Deep Domain
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Image Classification (20230411)
Image Classification (20230411)Image Classification (20230411)
Image Classification (20230411)
 
Atom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at SupremindAtom: A cloud native deep learning platform at Supremind
Atom: A cloud native deep learning platform at Supremind
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Data Management - Full Stack Deep Learning
Data Management - Full Stack Deep LearningData Management - Full Stack Deep Learning
Data Management - Full Stack Deep Learning
 
Agile Data Science: Hadoop Analytics Applications
Agile Data Science: Hadoop Analytics ApplicationsAgile Data Science: Hadoop Analytics Applications
Agile Data Science: Hadoop Analytics Applications
 
Agile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics ApplicationsAgile Data Science: Building Hadoop Analytics Applications
Agile Data Science: Building Hadoop Analytics Applications
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural Network
 
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
Agile Data Science by Russell Jurney_ The Hive_Janruary 29 2014
 
Urs Köster - Convolutional and Recurrent Neural Networks
Urs Köster - Convolutional and Recurrent Neural NetworksUrs Köster - Convolutional and Recurrent Neural Networks
Urs Köster - Convolutional and Recurrent Neural Networks
 
Data Science meets Software Development
Data Science meets Software DevelopmentData Science meets Software Development
Data Science meets Software Development
 

Más de RohanBorgalli

Genetic Algorithms.ppt
Genetic Algorithms.pptGenetic Algorithms.ppt
Genetic Algorithms.pptRohanBorgalli
 
SHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.pptSHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.pptRohanBorgalli
 
Using Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.pptUsing Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.pptRohanBorgalli
 
02_Architectures_In_Context.ppt
02_Architectures_In_Context.ppt02_Architectures_In_Context.ppt
02_Architectures_In_Context.pptRohanBorgalli
 
Automobile-pathway.pptx
Automobile-pathway.pptxAutomobile-pathway.pptx
Automobile-pathway.pptxRohanBorgalli
 
Autoregressive Model.pptx
Autoregressive Model.pptxAutoregressive Model.pptx
Autoregressive Model.pptxRohanBorgalli
 
Dimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxDimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxRohanBorgalli
 
Time Series Analysis_slides.pdf
Time Series Analysis_slides.pdfTime Series Analysis_slides.pdf
Time Series Analysis_slides.pdfRohanBorgalli
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdfRohanBorgalli
 

Más de RohanBorgalli (14)

Genetic Algorithms.ppt
Genetic Algorithms.pptGenetic Algorithms.ppt
Genetic Algorithms.ppt
 
SHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.pptSHARP4_cNLP_Jun11.ppt
SHARP4_cNLP_Jun11.ppt
 
Using Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.pptUsing Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
Using Artificial Intelligence in the field of Diagnostics_Case Studies.ppt
 
02_Architectures_In_Context.ppt
02_Architectures_In_Context.ppt02_Architectures_In_Context.ppt
02_Architectures_In_Context.ppt
 
Automobile-pathway.pptx
Automobile-pathway.pptxAutomobile-pathway.pptx
Automobile-pathway.pptx
 
Autoregressive Model.pptx
Autoregressive Model.pptxAutoregressive Model.pptx
Autoregressive Model.pptx
 
IntrotoArduino.ppt
IntrotoArduino.pptIntrotoArduino.ppt
IntrotoArduino.ppt
 
Dimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptxDimension Reduction Introduction & PCA.pptx
Dimension Reduction Introduction & PCA.pptx
 
Telecom1.ppt
Telecom1.pptTelecom1.ppt
Telecom1.ppt
 
FactorAnalysis.ppt
FactorAnalysis.pptFactorAnalysis.ppt
FactorAnalysis.ppt
 
Time Series Analysis_slides.pdf
Time Series Analysis_slides.pdfTime Series Analysis_slides.pdf
Time Series Analysis_slides.pdf
 
Image captions.pptx
Image captions.pptxImage captions.pptx
Image captions.pptx
 
NNAF_DRK.pdf
NNAF_DRK.pdfNNAF_DRK.pdf
NNAF_DRK.pdf
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
 

Último

PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 

Último (20)

PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

prace_days_ml_2019.pptx

  • 1. vscentrum.be Introduction to machine learning/AI Geert Jan Bex, Jan Ooghe, Ehsan Moravveji
  • 2. Material • All material available on GitHub • this presentation • conda environments • Jupyter notebooks 2 https://github.com/gjbex/PRACE_ML or https://bit.ly/prace2019_ml
  • 3. Introduction • Machine learning is making great strides • Large, good data sets • Compute power • Progress in algorithms • Many interesting applications • commericial • scientific • Links with artificial intelligence • However, AI  machine learning 3
  • 4. Machine learning tasks • Supervised learning • regression: predict numerical values • classification: predict categorical values, i.e., labels • Unsupervised learning • clustering: group data according to "distance" • association: find frequent co-occurrences • link prediction: discover relationships in data • data reduction: project features to fewer features • Reinforcement learning 4
  • 5. Regression Colorize B&W images automatically https://tinyclouds.org/colorize/ 5
  • 7. Reinforcement learning Learning to play Break Out https://www.youtube.com/watch?v=V1eY niJ0Rnk 7
  • 8. Clustering Crime prediction using k-means clustering http://www.grdjournals.com/uploads/articl e/GRDJE/V02/I05/0176/GRDJEV02I0501 76.pdf 8
  • 10. Machine learning algorithms • Regression: Ridge regression, Support Vector Machines, Random Forest, Multilayer Neural Networks, Deep Neural Networks, ... • Classification: Naive Base, , Support Vector Machines, Random Forest, Multilayer Neural Networks, Deep Neural Networks, ... • Clustering: k-Means, Hierarchical Clustering, ... 10
  • 11. Issues • Many machine learning/AI projects fail (Gartner claims 85 %) • Ethics, e.g., Amazon has/had sub-par employees fired by an AI automatically 11
  • 12. Reasons for failure • Asking the wrong question • Trying to solve the wrong problem • Not having enough data • Not having the right data • Having too much data • Hiring the wrong people • Using the wrong tools • Not having the right model • Not having the right yardstick 12
  • 13. Frameworks • Programming languages • Python • R • C++ • ... • Many libraries • scikit-learn • PyTorch • TensorFlow • Keras • … 13 classic machine learning deep learning frameworks Fast-evolving ecosystem!
  • 14. scikit-learn • Nice end-to-end framework • data exploration (+ pandas + holoviews) • data preprocessing (+ pandas) • cleaning/missing values • normalization • training • testing • application • "Classic" machine learning only • https://scikit-learn.org/stable/ 14
  • 15. Keras • High-level framework for deep learning • TensorFlow backend • Layer types • dense • convolutional • pooling • embedding • recurrent • activation • … • https://keras.io/ 15
  • 16. Data pipelines • Data ingestion • CSV/JSON/XML/H5 files, RDBMS, NoSQL, HTTP,... • Data cleaning • outliers/invalid values?  filter • missing values?  impute • Data transformation • scaling/normalization 16 Must be done systematically
  • 17. Supervised learning: methodology • Select model, e.g., random forest, (deep) neural network, ... • Train model, i.e., determine parameters • Data: input + output • training data  determine model parameters • validation data  yardstick to avoid overfitting • Test model • Data: input + output • testing data  final scoring of the model • Production • Data: input  predict output 17 Experiment with underfitting and overfitting: 010_underfitting_overfitting.ipynb
  • 18. From neurons to ANNs 18 𝑦 = 𝜎 𝑖=1 𝑁 𝑤𝑖𝑥𝑖 + 𝑏 𝑥 𝜎 𝑥 activation function 𝑤1 𝑤2 𝑤3 𝑤𝑁 𝑥1 𝑥2 𝑥3 𝑥𝑁 ... 𝑏 𝑦 +1 inspiration
  • 19. Multilayer network 19 How to determine weights?
  • 20. Training: backpropagation • Initialize weights "randomly" • For all training epochs • for all input-output in training set • using input, compute output (forward) • compare computed output with training output • adapt weights (backward) to improve output • if accuracy is good enough, stop 20
  • 21. Task: handwritten digit recognition • Input data • grayscale image • Output data • digit 0, 1, ..., 9 • Training examples • Test examples 21 Explore the data: 020_mnist_data_exploration.ipynb
  • 22. First approach • Data preprocessing • Input data as 1D array • output data as array with one-hot encoding • Model: multilayer perceptron • 758 inputs • dense hidden layer with 512 units • ReLU activation function • dense layer with 512 units • ReLU activation function • dense layer with 10 units • SoftMax activation function 22 array([ 0.0, 0.0,..., 0.951, 0.533,..., 0.0, 0.0], dtype=f 5 array([ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], dtype=ui Activation functions: 030_activation_functions.ipynb Multilayer perceptron: 040_mnist_mlp.ipynb
  • 23. Deep neural networks • Many layers • Features are learned, not given • Low-level features combined into high-level features • Special types of layers • convolutional • drop-out • recurrent • ... 23
  • 24. Convolutional neural networks 24 1 ⋯ 0 ⋮ ⋱ ⋮ 0 ⋯ 1 
  • 25. Convolution examples 25 1 ⋯ 0 ⋮ ⋱ ⋮ 0 ⋯ 1 0 ⋯ 1 ⋮ ⋱ ⋮ 1 ⋯ 0 1 ⋯ 0 ⋮ ⋱ ⋮ 0 ⋯ 1 0 ⋯ 1 ⋮ ⋱ ⋮ 1 ⋯ 0 Convolution: 050_convolution.ipynb
  • 26. Second approach • Data preprocessing • Input data as 2D array • output data as array with one-hot encoding • Model: convolutional neural network (CNN) • 28  28 inputs • CNN layer with 32 filters 3  3 • ReLU activation function • flatten layer • dense layer with 10 units • SoftMax activation function 26 array([[ 0.0, 0.0,..., 0.951, 0.533,..., 0.0, 0.0]], dtype 5 array([ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], dtype=ui Convolutional neural network: 060_mnist_cnn.ipynb
  • 27. Task: sentiment classification • Input data • movie review (English) • Output data • Training examples • Test examples 27 Explore the data: 070_imdb_data_exploration.ipynb / <start> this film was just brilliant casting location scenery story direction everyone's really suited the part they played and you could just imagine being there Robert redford's is an amazing actor and now the same being director norman's father came from the same scottish island as myself so i loved the fact there was a real connection with this film the witty remarks throughout the film were great it was just brilliant so much that i bought the film as soon as it 
  • 28. Word embedding • Represent words as one-hot vectors length = vocabulary size • Word embeddings • dense vector • vector distance  semantic distance • Training • use context • discover relations with surrounding words 28 Issues: • unwieldy • no semantics
  • 29. How to remember? Manage history, network learns • what to remember • what to forget Long-term correlations! Use, e.g., • LSTM (Long Short-Term Memory • GRU (Gated Recurrent Unit) Deal with variable length input and/or output 29
  • 30. Gated Recurrent Unit (GRU) • Update gate • Reset gate • Current memory content • Final memory/output 30 𝑧𝑡 = 𝜎 𝑊 𝑧𝑥𝑡 + 𝑈𝑧ℎ𝑡−1 𝑟𝑡 = 𝜎 𝑊 𝑟𝑥𝑡 + 𝑈𝑟ℎ𝑡−1 ℎ′𝑡 = tanh 𝑊𝑥𝑡 + 𝑟𝑡 ⊙ 𝑈ℎ𝑡−1 ℎ𝑡 = 𝑧𝑡 ⊙ ℎ𝑡−1 + 1 − 𝑧𝑡 ⊙ ℎ′𝑡
  • 31. Approach • Data preprocessing • Input data as padded array • output data as 0 or 1 • Model: recurrent neural network (GRU) • 100 inputs • embedding layer, 5,000 words, 64 element representation length • GRU layer, 64 units • dropout layer, rate = 0.5 • dense layer, 1 output • sigmoid activation function 31 Recurrent neural network: 080_imdb_rnn.pynb
  • 32. Caveat • InspiroBot (http://inspirobot.me/) • "I am an artificial intelligence dedicated to generating unlimited amounts of unique inspirational quotes for endless enrichment of pointless human existence". 32

Notas del editor

  1. https://www.kdnuggets.com/2018/07/why-machine-learning-project-fail.html