AN INTRODUCTION TO DEEP LEARNING
BY
SUMIT JHA :: 2014FPM003
ONTOLOGY OF AI
• “CAN MACHINE THINK?”
• “ARE THERE IMAGINABLE DIGITAL COMPUTERS WHICH
WOULD DO WELL IN IMITATION GAME ?”
• “CAN ONE ARGUE AGAINST ALL MAJOR OBJECTIONS TO
THE PROPOSITION THE ‘MACHIN CAN THINK’ ?”
12/3/2018 2https://en.wikipedia.org/wiki/Computing_Machinery_and_Intelligence/
DEEP LEARNING IN ACTION
12/3/2018 3https://www.kaggle.com/c/ml1718-fashion-mnist
“Will play a short (2 minutes) video of DL execution in R Studio”
BA OR ML OR AI ???
12/3/2018 4https://365datascience.com/blog/
HANDS ON :: LET US ML (SUPERVISED LEARNING)
• IDE (R-STUDIO) SETUP,
REQUIRED LIBRARIES &
BASIC DATA STRUCTURE
• THREE WISE MEN : = , <- , %>%
& TWO TOUGH FIGHTERS : =
VS ==
• EVER CONFUSING – “Conquer
The Confusion Matrix”
12/3/2018 5
• Remove target variable from the
training data
• Reduce the amount of redundant
information
• Convert categorical information
to a numeric format
• Split dataset into testing and
training subsets
• Convert the cleaned data-frame
to a matrix
https://www.kaggle.com/rtatman/machine-learning-with-xgboost-in-r/notebook
WHAT ALL ML CAN & CAN’T DO ??
12/3/2018 6https://www.techleer.com/articles/203-machine-learning-algorithm-backbone-of-emerging-technologies/
HANDS ON :: The (maybe)First ML R Code
LM (package :: stats)
lm.r = lm(Income~Rent,
training_data)
predict(lm.r,test_data,
interval="confidence")
error matrices
ANN (package :: neuralnet)
ann.r = neuralnet(rating ~
calories + protein, training_data ,
hidden=3, threshold=0.001)
compute(ann.r, test_data)
error matrices
12/3/2018 7
ANN : THE BUILDING BLOCKS OF DEEP LEARNING (R Code)
1. f <- function(x)((x-min(x))/(max(x)-min(x)))
2. train_set_scaled <-apply(train_set, 2,f)
3. dev_set_scaled <- apply(dev_set, 2,f)
4. ann.r.withscale <- neuralnet(avg_training_score ~
no_of_trainings+age+previous_year_rating+length_of_service+KPI
s_met..80.+awards_won.+is_promoted, data = train_set_scaled)
5. pred_ann_dev <- compute(ann.r.withscale, dev_set_scaled)
12/3/2018 8
NEURAL NETWORKS OVERVIEW
12/3/2018 9https://www.cnblogs.com/ericxing/p/3860707.html /
BACKPROP*** (OPTIONAL)
12/3/2018 10https://twitter.com/KirkDBorne
TOP 10 MLALGO vs The NNs
Linear Algorithms:
• Algorithm 1: Linear Regression
• Algorithm 2: Logistic Regression
• Algorithm 3: Linear Discriminant Analysis
Nonlinear Algorithms:
• Algorithm 4: Naive Bayes
• Algorithm 5: Classification and Regression Trees
• Algorithm 6: K-Nearest Neighbors
• Algorithm 7: Learning Vector Quantization
• Algorithm 8: Support Vector Machines
Ensemble Algorithms:
• Algorithm 9: Bagged Decision Trees and Random Forest
• Algorithm 10: Boosting and AdaBoost
12/3/2018 11https://www.datasciencecentral.com/forum/topics/0-top-machine-learning-algorithms
ACCURACY OF “Many Classification Algorithms Using R” ON CAR EVALUATION DATASET
Naive Bayes : 0.8738
Logistic Regression : 0.9456
Linear Discriminant Analysis : 0.901
Mixture Discriminant Analysis : 0.9034
Regularized Discriminant Analysis : 0.8779
Flexible Discriminant Analysis : 0.8999
Neural Network : 0.9878
Support Vector Machine : 0.9688
k-Nearest Neighbors : 0.923
CART : 0.9439
C4.5 : 0.963
Boosted C5.0 : 0.9965
PART : 0.9826
Random Forest : 0.9988
Bagging CART : 0.9979
Gradient Boosted Machine : 0.70
12/3/2018 12https://github.com/surajvv12/17_Classification/commit/68b37fb1e2012d14391f14ed5fa53761f4b0a7cf
HANDS ON ( R – CODE FOR BASIC DEEP LEARING)
require(keras)
1. baseline_model <- keras_model_sequential() %>% layer_dense(units = 4, activation
= "relu", input_shape = 47) %>% layer_dense(units = 2, activation = "softmax")
2. baseline_model %>% compile( optimizer = "adam", loss =
"categorical_crossentropy",metrics = list("accuracy"))
3. baseline_history <- baseline_model %>% fit( train_data, train_labels, epochs = 5,
batch_size = 512, validation_data = list(val_data, val_labels),verbose = 2)
4. predictions <- baseline_model %>% predict(as.matrix(test))
12/3/2018 13
https://www.kdnuggets.com/2016/10/artificial-intelligence-deep-learning-neural-networks-explained.html
HANDS ON (MAGIC OF DEEP NET :: REAL WORLD SOLUTION)
12/3/2018 14https://in.axpcampus.com/AnalyzeThis/campusactivity/leaderboard.php
R vs PYTHON
• EASE (R)
• IDE for Windows (R)
• VISUALIZATION (R)
• SPEED (PYTHON)
• COMMUNITY(PYTHON)
• SALARY (PYTHON)
12/3/2018 15https://www.datacamp.com/community/tutorials/r-or-python-for-data-analysis
“Applications and Value of Deep Learning”
12/3/2018 16https://www.mckinsey.com/featured-insights/artificial-intelligence/notes-from-the-ai-frontier-applications-and-value-of-deep-learning
AUTOMATED MACHINE LEARNING
• SapFix – AUTO DEBUGGING :: Facebook
• NNI – NET SEARCH AND HYPERPARAMETER TUNING :: Microsoft
• Driverless AI – STATE-OF-ART AUTOMATION ON GPU :: H2O
• AUTO ML - ON CLOUD :: Google
12/3/2018 17https://www.kdnuggets.com/2018/07/automated-machine-learning-vs-automated-data-science.html
“A Deeper Dive into Deep Learning”
• “Multi-layer Perceptrons”
• “Deep Boltzmann machines”
• “Self-Organizing Maps”
• “Feed-forward Neural
Networks”
• “Convolutional Neural
Networks”
• “Recurrent Neural Network” or
LSTM
12/3/2018 18
https://www.kdnuggets.com/2016/10/artificial-intelligence-deep-learning-neural-networks-explained.html
ROCKstars of DEEP LEARNING AND AI
• Geoffrey Hinton :: Godfather of AI
• Ian Goodfellow :: GAN
• Andrej Karpathy :: Human Vs AI
• Satya Nadella :: “ Calls for AI Regulation of FR Technology ”
12/3/2018 19
SOME GOOD RESOURCES
• https://www.youtube.com/watch?v=aircAruvnKk&list=PLZHQObOWT
QDNU6R1_67000Dx_ZCJB-3pi
• https://www.datacamp.com/community/tutorials
• https://stackoverflow.com
• https://www.kaggle.com
• https://www.deeplearningbook.org *
• https://www.analyticsvidhya.com/blog/2018/09/heroes-deep-
learning-top-takeaways-andrew-ng-interview-series/
12/3/2018 20
THANK YOU 
12/3/2018 21

Deep learning

  • 1.
    AN INTRODUCTION TODEEP LEARNING BY SUMIT JHA :: 2014FPM003
  • 2.
    ONTOLOGY OF AI •“CAN MACHINE THINK?” • “ARE THERE IMAGINABLE DIGITAL COMPUTERS WHICH WOULD DO WELL IN IMITATION GAME ?” • “CAN ONE ARGUE AGAINST ALL MAJOR OBJECTIONS TO THE PROPOSITION THE ‘MACHIN CAN THINK’ ?” 12/3/2018 2https://en.wikipedia.org/wiki/Computing_Machinery_and_Intelligence/
  • 3.
    DEEP LEARNING INACTION 12/3/2018 3https://www.kaggle.com/c/ml1718-fashion-mnist “Will play a short (2 minutes) video of DL execution in R Studio”
  • 4.
    BA OR MLOR AI ??? 12/3/2018 4https://365datascience.com/blog/
  • 5.
    HANDS ON ::LET US ML (SUPERVISED LEARNING) • IDE (R-STUDIO) SETUP, REQUIRED LIBRARIES & BASIC DATA STRUCTURE • THREE WISE MEN : = , <- , %>% & TWO TOUGH FIGHTERS : = VS == • EVER CONFUSING – “Conquer The Confusion Matrix” 12/3/2018 5 • Remove target variable from the training data • Reduce the amount of redundant information • Convert categorical information to a numeric format • Split dataset into testing and training subsets • Convert the cleaned data-frame to a matrix https://www.kaggle.com/rtatman/machine-learning-with-xgboost-in-r/notebook
  • 6.
    WHAT ALL MLCAN & CAN’T DO ?? 12/3/2018 6https://www.techleer.com/articles/203-machine-learning-algorithm-backbone-of-emerging-technologies/
  • 7.
    HANDS ON ::The (maybe)First ML R Code LM (package :: stats) lm.r = lm(Income~Rent, training_data) predict(lm.r,test_data, interval="confidence") error matrices ANN (package :: neuralnet) ann.r = neuralnet(rating ~ calories + protein, training_data , hidden=3, threshold=0.001) compute(ann.r, test_data) error matrices 12/3/2018 7
  • 8.
    ANN : THEBUILDING BLOCKS OF DEEP LEARNING (R Code) 1. f <- function(x)((x-min(x))/(max(x)-min(x))) 2. train_set_scaled <-apply(train_set, 2,f) 3. dev_set_scaled <- apply(dev_set, 2,f) 4. ann.r.withscale <- neuralnet(avg_training_score ~ no_of_trainings+age+previous_year_rating+length_of_service+KPI s_met..80.+awards_won.+is_promoted, data = train_set_scaled) 5. pred_ann_dev <- compute(ann.r.withscale, dev_set_scaled) 12/3/2018 8
  • 9.
    NEURAL NETWORKS OVERVIEW 12/3/20189https://www.cnblogs.com/ericxing/p/3860707.html /
  • 10.
  • 11.
    TOP 10 MLALGOvs The NNs Linear Algorithms: • Algorithm 1: Linear Regression • Algorithm 2: Logistic Regression • Algorithm 3: Linear Discriminant Analysis Nonlinear Algorithms: • Algorithm 4: Naive Bayes • Algorithm 5: Classification and Regression Trees • Algorithm 6: K-Nearest Neighbors • Algorithm 7: Learning Vector Quantization • Algorithm 8: Support Vector Machines Ensemble Algorithms: • Algorithm 9: Bagged Decision Trees and Random Forest • Algorithm 10: Boosting and AdaBoost 12/3/2018 11https://www.datasciencecentral.com/forum/topics/0-top-machine-learning-algorithms
  • 12.
    ACCURACY OF “ManyClassification Algorithms Using R” ON CAR EVALUATION DATASET Naive Bayes : 0.8738 Logistic Regression : 0.9456 Linear Discriminant Analysis : 0.901 Mixture Discriminant Analysis : 0.9034 Regularized Discriminant Analysis : 0.8779 Flexible Discriminant Analysis : 0.8999 Neural Network : 0.9878 Support Vector Machine : 0.9688 k-Nearest Neighbors : 0.923 CART : 0.9439 C4.5 : 0.963 Boosted C5.0 : 0.9965 PART : 0.9826 Random Forest : 0.9988 Bagging CART : 0.9979 Gradient Boosted Machine : 0.70 12/3/2018 12https://github.com/surajvv12/17_Classification/commit/68b37fb1e2012d14391f14ed5fa53761f4b0a7cf
  • 13.
    HANDS ON (R – CODE FOR BASIC DEEP LEARING) require(keras) 1. baseline_model <- keras_model_sequential() %>% layer_dense(units = 4, activation = "relu", input_shape = 47) %>% layer_dense(units = 2, activation = "softmax") 2. baseline_model %>% compile( optimizer = "adam", loss = "categorical_crossentropy",metrics = list("accuracy")) 3. baseline_history <- baseline_model %>% fit( train_data, train_labels, epochs = 5, batch_size = 512, validation_data = list(val_data, val_labels),verbose = 2) 4. predictions <- baseline_model %>% predict(as.matrix(test)) 12/3/2018 13 https://www.kdnuggets.com/2016/10/artificial-intelligence-deep-learning-neural-networks-explained.html
  • 14.
    HANDS ON (MAGICOF DEEP NET :: REAL WORLD SOLUTION) 12/3/2018 14https://in.axpcampus.com/AnalyzeThis/campusactivity/leaderboard.php
  • 15.
    R vs PYTHON •EASE (R) • IDE for Windows (R) • VISUALIZATION (R) • SPEED (PYTHON) • COMMUNITY(PYTHON) • SALARY (PYTHON) 12/3/2018 15https://www.datacamp.com/community/tutorials/r-or-python-for-data-analysis
  • 16.
    “Applications and Valueof Deep Learning” 12/3/2018 16https://www.mckinsey.com/featured-insights/artificial-intelligence/notes-from-the-ai-frontier-applications-and-value-of-deep-learning
  • 17.
    AUTOMATED MACHINE LEARNING •SapFix – AUTO DEBUGGING :: Facebook • NNI – NET SEARCH AND HYPERPARAMETER TUNING :: Microsoft • Driverless AI – STATE-OF-ART AUTOMATION ON GPU :: H2O • AUTO ML - ON CLOUD :: Google 12/3/2018 17https://www.kdnuggets.com/2018/07/automated-machine-learning-vs-automated-data-science.html
  • 18.
    “A Deeper Diveinto Deep Learning” • “Multi-layer Perceptrons” • “Deep Boltzmann machines” • “Self-Organizing Maps” • “Feed-forward Neural Networks” • “Convolutional Neural Networks” • “Recurrent Neural Network” or LSTM 12/3/2018 18 https://www.kdnuggets.com/2016/10/artificial-intelligence-deep-learning-neural-networks-explained.html
  • 19.
    ROCKstars of DEEPLEARNING AND AI • Geoffrey Hinton :: Godfather of AI • Ian Goodfellow :: GAN • Andrej Karpathy :: Human Vs AI • Satya Nadella :: “ Calls for AI Regulation of FR Technology ” 12/3/2018 19
  • 20.
    SOME GOOD RESOURCES •https://www.youtube.com/watch?v=aircAruvnKk&list=PLZHQObOWT QDNU6R1_67000Dx_ZCJB-3pi • https://www.datacamp.com/community/tutorials • https://stackoverflow.com • https://www.kaggle.com • https://www.deeplearningbook.org * • https://www.analyticsvidhya.com/blog/2018/09/heroes-deep- learning-top-takeaways-andrew-ng-interview-series/ 12/3/2018 20
  • 21.