Presentation is loading. Please wait.

Presentation is loading. Please wait.

Machine Learning for Software Developers in 45 Minutes

Similar presentations


Presentation on theme: "Machine Learning for Software Developers in 45 Minutes"— Presentation transcript:

1 Machine Learning for Software Developers in 45 Minutes
Why, How and Whoa! Room 2016 Session DEV5090 — MONDAY Oct 22, :30pm - 2:15am PT

2 Speakers Dr Zoran Sevarac @zsevarac Frank Greco @frankgreco
AI Researcher Univ of Belgrade, Serbia JC, Groundbreaker Ambassador, NetBeans Contributor Frank Chair NYJavaSIG - NY Java User Group JC, Cloud/Mobile Architect

3 Goal To explain what Machine Learning is, why it’s important and how Java Developers can create their own ML apps

4 Session Topics Why Do We Need Machine Learning
What is Machine Learning Brief History Basic Terminology How to Get Started for Java Devs and Demos In Big Data, “Quants” (math/eng experts) are needed. These humans can create models from the data, typically a few per week. Machine can automate the correlations, pattern match and model building significantly faster using ML techniques. ML can create thousands of models per week.

5 Session Topics Why Do We Need Machine Learning
What is Machine Learning Brief History Basic Terminology How to Get Started for Java Devs and Demos In Big Data, “Quants” (math/eng experts) are needed. These humans can create models from the data, typically a few per week. Machine can automate the correlations, pattern match and model building significantly faster using ML techniques. ML can create thousands of models per week.

6 For many applications, the algorithms are well-defined

7 Total money made from these turnstiles for the past week...
Calculate bowling avgs Find highest score Sort all the scores, etc. Total money made from these turnstiles for the past week... Count the number of popular repos written in python

8 Traditional Software Traditional Software T F Traditional Software
Typically a collection of if-then rules Algorithms are essentially designed as if a human (or team) is doing the work... just faster, more distributed or more scalable Expert systems which are rules engines, just make this easier or more convenient.

9 What Problem does ML Solve?
Chess has simple rules. 64 Squares 16 Attackers/Defenders per side Well-defined moves Rules are easy to describe. Straightforward to program. But of course… how to win is a different but related thread... Easy to program. But hard to win consistently even if you know the rules.

10 But some algorithms are NOT well-defined…
Let’s look at Visual Recognition

11 Chihuahua or Muffin?

12 Karen Zack @teenybiscuit
Chihuahua or Muffin? Visual Recognition (an ML example) Requires deeper thought Potentially subjective Rules are very hard to describe. Huge number of rules increases the complexity. Millions of lines of code… hard to program… worse: hard to debug Hard to get correct. Early AI/ML systems failed partially due to “hard-coded” rules. Karen Zack @teenybiscuit

13 Use Cases for Visual Recognition alone…
Ensure positioning of assembly products Travel and retail suggestions VisRec JSR #381 (pending) - Visual Recognition for Java Visual compliance or deterioration Track logos on social media

14 Handwriting translation
Many of These Applications are Hard to Code Many applications are not explicitly programmable… Machines can automate the correlations and model building... Face recognition Handwriting translation Autonomous Driving According to MIT Tech Review, the most popular ML use cases to adopt: Visual Recognition, Classification Sentiment Analysis Text Mining Natural Language Processing

15 So how do we solve these types of problems?

16 Session Topics Why Do We Need Machine Learning
What is Machine Learning Brief History Basic Terminology How to Get Started for Java Devs and Demos

17 Artificial Intelligence
Machine Learning A type of AI that allows a machine to learn from experience/data Deep Learning 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) Artificial Intelligence A type of algorithm(s) that allows a machine to emulate aspects of intelligent human behavior AI was a “boil the ocean” idea in the 1950’s. ML (1980+) and DL (2010+) are collections of “heat up large vats of soup” ideas. The latest innovations are occurring in DL… more accuracy… more computation… more sophisticated neural net architectures.

18 In ML, the machine is modeling the solution, not the human.
The machine looks at example data, detects patterns and correlations and predicts outcomes Q: How does it determine correlations? ANS: It uses statistical regression techniques. Stats building the model for specific data ML building the model of generalization (it could be wrong)

19 https://towardsdatascience
Note: Only the two on the left side are clustering, other three are classification algorithms

20 ML is already heavily used
Recommendations Fraud detection Spell checkers Targeted ads Customer support Smart oil rig Gmail anti-spam Other targets… how about an ML-infused IDE? Like a super spell-checker… “Excuse me Dave, but I don’t think you meant to use that service. You probably meant foo…”

21 Who Are the Big Players with Engines/Services?
And dozens of startups...

22 Session Topics Why Do We Need Machine Learning
What is Machine Learning Brief History Basic Terminology How to Get Started for Java Devs and Demos In Big Data, “Quants” (math/eng experts) are needed. These humans can create models from the data, typically a few per week. Machine can automate the correlations, pattern match and model building significantly faster using ML techniques. ML can create thousands of models per week.

23 Quiz When was the first “AI” conference? 1972? 1985? 1955? 1999? 2001?
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?

24 Punch cards weren’t even invented in 1955!

25 First Artificial Neural Network
1943 Warren McCulloch Walter Pitts First subroutine… 1946!

26 Computing resources were not yet capable Not enough data to analyze
So… What Happened Computing resources were not yet capable Not enough data to analyze Early ML attempts did not mimic the brain well Boil the Ocean - too big of a problem Cool research but funding was erratic due to lofty goals and missed milestones.

27 But Now... Scalable Cloud Computing Large Collections of Data
Improved Neural Networks Cloud resources plus huge data sets … billions/trillions of data points … hundreds/thousands of machines in the cloud … better ML algorithms

28 Software vs. Humans Jeopardy 2011 Chess 1997 Go 2016

29 At least 15x-30x faster than GPU/CPUs for ML applications
New Approaches to Hardware Addresses Dark Silicon At least 15x-30x faster than GPU/CPUs for ML applications One can envision an interesting ML-infused future with Project Panama and JShell (or another JVM language or DSL). Software architects now need to consider non-core-based scalable solutions. Back in the day, we only focused on “cores”..

30 https://www. bloomberg

31 Session Topics Why Do We Need Machine Learning
What is Machine Learning Brief History Basic Terminology Useful Tools for Java Devs Cool Demos! In Big Data, “Quants” (math/eng experts) are needed. These humans can create models from the data, typically a few per week. Machine can automate the correlations, pattern match and model building significantly faster using ML techniques. ML can create thousands of models per week.

32 Basic Terminology Machine learning gives "computers the ability to learn from data without being explicitly programmed.” 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 internal model parameters based on the data set in order to solve specific problem (learn data set) Performance measure - metric that is used to tell how good model has learned the data. 2 min

33 Input Data algorithms Predictions Training Data
The ML algorithms are at the center. So what type of algorithms are there

34 ML - Basic Workflow Data Prep Train Model Test Model Predict
Analyze Errors Data Prep Train Model Test Model Predict Target/goal? Java developer should be familiar with this basic workflow. Its not comprehensive and you’ll learn more about the subtleties as you progress. Test Model - using regression, cross-validation Test data set as well Data preparation: data scientists, data engineers (Spark, cloud, cluster, etc) Prepare/clean data (filter outliers, resolve missing values, normalize, etc.) Build model using training data Test model using test data Hints What is the specific business question that you’re asking? What is the expected result of applying machine learning? What type of problem is that (regression, classification, etc)?

35 Types of Machine Learning
Supervised Unsupervised Reinforcement

36 Types of Machine Learning
Supervised Learns from examples that provide inputs and desired outputs. “Teacher” supervises correction. Unsupervised Reinforcement Type of machine learning algorithms 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 of the model (error/loss function)

37 Session Topics Hand off to Zoran Why Do We Need Machine Learning
What is Machine Learning Brief History Basic Terminology How to Get Started for Java Devs and Demos Hand off to Zoran

38 Popular Java Toolkits (small subset)
VisRec JSR #381 VisRec JSR 381

39 What you can do with ML? Classification - assign a predefined label/category to an item, enum output Example: spam/not spam, fraud/not fraud, object on image is {cat, dog, rabbit} Regression - model the relationship between variables, real valued output Example: Server load depending of the number of users/requests Clustering (identify and assign input samples to groups) Example: What are the typical behaviours of users on my website? Important question What type of problem is that? 1 min Fisrt step: Know your question Determine the type of ml task And set target performance value, desired accuracy

40 Introductory Algorithms
Linear Regression (regression) Logistic Regression (classification) Neural Networks & Deep Learning (classification & regression) All use the same general Supervised learning algorithm The evolution of deep learning Why al ml courser start with linear regression For each algorithm I’ll briefly explain What it does General principle how it does it Essential things to understand inoreder to be able to apply it and tweak it for specific problem What paramaters it has and how they influence the performance / how well algorithm perfroms

41 General Supervised Learning
while(error > errorThreshold) { predictedOutput = model.getOutput() error = actualOutput - targetOutput moveCloserToErrorMinimum() } Iterative error minimization algorithm (aka optimization algorithm) Least Mean Squares, Gradient Descent

42 Linear Regression What it does: Finds the best possible straight line that through given set of data points. A rough estimate of a global trend. Assumes near-linear dependency/trend between variables: y = slope * x + intercept How it works: finds the set of parameters (slope and intercept) that gives minimum of the error function. Error is calculated as difference between actual and predicted value. Two important concepts: Error/Loss Function Optimization method (gradient descent - an iterative procedure for error function minimization) . Demo: Apache few numbers Weka Code house price prediction No deep netts during presentation, but include link on gith hub examples Explain the problem, data set Show basic essential code in slide (example ) Link to full example on github (sevarac) & blog (deep netts and my) Weka, Deep Netts, Vis Rec Example Link to blog post deepnetts/blog/Linear_Regression.html (samo napravi link I stavi nek pocetni sadrzaj. Vremenom i stavi link na github primer. Idealno kratak you tube , i osnovne formule. Objasnjenja za Java programere) Na slajdu objasni sta radi, a kroz primere kako se koristi: What It Does and How To Use Linear means uniform For best results: remove outliers and correlated inputs, use inputs that are correlated with output

43 Logistic Regression/Binary Classification
Just put Linear Regression inside Logistic function Fits logistic function: y=1/(1+e^-x)) to given data Used for binary (yes/no) classification problems Demo: breast cancer prediction using weka Yes/No classificatin or with fancy name Binary Classification

44 Neural network Feed Forward Neural Network - 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 nodes and layers Activation Function (Logistic, Tanh, ReLU) Error Function (Mean Squared Error, Cross Entropy) Demo: Iris Classifier using Deep Netts Multi Class Nonlinear classification

45 Convolutional Network / Deep Learning
Extension of Feed Forward Neural Network specialized for image classification/recognition taska Introduces convolutional layers (2D and 3D) which act as a learnable image filters - feature extractors Reduces amount or image preprocessing - preprocessing is being learned Demo: Mnist using Deep netts

46 VisRec API JSR 381 To simplify and standardize Java APIs for classifying, and recognizing objects in images. VisRec JSR #381

47 VisRec API and the future of Machine Learning For Java
Standard Java API for visual recognition based on machine learning - like a Collections API for machine learning Reusable design for machine learning tasks (interfaces, abstract classes, builders) General Machine Learning Layer (data set, classification, regression ) Visual Recognition Task Layer (image classification, object recognition) Easy integration & interoperability with other Java Technologies and ML frameworks Demo: VisRecMnistExample

48 Learn and Contribute to the Next Gen Java ML API
Official Page for VisRec JSR #381 at JCP - Github Repo - Wiki - Mailing list - VisRec JSR - An architecture for Visual recognition using machine learning, make it easy to integrate - combine with previous slide

49 Oracle Data Science Cloud
COMING SOON Support for all open source ML libraries Support for Team Collaboration Workflow support for entire lifecycle from data analysis and model building to monitoring Visit them at the booth!

50 Experts in Modern Development
Cloud Microservices and Containers Java, JavaScript/Node.js, PHP, Python DevOps Continuous Delivery Open Source Technologies SQL/NoSQL Databases Machine Learning, AI, Chatbots developer.oracle.com/ambassador @groundbreakers

51 Questions? Thank you! @frankgreco @zsevarac Continue Learning at
Follow Us On Twitter Napravi ovaj privremeni link kao page Za pocetak postavi uve primere, ond aprirmeri idu na gihub i za svaku stvar da imam blog post link Napomeni da ce sve demonstracije da dodatnim primerim akako da urade sve ovo pomocu neuronskih mreza bisti dostupno i na githubu i na sledecem linku


Download ppt "Machine Learning for Software Developers in 45 Minutes"

Similar presentations


Ads by Google