32
Machine Learning for Java Developers in 45 Minutes Why, How and Whoa! Session CON2977 — WEDNESDAY Oct 4, 2017 8:30am - 9:15am PT

Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

  • Upload
    ngocong

  • View
    230

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Machine Learning for Java Developers

in 45 Minutes

Why, How and Whoa!

Session CON2977 — WEDNESDAY Oct 4, 2017 8:30am - 9:15am PT

Page 2: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Speakers

Zoran Severac@neuroph

AI ResearcherUniv of Belgrade, Serbia

JC, NetBeans Dream Team

Frank Greco@frankgreco

ChairNYJavaSIG - NY Java User Group

JC, Cloud/Mobile Architect

Page 3: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

GoalTo explain what Machine Learning is, why it’s important and

show Java Developers how to create your own ML apps

Page 4: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

What is Machine Learning (ML)● A Type (Subclass) of Artificial Intelligence (AI)

● A System that Learns and Improves its Predictions

○ For Example: Gmail - “flag this as spam” or “not spam”

● Not Just Big Data 2.0

○ Big Data is about Traditional Data Analytics and Visualization Tools

○ >50% Big Data Projects fail - focus is on data gathering/prep/architecture, not on analysis

● ML is more Dynamic than just Data Analytics

● Machines can find Patterns and create ML models much faster than Humans

Page 5: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

What Problem does ML Solve?

Chess has simple rules.64 Squares16 Attackers/Defenders per sideWell-defined moves

Rules are easy to describe.Straightforward to program.

Visual Recognition (an ML example)Requires deeper thoughtPotentially subjective

Rules are very hard to describe.Much harder to program.Early AI/ML systems failed partially due to “hard-coded” rules.

Chess

Chihuahua or Muffin?

Page 6: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Many Applications are Hard to CodeMany applications are not explicitly programmable…Machines can automate the correlations and model building...

Handwriting translation

Autonomous Driving

Face recognition

http://vision.ics.uci.edu/images/fun/IMG_1183_augmented_reality_faces1.jpg

Page 7: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

We are Familiar with Deterministic Solutions

Input Output

Same Input gives us the Same OutputSame Input gives us the Same OutputSame Input gives us the Same Output

Page 8: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

But We’re Not Used to Non-Deterministic Solutions

Output1InputInputInputInput

InputInputInputImput

InputInputInputInputt

Output2

Output3

Lots of Noisy Datasets Sensors, voice, images, video Many variables with noisy data

Probabilistic Outputs Uncertainty, noisy data, randomness, statistical, different contexts, etc.

ModelA Model

B

ModelC Model

D

Page 9: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Problem Definition

Determine Target Metrics

Data Prep

Train Model

Test Model

Deploy

Parse/Filter the Data

Observe Patterns / Learn

Predict

Basic WorkFlow of

ML-Infused App

Data Scientists

Data Engineers

Page 10: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Recommendations

Fraud detection

Targeted ads

Hacker detection

Customer support patterns

Smart oil rig

ML is already heavily used

Page 11: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Use Cases for Visual Recognition alone…

Ensure positioning of assembly products Travel and retail suggestions

Track logos on social media Visual compliance or deterioration

Page 12: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Google's CEO, Sundar Pichai - his company is betting big on advances in artificial intelligence (AI) and machine learning in the coming years.https://goo.gl/f36inE

Tim Cook from Apple - "Today, machine learning drives improvement in countless features across our products”. https://goo.gl/ZETMiv

CEO Satya Nadella – at Microsoft’s Ignite conference talked about his vision for how deep learning and AI will transform the company. https://goo.gl/XuIp4H

Page 13: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

But Didn’t We Try This Already?

Yes… But AI had overly broad scope

“Intelligent agents, first-order logic, knowledge ontologies, probabilistic reasoning, learning theory, NLP, robotics,…”

Quiz When was the first “AI” conference? 1972? 1985? 1955? 1999? 2001?

Page 14: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Punch cards weren’t even invented in 1955!

Page 15: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

What Happened?Cool research but funding was erratic due to lofty goals and missed milestones.

A “boil the ocean” approach

Computing resources weren’t yet capable…

Now they are...

Page 16: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Artificial Intelligence

Machine Learning

Deep Learning

A type of algorithm(s) that allows a machine to emulate aspects of intelligent human behavior

A type of AI that allows a machine to learn from experience/data

A type of ML that uses powerful computing resources and advanced neural networks to more-accurately solve non-linear, highly-dimensional problems with large

amounts of data (eg, vis rec)

Page 17: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Software vs. Humans

Jeopardy2011

Chess 1997 Go 2016

Page 18: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Software vs. Humans

https://research.fb.com/wp-content/uploads/2016/11/deepface-closing-the-gap-to-human-level-performance-in-face-verification.pdf?

Page 19: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Software vs. Humans – It doesn’t stop there

http://www.eetimes.com/author.asp?section_id=36&doc_id=1331264&

Page 20: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

New Approaches to Hardware Addresses Dark Silicon

https://drive.google.com/file/d/0Bx4hafXDDq2EMzRNcy1vSUxtcEk/view

At least 15x-30x faster than GPU/CPUs for ML

applications

Why Project Panama (Java API for Native Libs) is Extremely Important!

Page 21: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Who Are the Big Players with Engines/Services?

Page 22: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Popular Java Toolkits (small subset)

Oryx 2VisRec JSR #381¹

Page 23: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

How Should a Java Developer Get Started?

Page 24: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Basic Terminology● Machine learning gives "computers the ability to learn without being explicitly

programmed.” https://en.wikipedia.org/wiki/Machine_learning● Data set - set of data that represent specific problem we’re trying to solve● Model - A data structure that consists of various parameters and methods that

transform inputs into outputs. Includes some kind of training procedure.● Training, learning procedure, adjusts model parameters based on the data set

in order to solve/learn specific problem (learn data set)● Performance measure - metric that is used to tell how good model has

learned the data.

Page 25: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Types of Machine Learning● Supervised

● Unsupervised

● Reinforcement

Page 26: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Supervised Learning● Learns from examples that provide inputs and target/desired outputs● It can learn input-output mapping● Learning is based on iteratively feeding inputs into model,

and minimising the error between the actual and target output (cost function)

Page 27: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Linear Regression● Find the line that best fits the relationship between the input

variables (x) and the output variables (y)

● Assumes linear dependency between variables (a simple

straight line) y = slope * x+ intercept ● Example: Estimate number of bugs depending on

development time, number of developers, number of meetings, number of managers in the team, deadline etc.

● For better results remove correlated data and noise● Used for regression problems● What if dependency is not linear?

Image from https://en.wikipedia.org/wiki/Linear_regression

Page 28: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Logistic Regression/Binary Classification● Same as Linear Regression, just fits a data to the

logistic function: y=1/(1+e^-x))● Used for binary classification problems

(spam/not spam)

https://en.wikipedia.org/wiki/Logistic_regression

But what if we don’t assume a type of dependency?

Page 29: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Evolution of Neural Networks● Adaline - Linear Regression● Perceptron - Logistic Regression● Multi Layer Perceptron and Backpropagation - Complex Unknown Function● Convolutional Neural Networks and Deep Learning

Page 30: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Neural network / Deep Learning● Multi Layer Perceptron - a directed

graph in which each unit performs logistic regression.

● Learns using Back Propagation algorithm which is also an error function minimization.

● Can be used for both Classification and Regression problems

● Number of layers/Neurons● Activation Function (Sigmoid, Tanh, ReLU)● Error Function (MSE, CE)

Page 31: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

Questions and Comments?Pending JSR #381 - VisRec https://jcp.org/en/jsr/detail?id=381

● Github Repo - https://github.com/sevarac/VisualRecognitionApi● Wiki - https://github.com/sevarac/VisualRecognitionApi/wiki ● Mailing list - https://groups.io/g/visrec/

Page 32: Machine Learning for Java Developers in 45 Minutes · Machine Learning for Java Developers ... learning theory, NLP, robotics,…” Quiz When was the first “AI” conference

http://www.tcs.com/SiteCollectionDocuments/White%20Papers/Machine-Learning-Analytics-in-Manufacturing-0714-1.pdf