Share
Embed
Introduction to Machine Learning & Neural Network
Machine Learning?
Neural Network?
Let’s create a model!
Alexander M S
September 27, 2020
Transcript
38 slides
-
Introduction to Machine Learning & Neural Network DSC Universitas Komputer
Indonesia Alexander Manuel S DSC Lead Universitas Komputer Indonesia 2019/2020 lexmanuel.com -
Universitas Komputer Indonesia Deep learning e.g: Multilayer Perceptrons Representation Learning
e.g: Autoencoders Machine Learning e.g: Logistic Regression Artificial Intelegence e.g: Knowledge Base -> MYCIN (for treating blood infections, Stanford University) src: Deep Learning, Ian Good Fellow -
Universitas Komputer Indonesia Input Input Input Input Hand-designed features Hand-designed
program Features Simple features Output Mapping from features Mapping from features Additional layers of more abstract features Output *Shaded boxes indicate components that are able to learn from data. Output Mapping from features Output Classic machine learning Rule-based systems Representation learning Deep learning src: Deep Learning, Ian Good Fellow -
Universitas Komputer Indonesia Which approach to use? Machine Learning Machine
Learning Rules-based Predicting Salary based on Age -
Universitas Komputer Indonesia Which approach to use? Processing online payments
Machine Learning Rules-based Rules-based -
Universitas Komputer Indonesia Which approach to use? Process and analyze
natural language data. Machine Learning Rules-based Rules-based Machine Learning -
Universitas Komputer Indonesia Which approach to use? detecting face in
a photo Machine Learning Machine Learning Rules-based -
Universitas Komputer Indonesia First, Let’s Go Back Linear Regression For
predicting planets and pea growth 1800s Single Layer Perceptron Precursor to neural network 1940s 1960s Neural Network src: Coursera -
Universitas Komputer Indonesia Sigmoid activation function converts the weighted sum
to a value between 0 and 1. ReLU (Rectified Linear Unit) activation function often works a little better than a smooth function like the sigmoid, while also being significantly easier to compute. Common Activation Functions -
Universitas Komputer Indonesia A Tale of Neural Network Squeeze it
Take some image & do some preprocess Feed it to the model *oversimplified Checking how bad the model is • Takes the weights & biases as inputs • Measuring the differences (cost) between the prediction and what really is. • And take the average of it. • E.g: MSE • The model has weight, biases, and activations Calculate the gradient & updating the weight and biases , = 1 σ=1 (ෝ , ) • Chain rule • Partial derivative of the cost function respect to and • Calculate the updated and = = ≔ − ∗ ≔ − ∗ -
Universitas Komputer Indonesia Backpropagation Focus on the cat Cat’s ear
Cat’s mouth Dog’s mouth Dog’s ear = (0 ∗ 0 + ⋯ + −1 ∗ −1 + ) Increase the weight In proportion to activation function, “Neurons that fire together, wire together” 0.67 is a Cat Increase the bias Change activation function In proportion to weight, But we cannot change the activation function -
Universitas Komputer Indonesia Backpropagation Zooming out Cat’s ear Cat’s mouth
Dog’s mouth Dog’s ear 0.67 is a Cat 0.33 is a Dog 0 +0.56 -0.73 -0.09 1 +0.26 -0.10 +0.08 2 -0.41 +0.21 +0.31 +0.72 +0.43 +058 … …. … … -
Universitas Komputer Indonesia Gradient Descent Optimizing gradient descent +1 =
− ∗ ෝ ෝ + ෝ = 1 − 1 ෝ = 1 − 2 = 1 − 1 + 1 ∗ −1 = 1 − 2 2 + 2 ∗ −1 Adam Optimizer learning rate (α), β1, β2, dan Epsilon. -
Universitas Komputer Indonesia Preparing Dataset Training Data & Validation Data
Training Dataset: The sample of data used to fit the model. Validation Dataset: The sample of data that have never been seen by the model and will be used to validate the model while the model still in training -
Universitas Komputer Indonesia Preparing Dataset Training Data & Validation Data
Training accuracy Validation accuracy OVERFIT -
Universitas Komputer Indonesia Create the Neural Network • 1 input
layer that recieves images with the size of 160x160 and 3 channels with relu activation • 2 hidden layers, that consist of 200 and 60 neurons with relu activation • 1 output layer with sigmoid activation will give a probabality of binary classification model -
Universitas Komputer Indonesia Plot some charts • Validation accuracy is
~60% • Not overfitting • But underfitting -
Universitas Komputer Indonesia How to Improve 1. More data? 2.
Data Augmentation? 3. Better models? 4. Hyperparameter Tuning (Epoch, hidden units, layers, … )? -
Learn more about: • Gradient descent, here • Visualization of
Neural Net, here • In depth to Neural Net, here • Types of Loss function, here Books: • Deep Learning, Ian Goodfellow • Hands-On Machine Learning with Scikit-Learn and TensorFlow, Aurélien Géron techdevguide.withgoogle.com/paths/ machine-learning/ • ML crash course • Kaggle -
Feel free to connect DSC Universitas Komputer Indonesia lexmanuel.com linkedin.com/in/lexms
twitter.com/lexms_ Resources of this slides: • speakerdeck.com/lexmanuel • Notebook