deep neural nets and keras
play

Deep Neural Nets and Keras Pavel Krmer 1 Data Science Summer School - PowerPoint PPT Presentation

Deep Neural Nets and Keras Pavel Krmer 1 Data Science Summer School @ Uni Vienna 1 Dept. of Computer Science, VB - Technical University of Ostrava, Ostrava, Czech Republic pavel.kromer@vsb.cz Outline Keras handson About Installation


  1. Deep Neural Nets and Keras Pavel Krömer 1 Data Science Summer School @ Uni Vienna 1 Dept. of Computer Science, VŠB - Technical University of Ostrava, Ostrava, Czech Republic pavel.kromer@vsb.cz

  2. Outline Keras hands–on About Installation Keras Fun with puppies, kitties, and DNNs Components September 04 2018, Vienna, AT 2

  3. About September 04 2018, Vienna, AT 2

  4. Introduction (Deep) artificial neural networks are among the most successful machine–learning models. They are universal tools that can be used for supervised and/or unsupervised learning. September 04 2018, Vienna, AT 3

  5. Artificial neural networks Artificial neural network • a computational model evaluating a parametric function composed of many other parametric (sub)functions • composed of many information processing units, organized into interconnected layers • one unit solves a linearly separable problem, i.e. draws a hyperplane in an n − dimensional space September 04 2018, Vienna, AT 4

  6. Keras September 04 2018, Vienna, AT 4

  7. • easy prototyping • support for convolutional and recurrent nets • accellerated by multicore and GPU Powered by a backend • Tensorflow (default) • Theano • others (CNTK) Keras Keras is a high-level neural networks API written in Python. September 04 2018, Vienna, AT 5

  8. Powered by a backend • Tensorflow (default) • Theano • others (CNTK) Keras Keras is a high-level neural networks API written in Python. • easy prototyping • support for convolutional and recurrent nets • accellerated by multicore and GPU September 04 2018, Vienna, AT 5

  9. Keras Keras is a high-level neural networks API written in Python. • easy prototyping • support for convolutional and recurrent nets • accellerated by multicore and GPU Powered by a backend • Tensorflow (default) • Theano • others (CNTK) September 04 2018, Vienna, AT 5

  10. • one can cheat in it Keras (cont.) My favourite because https://s3.amazonaws.com/assets.datacamp.com/ blog_assets/Keras_Cheat_Sheet_Python.pdf • sufficiently high–level (for my taste) • allows mixing–in with the wonderfull Python ecosystem (scikit, matplotlib, …) • is programmer oriented • well–documented, with lots of examples September 04 2018, Vienna, AT 6

  11. Keras (cont.) My favourite because https://s3.amazonaws.com/assets.datacamp.com/ blog_assets/Keras_Cheat_Sheet_Python.pdf • sufficiently high–level (for my taste) • allows mixing–in with the wonderfull Python ecosystem (scikit, matplotlib, …) • is programmer oriented • well–documented, with lots of examples • one can cheat in it September 04 2018, Vienna, AT 6

  12. • individual levels that define the architecture and functionality of the Model • different types, properties, params, functions • Dense layers (this is the normal, fully-connected layer) • Convolutional layers (applies convolution operations on the previous layer) • Pooling layers (used after convolutional layers) • Dropout layers (regularization, prevent overfitting) Keras components Model Layers • THE (deep) neural network you want to use • a stack of connected layers • sequential API × the bare Model class September 04 2018, Vienna, AT 7

  13. Keras components Model Layers • THE (deep) neural network you want to use • a stack of connected layers • sequential API × the bare Model class • individual levels that define the architecture and functionality of the Model • different types, properties, params, functions • Dense layers (this is the normal, fully-connected layer) • Convolutional layers (applies convolution operations on the previous layer) • Pooling layers (used after convolutional layers) • Dropout layers (regularization, prevent overfitting) September 04 2018, Vienna, AT 7

  14. • weight update strategies in the training process • stochastic gradient descent, RMSProp, Adagrad Keras components (cont.) Loss functions Optimizers • compare the predicted output with the real output in each pass of the training algorithm • tell the model how the weights should be updated • mean–squared error, cross–entropy, … September 04 2018, Vienna, AT 8

  15. Keras components (cont.) Loss functions Optimizers • compare the predicted output with the real output in each pass of the training algorithm • tell the model how the weights should be updated • mean–squared error, cross–entropy, … • weight update strategies in the training process • stochastic gradient descent, RMSProp, Adagrad September 04 2018, Vienna, AT 8

  16. Keras hands–on September 04 2018, Vienna, AT 8

  17. pip install tensorflow pip install keras pip install msgpack argparse pydot conda install keras conda install pydot Installation (Fairly) easy steps • Get Python (Anaconda highly recommended: https://www.anaconda.com/download/ ) • Get TensorFlow ( https://www.tensorflow.org/install/ ) • Get Keras ( https://keras.io/ ) September 04 2018, Vienna, AT 9

  18. pip install msgpack argparse pydot conda install keras conda install pydot Installation (Fairly) easy steps • Get Python (Anaconda highly recommended: https://www.anaconda.com/download/ ) • Get TensorFlow ( https://www.tensorflow.org/install/ ) • Get Keras ( https://keras.io/ ) pip install tensorflow pip install keras September 04 2018, Vienna, AT 9

  19. conda install keras conda install pydot Installation (Fairly) easy steps • Get Python (Anaconda highly recommended: https://www.anaconda.com/download/ ) • Get TensorFlow ( https://www.tensorflow.org/install/ ) • Get Keras ( https://keras.io/ ) pip install tensorflow pip install keras pip install msgpack argparse pydot September 04 2018, Vienna, AT 9

  20. Installation (Fairly) easy steps • Get Python (Anaconda highly recommended: https://www.anaconda.com/download/ ) • Get TensorFlow ( https://www.tensorflow.org/install/ ) • Get Keras ( https://keras.io/ ) pip install tensorflow pip install keras pip install msgpack argparse pydot conda install keras conda install pydot September 04 2018, Vienna, AT 9

  21. Published on Kaggle in 2014, contains 25,000 images of cats and dogs. To make it a bit harder, we use only 1000 training images of each class. The mother of all classification demos: cats vs. dogs September 04 2018, Vienna, AT 10

  22. To make it a bit harder, we use only 1000 training images of each class. The mother of all classification demos: cats vs. dogs Published on Kaggle in 2014, contains 25,000 images of cats and dogs. September 04 2018, Vienna, AT 10

  23. The mother of all classification demos: cats vs. dogs Published on Kaggle in 2014, contains 25,000 images of cats and dogs. To make it a bit harder, we use only 1000 training images of each class. September 04 2018, Vienna, AT 10

  24. Computer demo … https://goo.gl/M5ShF3

  25. From scratch TM 1 0 . 9 0 . 8 Accurracy 0 . 7 0 . 6 training validation 0 . 5 0 10 20 30 40 50 September 04 2018, Vienna, AT 11 Epoch

  26. From scratch TM September 04 2018, Vienna, AT 12

  27. VGG16 / ImageNet 1 0 . 9 0 . 8 Accurracy 0 . 7 0 . 6 training validation 0 . 5 0 10 20 30 40 50 September 04 2018, Vienna, AT 13 Epoch

  28. What VGG16 dreams about? September 04 2018, Vienna, AT 14

  29. What VGG16 dreams about? September 04 2018, Vienna, AT 14

Recommend


More recommend