Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet...

56
Machine Learning Using Google Technology https://machinelearning.group/ Thanks to our sponsors:

Transcript of Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet...

Page 1: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

Machine Learning Using Google Technology https://machinelearning.group/!

Thanks to our sponsors:

Page 2: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� About Us & Upcoming Events � ML on the Google Cloud (Google) � Kaggle and TensorFlow (MLG)

•  Vision Contest

� Q & A

Page 3: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

Hands-on Knowledge Community

✓  GroupProjects✓  KaggleCompe33ons

✓  Hackathons✓  IndividualProjects

✓  LocalMLCommunity

✓  PersonalNetworking✓  IndustryExposure✓  FieldTrips

✓  StudyGroups✓  Introstoconcepts✓  Detailedpresenta3ons✓  Subjectseries✓  Step-by-steptutorials

Page 4: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

2017

Page 5: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 6: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 7: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Create an algorithm to distinguish dogs from cats •  https://www.kaggle.com/c/dogs-vs-cats

Page 8: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

•  Puppy vs. Cat (2006) � https://www.youtube.com/watch?v=7bcV-TL9mho

Page 9: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

•  Surprised Kitty (2009) � https://www.youtube.com/watch?v=0Bmhjf0rKe8

Page 10: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

•  Google’s Artificial Brain Learns to Find Cat Videos (2012) �  https://www.wired.com/2012/06/google-x-neural-network/

Page 11: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

“The researchers started with a Google-developed algorithm primed to differentiate cats from dogs. Then they fed it images from medical databases …“

https://www.wired.com/2017/01/look-x-rays-moles-living-ai-coming-job/

Page 12: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 13: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 14: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 15: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 16: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 17: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 18: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 19: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 20: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 21: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 22: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 23: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Datasets & Real World Problems � Prizes & Recruitment

•  Leadership Boards •  Rankings •  Medals

� Google purchased Kaggle in March 2017

•  Part of Cloud Division

Page 24: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Example competitions: •  Right Whale Detection (Cornell) •  Predicting Seizures from Brain Waves (NIH) •  Passenger Screening Algorithm (HSA) •  Home Price Prediction (Zillow) •  Hotel Recommendations (Expedia) •  West Nile Virus Prediction •  Shelter Animal Outcomes •  Kobe Bryant Shot Selection

Page 25: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Discussions � Code Sharing via kernels

•  Python, R, Julia, SQLite

Page 26: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

“Kaggle grandmasters say they’re driven as much by a compulsion to learn as to win.”

From: https://www.wired.com/story/solve-these-tough-data-problems-and-watch-job-offers-roll-in/

Page 27: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 28: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� A library for developing ML applications � Google’s Brain team Open Sourced in Nov 2015

•  https://www.tensorflow.org/

� Fast & Flexible •  Core is very fast (optimized C++ & CUDA) •  Works on embedded devices

� Low-level

Page 29: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

1.  Construct Graph 2.  Drive Computation By Feeding Data

(e.g. Train model or get results from model)

Page 30: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

Step 1: Define your Graph/Model

Page 31: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

How? Using: A.  Tensors

-  N-dimensional arrays

B.  Operations (aka Ops) -  Takes 0 or more Tensors -  Returns 0 or more Tensors

C.  Variables (they maintain state)

-  Must be explicitly initialized -  Contain tensors

Page 32: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

Step 2: Drive Computation (e.g. Get Classification Result)

a. Feeds (send custom input) •  Patching a tensor into any operation •  Placeholder operation (using tf.placeholder ())

b. Fetch (get output) •  Get the outputs of operations by passing in the

tensors to retrieve (using session.run())

Page 33: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

If you try to ignore how it works under the hood because “TensorFlow automagically makes my networks learn”, you will not

be ready to wrestle with the dangers it presents, and you will be much less effective at building and debugging neural networks.

- Andrej Karpathy https://medium.com/@karpathy/yes-you-should-understand-backprop-e2f06eab496bthy

Page 34: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 35: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Competition:

•  https://www.kaggle.com/c/dogs-vs-cats � Our solution:

•  https://www.kaggle.com/kbhits/tensorflow-starter-kit-fixed

Page 36: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Knowledge Based Kaggle (more cooperative) � Good ConvNet Baseline available � Get Hands-On Experience With:

•  Python •  Kaggle and Community Feedback •  Data manipulation (normalization, splitting,

augmentation) •  ML concepts •  TensorFlow Library •  ConvNets

Page 37: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 38: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Standardize on •  Python (3.5 required for Windows) •  TensorFlow (Google’s ML Library)

� Choice of •  Operating System (Mac, Windows, Linux) •  Python Package Manager (e.g. Anaconda) •  Python IDE (PyCharm, LiClipse, VIM, …)

Page 39: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Part of free Udacity Deep Learning course by Google: •  https://www.udacity.com/course/deep-learning--ud730

� Logistic Regression ‘Name the Letter’ (A-J)

� Goal •  Create a model that can accurately classify the images

Page 40: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 41: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 42: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Data Included: •  12,500 cat pictures in training set •  12,500 dog pictures in training set •  12,500 dog/cat pictures in test set

� Noticeable differences between NotMNIST: •  Only two classes •  Different sizes and aspect ratios •  RGB instead of greyscale

Page 43: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 44: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 45: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 46: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 47: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

Step 1: Create Graph •  Layers �  3x: ConvNet + Max Polling �  Feature maps: 32, 32, 64

�  2x: Fully Connected Layers •  Activation functions: ReLU & Softmax •  Loss function: Cross Entropy •  Optimization: RMSPropOptimizer

Step 2: Normalize & Partition data

Step 3: Train model using training set

Step 4: Once trained, show accuracy using test set

Page 48: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 49: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 50: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 51: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 52: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Competition:

•  https://www.kaggle.com/c/digit-recognizer � Our solution:

•  https://github.com/DavidsonMachineLearningGroup/DigitRecognizer

Page 53: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community
Page 54: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

http://imgaug.readthedocs.io/en/latest/index.html

Page 55: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

� Free Udacity Course •  https://www.udacity.com/course/deep-learning--ud730

� Amazing ConvNet Blog

•  http://cs231n.github.io/convolutional-networks/

Page 56: Machine Learning Using Google Technology · Knowledge Based Kaggle (more cooperative) Good ConvNet Baseline available Get Hands-On Experience With: • Python • Kaggle and Community

https://machinelearning.group/!