Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

DataXDay - Tensors in the sky with CloudML

22 views

Published on

Out of curiosity, ask the other people in the conference room who has already developped neural networks: you will see a lot of hands up. Then ask them how many of those models run in production: epic fail.

Come and see a solution to train and deploy TensorFlow models in the cloud using Google CloudML.

Sylvain Lequeux - Xebia
https://dataxday.fr/

Video available: https://www.youtube.com/watch?v=oDpBRdjwNik

Published in: Technology
  • Be the first to comment

  • Be the first to like this

DataXDay - Tensors in the sky with CloudML

  1. 1. Tensor in the Sky with CloudML Tensor in the Sky with CloudML 1 @DataXDay
  2. 2. Sylvain Lequeux @slequeux 2 @DataXDay
  3. 3. WHY ? Deep Learning 3 @DataXDay
  4. 4. Classic Machine Learning Question Feature Extraction Algorithm Response 4 @DataXDay
  5. 5. Deep Learning Question Algorithm Response Feature Extraction 5 @DataXDay
  6. 6. Neural Networks 6 @DataXDay
  7. 7. Artificial Neural Networks X 7 @DataXDay
  8. 8. Artificial Neural Networks 8 @DataXDay
  9. 9. WHY ? Cloud 9 @DataXDay
  10. 10. From IaaS to SaaS Infrastructure as a Service Platform as a Service Software as a Service 10 @DataXDay
  11. 11. Google CloudML SaaS Train Predict 11 @DataXDay
  12. 12. CloudML Cloud Storage Compute Training Job Model 1 Version 1 Version 2 Compute VM Folder version 1 Folder version 2 Google CloudML 12 @DataXDay
  13. 13. WHY ? Use Case 13 @DataXDay
  14. 14. 14
  15. 15. 15 @DataXDay
  16. 16. Local Mode At least, it’ll work 16 @DataXDay
  17. 17. 17 Built-in models There are pre-trained models ▼ Saves time for training Param count approximation ▼ InceptionV3 : 23M ▼ VGG16 : 138M Included into Tensorflow & Keras Adapted architecture ▼ Conflutional ▼ MaxPooling ▼ Reccurrent ▼ ... @DataXDay
  18. 18. 18 @DataXDay
  19. 19. Export model Or How to Reuse Weight stored in-memory ▼ Need to retrain each time you start ▼ Non-deterministic behaviour Use Protobuf format to store model ▼ Google’s data exchange format ▼ Stores weights and architecture Model Directory saved_model.pb variables directory 19 @DataXDay
  20. 20. Export model Prediction Base 64 encode [[[ 1.0, 1.2, 1.3 ], ... data:image/j peg;base64,/ 9j/4AAQSkZ JRgABA... 20 @DataXDay
  21. 21. 21 @DataXDay
  22. 22. Serving In the Cloud No diamonds, sorry 22 @DataXDay
  23. 23. Serving Prediction Base 64 encode [[[ 1.0, 1.2, 1.3 ], ... data:image/j peg;base64,/ 9j/4AAQSkZ JRgABA... 23 @DataXDay
  24. 24. 24 @DataXDay
  25. 25. Google functions Proxify HTTP requests Perform controls : ▼ Authentication ▼ Bandwidth controls ▼ … Transform data ▼ Input preprocessing ▼ Output formatting Google functions A/B test your models Implements A/B testing logic inside this function 25 @DataXDay
  26. 26. Learning In the Cloud How about Magritte ? 26 @DataXDay
  27. 27. 27 @DataXDay
  28. 28. Transfer learning [...] is a research problem in machine learning that focuses on storing knowledge gained while solving one problem and applying it to a different but related problem. 28 @DataXDay
  29. 29. Transfer learning Retraining without retraining First layers learn basic features ▼ Lines ▼ Colors ▼ ... End layers learn complex features ▼ Objects ▼ Complex shapes ▼ … Transfer learning is 2-steps : ▼ Freeze first layers ▼ Train new end layers Layer 1 Layer 2 Layer N Layer N’ 29 @DataXDay
  30. 30. Online training Infinite power ▼ Define a setup.py file ▼ Define a config.yml file ▽ This could be done directly in step 3 by passing args ▽ Defines CPU/GPU/TPU usage ▽ Defines runtime version ▽ ... ▼ Run it ▽ Using gcloud command line ▽ Use -- to separate gcloud args from your job’s args 30 @DataXDay
  31. 31. 31 @DataXDay
  32. 32. So, what ? Conclusions : 2 for 1 32 @DataXDay
  33. 33. 33 @DataXDay
  34. 34. 34 @DataXDay
  35. 35. 35 @DataXDay
  36. 36. 36 @DataXDay
  37. 37. Thank you https://github.com/slequeux/xke-cloudml 37 @DataXDay
  38. 38. 38

×