This presentation was delivered on April 14, 2020 to the San Francisco Java User Group (SF JUG) over Zoom. Over half of the time was spent on Live Coding and Demo of ML Apps using TF-Java & DJL Frameworks.
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Deep Learning for Java Developer - Getting Started
1. Deep Learning for Java Developers
San Francisco Java User Group
Suyash Joshi
Principal Developer Marketing Director
Oracle, Marketing
April 14, 2020
@java
@suyashcjoshi
#ai
2. Safe harbor statement
The following is intended to outline our general product direction. It is intended for information
purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be relied upon in making purchasing decisions. The
development, release, timing, and pricing of any features or functionality described for Oracle’s
products may change and remains at the sole discretion of Oracle Corporation.
2
3. Overview
1 WhoAmI & WhoAreYou
2 Why Java & ML
3 Machine (Deep) Learning 101 & ML Engineering Overview
4 ML with Java – Live Coding & Demo of Tools, Libraries, Frameworks
5 Q&A
3
4. Suyash Joshi
Developer Evangelist / Developer Marketing
SF Bay Area Based, Organizer of Various Meetups Groups
Enterprise Java Developers (6+ years)
AI for Creative Purpose
Loves to perform Magic & Juggling
4
5. 5
Audience Poll
Why do you want to learn more about
Machine Learning/Deep Learning in Java ?
1. Interested from Data Scientist/ML
Researcher perspective
2. Interested from a Java Developer (ML in
Production, ML Ops etc.)
3. General ML/DL interest
What is your current level of understanding with Deep
Learning/Machine Learning frameworks in general ?
1. Not at all
2. Some/beginner Level
3. Intermediate/Advance Level
10. Data Engineer or Data Scientist ?
10
Oracle Cloud Data Science Platform
• Oracle Big Data Service : Fully configured version of Cloudera Enterprise
• Oracle Cloud Infrastructure Data Flow : Fully managed Apache Spark
• OML Notebooks OML & Algorithms – SQL Notebooks on Autonomous Database
• OML4R & OML4Py : R & Python Notebooks for Data Scientists
• OML4Spark - process data in Data Lakes using Spark & Hadoop
• OML Microservices GPUs : Coming soon
• Oracle Cloud Infrastructure Data Science Service
• Pre Configured VM’s – NVIDIA GPU’s with Preinstalled Notebooks, Frameworks
11. ML Engineer / Software Engineer ?
11
Reference: https://medium.com/@tomaszdudek/but-what-is-this-machine-learning-engineer-actually-doing-18464d5c699
13. State of Deep Learning Java Frameworks*
13
Framework / Library Strengths Weakness License
TensorFlow for Java Popular in the industry.
Google is the main contributor,
TF-Java SIG has active developer
community online
Java API, currently
experimental, not 2.0,
stable version – 1.14
Apache 2.0
PyTorch for Java Researchers/Academics love it.
Open AI Support. Facebook is the
main contributor
Lacking Documentation,
Examples. Currently only
useful for inferencing
BSD
DJL (Deep Java Learning) High Level API’s with Engine
Architecture. Support for MXNet,
TensorFlow & PyTorch models. AWS
Research is the main contributor,
active development going on.
An abstraction on top of
MXNet for Java
Apache 2.0
DL4J Supports large number of models,
GPU, distributed training with Spark.
Lot’s of interesting examples, good
documentation. Most Mature.
API are hard to follow and
understand for non-expert
users, Framework is too
bloated
Apache 2.0
14. Simple Neural Network
14
Feed Forward Neural Net (not showing Back Propagation)
A directed graph, with
nodes organized into
groups called layers
Each node performs
computation on it’s
inputs
Computation can be
reconfigured by
tweaking coefficients
assigned to edges
15. Steps in an ML Program
15
• Define the neural network that has some learnable parameters (or weights)
• Iterate over a dataset of inputs
• Process input through the network
• Compute the loss (how far is the output from being correct)
• Propagate gradients back into the network’s parameters
• Update the weights of the network, until Model Fits
16. Steps to build a simple Linear Regression Model
16
Reference: https://github.com/JavaVisRec/visrec-api/wiki/Getting-Started-Guide
Goal: Fit the Curve (linear
function)
Model: y = mx + c
Y = output / prediction
X = input
M, b : adjustable values (weights,
biases)
Data on 2 Variables:
X-Axis : Dependent
Y-Axis : Independent
https://github.com/JavaVisRec/jsr381-examples/blob/master/src/main/java/jsr381/example/SimpleLinearRegressionExample.java
17. Not so simple Model
17
Reference: https://dzone.com/articles/activation-functions-and-optimizers-for-deep-learn
19. TensorFlow for Java Open Source Project
19
“Tensorflow works in Java, you can run training and inference with the same core
functionality as python. The TF JVM SIG is building a new Java API, which will
make these things even simpler, and allow training runs without a line of python
code.
They are building a Keras style API to make DL easier to use, and working on
better integration with the JVM ecosystem including languages like Scala and
Kotlin. If you want to come help you can find them
at github.com/tensorflow/java or on gitter.”
- Dr. Adam Pocock (ML Researcher, Oracle Labs)
https://www.tensorflow.org/install/lang_java
20. ML Development – Notebook (Jupyter, Apache Zeppelin) Programming
20
https://github.com/SpencerPark/IJava
https://dzone.com/articles/apache-zeppelin-stairway-to-notes-haven
22. ML Deployment and Monitoring with Java API Support
22
https://oracle.github.io/graphpipe,
https://github.com/mlflow/mlflow/blob/master/mlflow/java/client/README.md
23. ML Deployment - ONNX
23
https://github.com/microsoft/onnxruntime
Open Neural Network Exchange
- Framework Interoperability
- Pretrained ONNX Models (Zoo)
- ONNX Tools: Export to ONNX Format
- ONNX Tools: Model Optimization
- ONNX Runtime Java Support
- Microsoft, Facebook, Oracle (Adam) etc
25. 25
Audience Poll
How would you like learn/hear more in
order to succeed ML and Java?
1. YouTube / Video tutorials
2. Blogs, How To Guide etc.
3. Live Training / Live Online Sessions
What would you like to learn/hear more about?
1. Cool / Interesting examples (Text, Image, Audio, Video
etc.) using ML Frameworks/Toolkits (DL4J, TF-Java,
PyTorch-Java, DJL etc.)
2. Cloud Native Java/Jakarta EE ML Use Cases:
MLOps(Deployment), Microservices-Kubernetes for ML
Services, Deployment and Updates
3. Python based TF, PyTorch Tutorials etc.
26. Our mission is to help Java developers
succeed with AI, join us and help in
whatever way possible.