Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

How To Implement CapsNets using TensorFlow

900 vues

Publié le

This presentation will show you how to implement a Capsule Network in TensorFlow. You will learn more about CapsNets, as well as tips & tricks on using TensorFlow more efficiently. Hope you like it!

Publié dans : Données & analyses

How To Implement CapsNets using TensorFlow

  1. 1. Implementing CapsNets with TensorFlow Aur�lien G�ron, November 2017
  2. 2. Aur�lien G�ron, 2017NIPS 2017 Paper
  3. 3. Aur�lien G�ron, 2017Jupyter Notebook
  4. 4. Aur�lien G�ron, 2017Jupyter Notebook
  5. 5. Aur�lien G�ron, 2017Input Layer
  6. 6. Aur�lien G�ron, 2017Input Layer Input Images
  7. 7. Aur�lien G�ron, 2017Input Layer Input Images
  8. 8. Aur�lien G�ron, 2017Input Layer Input Images
  9. 9. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  10. 10. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules 32
  11. 11. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  12. 12. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  13. 13. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  14. 14. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  15. 15. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  16. 16. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  17. 17. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  18. 18. Aur�lien G�ron, 2017Primary Capsules Input Images Primary Capsules
  19. 19. Aur�lien G�ron, 2017Digit Capsules Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1
  20. 20. Aur�lien G�ron, 2017Digit Capsules Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1
  21. 21. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1
  22. 22. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1
  23. 23. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  24. 24. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  25. 25. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  26. 26. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  27. 27. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  28. 28. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  29. 29. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Predict Outputs
  30. 30. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs
  31. 31. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs
  32. 32. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs 10
  33. 33. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs =
  34. 34. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs = Batch size
  35. 35. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs
  36. 36. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs
  37. 37. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs (?, 1152, 8) Shape
  38. 38. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs (?, 1152, 8) (?, 1152, 8, 1)
  39. 39. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs (?, 1152, 8) (?, 1152, 8, 1) (?, 1152, 1, 8, 1)
  40. 40. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs (?, 1152, 8) (?, 1152, 8, 1) (?, 1152, 1, 8, 1) (?, 1152, 10, 8, 1)
  41. 41. Aur�lien G�ron, 2017Digit Capsules > Predict Outputs
  42. 42. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  43. 43. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  44. 44. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  45. 45. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  46. 46. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  47. 47. Aur�lien G�ron, 2017Broadcasting
  48. 48. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  49. 49. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement
  50. 50. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  51. 51. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  52. 52. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  53. 53. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2 =
  54. 54. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  55. 55. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  56. 56. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  57. 57. Aur�lien G�ron, 2017 Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 98 9 0 1 Digit Capsules > Routing by Agreement > Round 2
  58. 58. Aur�lien G�ron, 2017Digit Capsules > Routing by Agreement
  59. 59. Aur�lien G�ron, 2017Digit Capsules > Routing by Agreement
  60. 60. Aur�lien G�ron, 2017Digit Capsules > Routing by Agreement
  61. 61. Aur�lien G�ron, 2017Digit Capsules Input Images Primary Capsules Digit Capsules 0 1 2 3 4 5 6 7 8 9 0 18 9
  62. 62. Aur�lien G�ron, 2017Estimated Class Probabilities Input Images Primary Capsules Digit Capsules Length 0 1 2 3 4 5 6 7 8 9 0 0 0 0 .7 0 0 .1 0 .2 0 1 0 0 8 9 .3 0
  63. 63. Aur�lien G�ron, 2017Predictions Input Images Primary Capsules Digit Capsules Length Predictions 0 1 2 3 4 5 6 7 8 9 0 0 0 0 .7 0 0 .1 0 .2 4 0 1 0 0 8 9 .3 0 3 6
  64. 64. Aur�lien G�ron, 2017Predictions Input Images Primary Capsules Digit Capsules Length Predictions 0 1 2 3 4 5 6 7 8 9 0 0 0 0 .7 0 0 .1 0 .2 4 0 1 0 0 8 9 .3 0 3 6
  65. 65. Aur�lien G�ron, 2017Predictions Input Images Primary Capsules Digit Capsules Length Predictions 7 3 4 6 7
  66. 66. Aur�lien G�ron, 2017Accuracy Input Images Primary Capsules Digit Capsules Length Predictions Labels Accuracy 7 3 4 6 1 7 3 4 6 7 80%
  67. 67. Aur�lien G�ron, 2017Accuracy Input Images Primary Capsules Digit Capsules Length Predictions Labels Accuracy 7 3 4 6 1 7 3 4 6 7 80%
  68. 68. Aur�lien G�ron, 2017Accuracy Input Images Primary Capsules Digit Capsules Length Predictions Labels Accuracy 7 3 4 6 1 7 3 4 6 7 80%
  69. 69. Aur�lien G�ron, 2017Training Input Images Primary Capsules Digit Capsules Length Predictions Labels
  70. 70. Aur�lien G�ron, 2017Margin Loss Input Images Primary Capsules Digit Capsules Length Predictions Margin Loss Labels Margin Loss Length
  71. 71. Aur�lien G�ron, 2017Margin Loss Input Images Primary Capsules Digit Capsules Length Predictions Margin Loss Labels Margin Loss Length
  72. 72. Aur�lien G�ron, 2017Decoder Input Images Primary Capsules Digit Capsules Decoder Margin Loss Labels Length Predictions
  73. 73. Aur�lien G�ron, 2017Decoder
  74. 74. Aur�lien G�ron, 2017Decoder Input Images Primary Capsules Digit Capsules Decoder Margin Loss Labels Length Predictions
  75. 75. Aur�lien G�ron, 2017Reconstruction Loss Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions
  76. 76. Aur�lien G�ron, 2017Reconstruction Loss Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions
  77. 77. Aur�lien G�ron, 2017Reconstruction Loss Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions
  78. 78. Aur�lien G�ron, 2017Final Loss Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss
  79. 79. Aur�lien G�ron, 2017Final Loss Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss
  80. 80. Aur�lien G�ron, 2017Final Loss Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss
  81. 81. Aur�lien G�ron, 2017Training Operation Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation
  82. 82. Aur�lien G�ron, 2017Training Operation Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation
  83. 83. Aur�lien G�ron, 2017Training Operation Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation
  84. 84. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask �
  85. 85. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask �
  86. 86. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask �
  87. 87. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask �
  88. 88. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Length Predictions Loss Training Operation Mask � Mask with Labels Labels
  89. 89. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask � Mask with Labels
  90. 90. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask � Mask with Labels
  91. 91. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G
  92. 92. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G A.eval()
  93. 93. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G A.eval()
  94. 94. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G A.eval()
  95. 95. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G A.eval()
  96. 96. Aur�lien G�ron, 2017Resolving Dependencies A D F B E G A.eval() C
  97. 97. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G A.eval()
  98. 98. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G A.eval()
  99. 99. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  100. 100. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  101. 101. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  102. 102. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  103. 103. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  104. 104. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  105. 105. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E G sess.run([A, E])
  106. 106. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E sess.run([A, E]) G
  107. 107. Aur�lien G�ron, 2017Resolving Dependencies A C D F B E sess.run([A, E]) G
  108. 108. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred
  109. 109. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred
  110. 110. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred
  111. 111. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred
  112. 112. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred
  113. 113. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred
  114. 114. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred True
  115. 115. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred True Value of y
  116. 116. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred True Value of y Evaluated for nothing
  117. 117. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred False
  118. 118. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred Value of y_pred False
  119. 119. Aur�lien G�ron, 2017Resolving Dependencies mask_with_labels reconstruction_targets y y_pred Value of y_pred Evaluated for nothing and needs to be fed! False
  120. 120. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask � Mask with Labels
  121. 121. Aur�lien G�ron, 2017Mask Input Images Primary Capsules Digit Capsules Decoder Reconstruction LossMargin Loss Labels Length Predictions Loss Training Operation Mask � Mask with Labels
  122. 122. Aur�lien G�ron, 2017Training
  123. 123. Aur�lien G�ron, 2017Predictions and Reconstructions
  124. 124. Aur�lien G�ron, 2017Predictions and Reconstructions
  125. 125. Aur�lien G�ron, 2017Predictions and Reconstructions
  126. 126. Aur�lien G�ron, 2017Tweaking Output Vectors -0.50 -0.40 -0.30 -0.20 -0.10 Original +0.10 +0.20 +0.30 +0.40 +0.50
  127. 127. Amazon: https://goo.gl/IoWYKD Twitter: @aureliengeron github.com/ageron
  128. 128. Amazon: https://goo.gl/IoWYKD Twitter: @aureliengeron github.com/ageron ...
  129. 129. Amazon: https://goo.gl/IoWYKD Twitter: @aureliengeron github.com/ageron ...
  130. 130. CapsNets using

×