SlideShare a Scribd company logo
1 of 43
© Copyright Azul Systems 2017
© Copyright Azul Systems 2015
@speakjava
Building A Brain With
Raspberry Pi And
Zulu Embedded JVM
Simon Ritter
Deputy CTO, Azul Systems
1
© Copyright Azul Systems 2017
Introduction
© Copyright Azul Systems 2017
Inspiration
3
© Copyright Azul Systems 2017
Human Brain Neocortex
© Copyright Azul Systems 2017
Hierarchical Temporal Memory
 Theoretical framework for how the neocortex works
– Models neurons and synapses and how they interact
– Also includes dendrites and precise synapses
 This is different to basic neural network topologies
 HTM simulated neuron far more complex
– More adaptable than AI neuron
– links decay over time if not used (temporal)
 Potentially much better at learning
5
© Copyright Azul Systems 2017
Introduction To Machine Learning
6
© Copyright Azul Systems 2017
Learning For Computers
 Machine Learning
– Giving “computers the ability to learn without being
explicitly programmed” - Arthur Samuel
– Requires training data to predict future values
7
© Copyright Azul Systems 2017
Learning For Computers
 Deep Learning
– “Neural networks with more than two layers”
– Not necessary to have training data
 Deep Reinforcement Learning
– No training data
– Learn by experience
– Much like a human: trial and error
8
© Copyright Azul Systems 2017
Markov Decision Process
 Mathematical model of decision making
– Outcome partly random, partly controlled by decision
 5-tuple
– S: State
– A: Action
– P: Probablility that action a leads to state s
– R: Reward for transitioning
– γ: Discount factor
 Difference in importance between future and present rewards
9
© Copyright Azul Systems 2017
Markov Decision Process
10
By waldoalvarez - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=59364518
© Copyright Azul Systems 2017
Deep Q Network
 Q: Quantity of a state-action combination
– Learning rate
– Discount factor
– Initial conditions
Used by Deep Mind
to learn to play Atari
games with no previous
experience
© Copyright Azul Systems 2017
Project Hardware
© Copyright Azul Systems 2017
Raspberry Pi
 Fantastically successful development board
– Cheap, powerful, great connectivity
– Original boards $25, Pi Zero only $5!
 Officially launched on Febuary 29th 2012
– First production run was 10,000 boards
– RS reported over 100,000 pre-orders in one day
 Crashed servers
– Over 10 million boards have been sold (Sept, 2016)
13
© Copyright Azul Systems 2017
Raspberry Pi Variations
14
Model A Model B Pi Zero
ARM v6
700 MHz
ARMv6/7/8
700/900/1200 MHz
ARM v6
1 GHz
1 core 1 or 4 core 1 core
256 Mb
512 Mb
512 Mb
1 Gb
512 Mb
1 x USB
No Network
2/4 USB
100 Mb Ethernet
WiFi/Bluetooth (v3)
1 micro USB
No ethernet
WiFi/Bluetooth (Zero W)
© Copyright Azul Systems 2017
Pi Brain Architecture
Network
Client
Laptop
Raspberry Pi
Cluster
(Emulating HTM)
© Copyright Azul Systems 2017
Raspberry Pi Cluster (Mk 1)
16
© Copyright Azul Systems 2017
Raspberry Pi Cluster (Mk 2)
17
© Copyright Azul Systems 2017
Cluster Hat
18
USB GPIO
Raspberry Pi 3
Master
PORT 1
PORT 2
PORT 3
PORT 4
Pi Zero W
Slaves
GPIO 22
GPIO 23
GPIO 24
GPIO 25
Alert LED
GPIO 21
© Copyright Azul Systems 2017
Java For Embedded
Applications
© Copyright Azul Systems 2017
Why Java?
 “Write once, run anywhere”
– Easy to move code between different platforms
 Wide range of libraries and frameworks
– Takes a lot of hard work out of app development
 Simple interfacing
– Pi4J and DIO libraries for Raspberry Pi
 Simple concurrency
– Comprehensive multi-threading support
 Native code integration for complex situations
– JNI
20
© Copyright Azul Systems 2017
Azul Zulu Java For Embedded
 Built from OpenJDK code base
 Passes all TCK tests
 Ports for Intel, ARM, PowerPC
 ARM v6, v7, v8
– Soft and hard float
– 64 bit close to release
– C2 and C1+C2 compiler enhancements
 Drop in replacement for other JVMs
 No licensing restrictions (FoU)
21
© Copyright Azul Systems 2017
Machine Learning In Java
© Copyright Azul Systems 2017
Deep Learning Basics
 Neural network nodes
– Neuron takes weighted inputs that can change
 Organised as layers
– Non-linear processing
– Different levels of problem abstraction
– Good analogy to HTM model
 Unsupervised learning
– No initial data set
– Learn by experience
23
© Copyright Azul Systems 2017
Neural Network Elements: Node
24
Σ λ
1
X1
X2
X3
W0
W1
W2
W3
© Copyright Azul Systems 2017
Neural Network Elements: Layers
25
Output Layer
Hidden Layer
Input Layer
© Copyright Azul Systems 2017
DeepLearning4J (DL4J)
 Toolkit for building, training and deploying Neural Networks
– configure neural networks and build computation graphs
 ND4J: N-dimensional arrays for Java
– Core technology for deep learning
 DataVec
– Transform data into feature vectors
 Arbiter
– Used to evaluate and tune ML models
– Hyperparameter optimisation functionality
26
© Copyright Azul Systems 2017
RL4J Basics
 Low-dimensional (state) and high-dimensional (pixels)
processing
– MDP class (Markov Decision Process)
– DQN class (Deep Q Network)
– Policy abstract class
 Choose the next action given a state
 ACpolicy (Actor Critic)
 BoltzmannQ (Probablilty distribution)
 DQNPolicy (Action with maximum Q value)
 EpsGreedy (Epsilon Greedy, partially random)
28
© Copyright Azul Systems 2017
Minecraft And Project Malmo
© Copyright Azul Systems 2017
Minecraft
 Immensly popular ‘construction’ game
– Especially amongst children
– Different modes: creative, survival, hardcore
 PC (first) version written in Java
– 121 million copies sold worldwide (all versions)
– Probably most successful Java desktop app ever
– Mojang aquired by Microsoft in 2014
30
© Copyright Azul Systems 2017
Minecraft
© Copyright Azul Systems 2017
Project Malmo
 Microsoft Labs project
 AI experimentation platform built on top of Minecraft
– Mod for Java version of Minecraft
– Libraries to write AI agents to act as player in game
 Including Java
32
Image courtesy of Microsoft
© Copyright Azul Systems 2017
Malmo Example Code (1)
33
AgentHost host = new AgentHost();
ClientPool clientPool = new ClientPool();
clientPool.add(new ClientInfo("10.0.0.2"));
MissionSpec mission = new MissionSpec();
mission.timeLimitInSeconds(120);
mission.requestVideo(640, 480);
© Copyright Azul Systems 2017
Malmo Example Code (2)
34
MissionRecordSpec missionRecord =
new MissionRecordSpec("./saved_data.tgz");
missionRecord.recordCommands();
missionRecord.recordMP4(20, 400000);
missionRecord.recordRewards();
missionRecord.recordObservations();
host.startMission(mission, clientPool,
missionRecord, 0, "TEST");
© Copyright Azul Systems 2017
Minecraft Interaction
 MissionSpec
– setModeToCreative
– startAt/endAt
– drawBlock/drawLine/drawSphere
 AgentHost
– startMission
– peekWorldState
– sendCommand
35
© Copyright Azul Systems 2017
Putting It All Together
© Copyright Azul Systems 2017
Demo Software Architecture
37
Laptop
Minecraft with
Malmo mod
Pi Zero 1
(Input)
SS RL4J
Pi Zero 2
(Fliter 1)
RL4JSS
Pi Zero 3
(Fliter 2)
RL4JSS
Pi Zero 4
(Output)
RL4JSS
Raspberry Pi 3
Demo Controller
Malmo Library
TCP/I
P
© Copyright Azul Systems 2017
Demo Scenario
 Original idea:
– Have agent build a house
– Turns out that’s really hard
 Demo revision 1
– Have the agent build a wall
– Simpler, but not much, than building a house
 Demo revision 2
– Have agent walk around without getting killed
– Easier reinforcement learning, reward is to stay alive
© Copyright Azul Systems 2017
Applying ML To Minecraft
 DL4J/RL4J uses vectors to represent data
– Initially use Minecraft world state
– Long term goal is to use video frames
 Have neural network extract state from this
 Start with random moves
– Record success/failure (live/die)
 Use reinforcement to (hopefully) learn how to navigate
minecraft world safely
39
© Copyright Azul Systems 2017
Conclusions & Future
Directions
© Copyright Azul Systems 2017
Conclusions
 Embedded hardware can be used for AI/ML/DL
– Model on the structure of the human brain
– Cheap to build multi-core, multi-CPU cluster
 Java is an ideal language for this
– Easy to learn
– Simple threading model
– Many, many useful libraries
 Minecraft is a fun tool for AI testing and development
41
© Copyright Azul Systems 2017
Future Directions
 More work on ML/DL for Minecraft
– Make a better player!
 Investigation of jCUDA
– Use NVidia Jetson TK1 board
 Use of machine vision
– OpenCV Java bindings
42
© Copyright Azul Systems 2017
Further Information
 www.raspberrypi.org
 clusterhat.com
 deeplearning4j.org
 minecraft.net
 www.microsoft.com/en-us/research/project/project-malmo
 zulu.org
 Code to be published on Github after some cleaning up
– Will post a blog about this
43
© Copyright Azul Systems 2017
Demo

More Related Content

What's hot

Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersSyah Dwi Prihatmoko
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...Jelastic Multi-Cloud PaaS
 
Mastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCIMastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCIGregory GUILLOU
 
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
"OpenCV for Embedded: Lessons Learned," a Presentation from itseezEdge AI and Vision Alliance
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Uri Cohen
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R projectWLOG Solutions
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...mfrancis
 
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...NETWAYS
 
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...Chris Fregly
 
Red Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABCRed Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABCRobert Bohne
 
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~Brocade
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesJimmy Angelakos
 
Performance Benchmarking of Clouds Evaluating OpenStack
Performance Benchmarking of Clouds                Evaluating OpenStackPerformance Benchmarking of Clouds                Evaluating OpenStack
Performance Benchmarking of Clouds Evaluating OpenStackPradeep Kumar
 
SK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin SummitSK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin SummitJaesuk Ahn
 
Benchmarking Openstack Installations using Rally
Benchmarking Openstack Installations using RallyBenchmarking Openstack Installations using Rally
Benchmarking Openstack Installations using RallyRama Krishna B
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operatorsJ On The Beach
 
Spring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in ActionSpring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in ActionJohn Blum
 
What is Digital Rebar Provision (and how RackN extends)?
What is Digital Rebar Provision (and how RackN extends)?What is Digital Rebar Provision (and how RackN extends)?
What is Digital Rebar Provision (and how RackN extends)?rhirschfeld
 

What's hot (20)

Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s ClustersDeploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
Deploy Prometheus - Grafana and EFK stack on Kubic k8s Clusters
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
 
Mastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCIMastering Terraform and the Provider for OCI
Mastering Terraform and the Provider for OCI
 
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
"OpenCV for Embedded: Lessons Learned," a Presentation from itseez
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R project
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
13790-basil
13790-basil13790-basil
13790-basil
 
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
Aspecio - aspect-oriented programming meets the OSGi service model - Simon Ch...
 
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
OSDC 2018 | Lifecycle of a resource. Codifying infrastructure with Terraform ...
 
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
KubeFlow + GPU + Keras/TensorFlow 2.0 + TF Extended (TFX) + Kubernetes + PyTo...
 
Red Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABCRed Hat OpenShift Operators - Operators ABC
Red Hat OpenShift Operators - Operators ABC
 
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
Event-driven automation, DevOps way ~IoT時代の自動化、そのリアリティとは?~
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on Kubernetes
 
Performance Benchmarking of Clouds Evaluating OpenStack
Performance Benchmarking of Clouds                Evaluating OpenStackPerformance Benchmarking of Clouds                Evaluating OpenStack
Performance Benchmarking of Clouds Evaluating OpenStack
 
SK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin SummitSK Telecom TACO Introduction at Berlin Summit
SK Telecom TACO Introduction at Berlin Summit
 
Benchmarking Openstack Installations using Rally
Benchmarking Openstack Installations using RallyBenchmarking Openstack Installations using Rally
Benchmarking Openstack Installations using Rally
 
An intro to Kubernetes operators
An intro to Kubernetes operatorsAn intro to Kubernetes operators
An intro to Kubernetes operators
 
Spring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in ActionSpring Data and In-Memory Data Management in Action
Spring Data and In-Memory Data Management in Action
 
What is Digital Rebar Provision (and how RackN extends)?
What is Digital Rebar Provision (and how RackN extends)?What is Digital Rebar Provision (and how RackN extends)?
What is Digital Rebar Provision (and how RackN extends)?
 

Similar to Building a Brain with Raspberry Pi and Zulu Embedded JVM

Deep Learning on Qubole Data Platform
Deep Learning on Qubole Data PlatformDeep Learning on Qubole Data Platform
Deep Learning on Qubole Data PlatformShivaji Dutta
 
2019 4-nn-and-dl-tao wang@unc-v2
2019 4-nn-and-dl-tao wang@unc-v22019 4-nn-and-dl-tao wang@unc-v2
2019 4-nn-and-dl-tao wang@unc-v2Tao Wang
 
Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018
Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018 Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018
Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018 Codemotion
 
Synthetic dialogue generation with Deep Learning
Synthetic dialogue generation with Deep LearningSynthetic dialogue generation with Deep Learning
Synthetic dialogue generation with Deep LearningS N
 
Introduction of Deep Learning
Introduction of Deep LearningIntroduction of Deep Learning
Introduction of Deep LearningMyungjin Lee
 
A Platform for Accelerating Machine Learning Applications
 A Platform for Accelerating Machine Learning Applications A Platform for Accelerating Machine Learning Applications
A Platform for Accelerating Machine Learning ApplicationsNVIDIA Taiwan
 
Build FAST Learning Apps with Docker and OpenPOWER
Build FAST Learning Apps with Docker and OpenPOWERBuild FAST Learning Apps with Docker and OpenPOWER
Build FAST Learning Apps with Docker and OpenPOWERIndrajit Poddar
 
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)Amazon Web Services
 
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...Databricks
 
TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform Seldon
 
Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)Julien SIMON
 
Deep Learning Frameworks Using Spark on YARN by Vartika Singh
Deep Learning Frameworks Using Spark on YARN by Vartika SinghDeep Learning Frameworks Using Spark on YARN by Vartika Singh
Deep Learning Frameworks Using Spark on YARN by Vartika SinghData Con LA
 
Designing High-Performance and Scalable Middleware for HPC, AI and Data Science
Designing High-Performance and Scalable Middleware for HPC, AI and Data ScienceDesigning High-Performance and Scalable Middleware for HPC, AI and Data Science
Designing High-Performance and Scalable Middleware for HPC, AI and Data ScienceObject Automation
 
Deep Learning with Apache MXNet
Deep Learning with Apache MXNetDeep Learning with Apache MXNet
Deep Learning with Apache MXNetJulien SIMON
 
Azure AI Conference Report
Azure AI Conference ReportAzure AI Conference Report
Azure AI Conference ReportOsamu Masutani
 
MCL303-Deep Learning with Apache MXNet and Gluon
MCL303-Deep Learning with Apache MXNet and GluonMCL303-Deep Learning with Apache MXNet and Gluon
MCL303-Deep Learning with Apache MXNet and GluonAmazon Web Services
 
Heroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A ServiceHeroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A ServiceCQD
 
Designing High performance & Scalable Middleware for HPC
Designing High performance & Scalable Middleware for HPCDesigning High performance & Scalable Middleware for HPC
Designing High performance & Scalable Middleware for HPCObject Automation
 

Similar to Building a Brain with Raspberry Pi and Zulu Embedded JVM (20)

Deep Learning on Qubole Data Platform
Deep Learning on Qubole Data PlatformDeep Learning on Qubole Data Platform
Deep Learning on Qubole Data Platform
 
2019 4-nn-and-dl-tao wang@unc-v2
2019 4-nn-and-dl-tao wang@unc-v22019 4-nn-and-dl-tao wang@unc-v2
2019 4-nn-and-dl-tao wang@unc-v2
 
Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018
Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018 Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018
Deep learning beyond the learning - Jörg Schad - Codemotion Rome 2018
 
Synthetic dialogue generation with Deep Learning
Synthetic dialogue generation with Deep LearningSynthetic dialogue generation with Deep Learning
Synthetic dialogue generation with Deep Learning
 
Introduction of Deep Learning
Introduction of Deep LearningIntroduction of Deep Learning
Introduction of Deep Learning
 
A Platform for Accelerating Machine Learning Applications
 A Platform for Accelerating Machine Learning Applications A Platform for Accelerating Machine Learning Applications
A Platform for Accelerating Machine Learning Applications
 
Build FAST Learning Apps with Docker and OpenPOWER
Build FAST Learning Apps with Docker and OpenPOWERBuild FAST Learning Apps with Docker and OpenPOWER
Build FAST Learning Apps with Docker and OpenPOWER
 
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
AWS re:Invent 2016: Bringing Deep Learning to the Cloud with Amazon EC2 (CMP314)
 
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
Bringing an AI Ecosystem to the Domain Expert and Enterprise AI Developer wit...
 
TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform TensorFlow 16: Building a Data Science Platform
TensorFlow 16: Building a Data Science Platform
 
Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)Deep Dive on Deep Learning (June 2018)
Deep Dive on Deep Learning (June 2018)
 
Deep Learning Frameworks Using Spark on YARN by Vartika Singh
Deep Learning Frameworks Using Spark on YARN by Vartika SinghDeep Learning Frameworks Using Spark on YARN by Vartika Singh
Deep Learning Frameworks Using Spark on YARN by Vartika Singh
 
Designing High-Performance and Scalable Middleware for HPC, AI and Data Science
Designing High-Performance and Scalable Middleware for HPC, AI and Data ScienceDesigning High-Performance and Scalable Middleware for HPC, AI and Data Science
Designing High-Performance and Scalable Middleware for HPC, AI and Data Science
 
GDSC IIITM - Discover Your Domain
GDSC IIITM  - Discover Your DomainGDSC IIITM  - Discover Your Domain
GDSC IIITM - Discover Your Domain
 
LinuxCon Europe 2013
LinuxCon Europe 2013LinuxCon Europe 2013
LinuxCon Europe 2013
 
Deep Learning with Apache MXNet
Deep Learning with Apache MXNetDeep Learning with Apache MXNet
Deep Learning with Apache MXNet
 
Azure AI Conference Report
Azure AI Conference ReportAzure AI Conference Report
Azure AI Conference Report
 
MCL303-Deep Learning with Apache MXNet and Gluon
MCL303-Deep Learning with Apache MXNet and GluonMCL303-Deep Learning with Apache MXNet and Gluon
MCL303-Deep Learning with Apache MXNet and Gluon
 
Heroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A ServiceHeroku @ Toyota Motor Europe: Platform As A Factory As A Service
Heroku @ Toyota Motor Europe: Platform As A Factory As A Service
 
Designing High performance & Scalable Middleware for HPC
Designing High performance & Scalable Middleware for HPCDesigning High performance & Scalable Middleware for HPC
Designing High performance & Scalable Middleware for HPC
 

More from Simon Ritter

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native CompilerSimon Ritter
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type PatternsSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern JavaSimon Ritter
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVMSimon Ritter
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New FeaturesSimon Ritter
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDKSimon Ritter
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologySimon Ritter
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologySimon Ritter
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?Simon Ritter
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12Simon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still FreeSimon Ritter
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondSimon Ritter
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveSimon Ritter
 

More from Simon Ritter (20)

Cloud Native Compiler
Cloud Native CompilerCloud Native Compiler
Cloud Native Compiler
 
Java On CRaC
Java On CRaCJava On CRaC
Java On CRaC
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Getting the Most From Modern Java
Getting the Most From Modern JavaGetting the Most From Modern Java
Getting the Most From Modern Java
 
Building a Better JVM
Building a Better JVMBuilding a Better JVM
Building a Better JVM
 
JDK 14 Lots of New Features
JDK 14 Lots of New FeaturesJDK 14 Lots of New Features
JDK 14 Lots of New Features
 
Java after 8
Java after 8Java after 8
Java after 8
 
How to Choose a JDK
How to Choose a JDKHow to Choose a JDK
How to Choose a JDK
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
The Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans TechnologyThe Latest in Enterprise JavaBeans Technology
The Latest in Enterprise JavaBeans Technology
 
Developing Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java TechnologyDeveloping Enterprise Applications Using Java Technology
Developing Enterprise Applications Using Java Technology
 
Is Java Still Free?
Is Java Still Free?Is Java Still Free?
Is Java Still Free?
 
Moving Towards JDK 12
Moving Towards JDK 12Moving Towards JDK 12
Moving Towards JDK 12
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
Java Is Still Free
Java Is Still FreeJava Is Still Free
Java Is Still Free
 
JDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and BeyondJDK 9, 10, 11 and Beyond
JDK 9, 10, 11 and Beyond
 
JDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep DiveJDK 9 and JDK 10 Deep Dive
JDK 9 and JDK 10 Deep Dive
 

Recently uploaded

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 

Recently uploaded (20)

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 

Building a Brain with Raspberry Pi and Zulu Embedded JVM

  • 1. © Copyright Azul Systems 2017 © Copyright Azul Systems 2015 @speakjava Building A Brain With Raspberry Pi And Zulu Embedded JVM Simon Ritter Deputy CTO, Azul Systems 1
  • 2. © Copyright Azul Systems 2017 Introduction
  • 3. © Copyright Azul Systems 2017 Inspiration 3
  • 4. © Copyright Azul Systems 2017 Human Brain Neocortex
  • 5. © Copyright Azul Systems 2017 Hierarchical Temporal Memory  Theoretical framework for how the neocortex works – Models neurons and synapses and how they interact – Also includes dendrites and precise synapses  This is different to basic neural network topologies  HTM simulated neuron far more complex – More adaptable than AI neuron – links decay over time if not used (temporal)  Potentially much better at learning 5
  • 6. © Copyright Azul Systems 2017 Introduction To Machine Learning 6
  • 7. © Copyright Azul Systems 2017 Learning For Computers  Machine Learning – Giving “computers the ability to learn without being explicitly programmed” - Arthur Samuel – Requires training data to predict future values 7
  • 8. © Copyright Azul Systems 2017 Learning For Computers  Deep Learning – “Neural networks with more than two layers” – Not necessary to have training data  Deep Reinforcement Learning – No training data – Learn by experience – Much like a human: trial and error 8
  • 9. © Copyright Azul Systems 2017 Markov Decision Process  Mathematical model of decision making – Outcome partly random, partly controlled by decision  5-tuple – S: State – A: Action – P: Probablility that action a leads to state s – R: Reward for transitioning – γ: Discount factor  Difference in importance between future and present rewards 9
  • 10. © Copyright Azul Systems 2017 Markov Decision Process 10 By waldoalvarez - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=59364518
  • 11. © Copyright Azul Systems 2017 Deep Q Network  Q: Quantity of a state-action combination – Learning rate – Discount factor – Initial conditions Used by Deep Mind to learn to play Atari games with no previous experience
  • 12. © Copyright Azul Systems 2017 Project Hardware
  • 13. © Copyright Azul Systems 2017 Raspberry Pi  Fantastically successful development board – Cheap, powerful, great connectivity – Original boards $25, Pi Zero only $5!  Officially launched on Febuary 29th 2012 – First production run was 10,000 boards – RS reported over 100,000 pre-orders in one day  Crashed servers – Over 10 million boards have been sold (Sept, 2016) 13
  • 14. © Copyright Azul Systems 2017 Raspberry Pi Variations 14 Model A Model B Pi Zero ARM v6 700 MHz ARMv6/7/8 700/900/1200 MHz ARM v6 1 GHz 1 core 1 or 4 core 1 core 256 Mb 512 Mb 512 Mb 1 Gb 512 Mb 1 x USB No Network 2/4 USB 100 Mb Ethernet WiFi/Bluetooth (v3) 1 micro USB No ethernet WiFi/Bluetooth (Zero W)
  • 15. © Copyright Azul Systems 2017 Pi Brain Architecture Network Client Laptop Raspberry Pi Cluster (Emulating HTM)
  • 16. © Copyright Azul Systems 2017 Raspberry Pi Cluster (Mk 1) 16
  • 17. © Copyright Azul Systems 2017 Raspberry Pi Cluster (Mk 2) 17
  • 18. © Copyright Azul Systems 2017 Cluster Hat 18 USB GPIO Raspberry Pi 3 Master PORT 1 PORT 2 PORT 3 PORT 4 Pi Zero W Slaves GPIO 22 GPIO 23 GPIO 24 GPIO 25 Alert LED GPIO 21
  • 19. © Copyright Azul Systems 2017 Java For Embedded Applications
  • 20. © Copyright Azul Systems 2017 Why Java?  “Write once, run anywhere” – Easy to move code between different platforms  Wide range of libraries and frameworks – Takes a lot of hard work out of app development  Simple interfacing – Pi4J and DIO libraries for Raspberry Pi  Simple concurrency – Comprehensive multi-threading support  Native code integration for complex situations – JNI 20
  • 21. © Copyright Azul Systems 2017 Azul Zulu Java For Embedded  Built from OpenJDK code base  Passes all TCK tests  Ports for Intel, ARM, PowerPC  ARM v6, v7, v8 – Soft and hard float – 64 bit close to release – C2 and C1+C2 compiler enhancements  Drop in replacement for other JVMs  No licensing restrictions (FoU) 21
  • 22. © Copyright Azul Systems 2017 Machine Learning In Java
  • 23. © Copyright Azul Systems 2017 Deep Learning Basics  Neural network nodes – Neuron takes weighted inputs that can change  Organised as layers – Non-linear processing – Different levels of problem abstraction – Good analogy to HTM model  Unsupervised learning – No initial data set – Learn by experience 23
  • 24. © Copyright Azul Systems 2017 Neural Network Elements: Node 24 Σ λ 1 X1 X2 X3 W0 W1 W2 W3
  • 25. © Copyright Azul Systems 2017 Neural Network Elements: Layers 25 Output Layer Hidden Layer Input Layer
  • 26. © Copyright Azul Systems 2017 DeepLearning4J (DL4J)  Toolkit for building, training and deploying Neural Networks – configure neural networks and build computation graphs  ND4J: N-dimensional arrays for Java – Core technology for deep learning  DataVec – Transform data into feature vectors  Arbiter – Used to evaluate and tune ML models – Hyperparameter optimisation functionality 26
  • 27. © Copyright Azul Systems 2017 RL4J Basics  Low-dimensional (state) and high-dimensional (pixels) processing – MDP class (Markov Decision Process) – DQN class (Deep Q Network) – Policy abstract class  Choose the next action given a state  ACpolicy (Actor Critic)  BoltzmannQ (Probablilty distribution)  DQNPolicy (Action with maximum Q value)  EpsGreedy (Epsilon Greedy, partially random) 28
  • 28. © Copyright Azul Systems 2017 Minecraft And Project Malmo
  • 29. © Copyright Azul Systems 2017 Minecraft  Immensly popular ‘construction’ game – Especially amongst children – Different modes: creative, survival, hardcore  PC (first) version written in Java – 121 million copies sold worldwide (all versions) – Probably most successful Java desktop app ever – Mojang aquired by Microsoft in 2014 30
  • 30. © Copyright Azul Systems 2017 Minecraft
  • 31. © Copyright Azul Systems 2017 Project Malmo  Microsoft Labs project  AI experimentation platform built on top of Minecraft – Mod for Java version of Minecraft – Libraries to write AI agents to act as player in game  Including Java 32 Image courtesy of Microsoft
  • 32. © Copyright Azul Systems 2017 Malmo Example Code (1) 33 AgentHost host = new AgentHost(); ClientPool clientPool = new ClientPool(); clientPool.add(new ClientInfo("10.0.0.2")); MissionSpec mission = new MissionSpec(); mission.timeLimitInSeconds(120); mission.requestVideo(640, 480);
  • 33. © Copyright Azul Systems 2017 Malmo Example Code (2) 34 MissionRecordSpec missionRecord = new MissionRecordSpec("./saved_data.tgz"); missionRecord.recordCommands(); missionRecord.recordMP4(20, 400000); missionRecord.recordRewards(); missionRecord.recordObservations(); host.startMission(mission, clientPool, missionRecord, 0, "TEST");
  • 34. © Copyright Azul Systems 2017 Minecraft Interaction  MissionSpec – setModeToCreative – startAt/endAt – drawBlock/drawLine/drawSphere  AgentHost – startMission – peekWorldState – sendCommand 35
  • 35. © Copyright Azul Systems 2017 Putting It All Together
  • 36. © Copyright Azul Systems 2017 Demo Software Architecture 37 Laptop Minecraft with Malmo mod Pi Zero 1 (Input) SS RL4J Pi Zero 2 (Fliter 1) RL4JSS Pi Zero 3 (Fliter 2) RL4JSS Pi Zero 4 (Output) RL4JSS Raspberry Pi 3 Demo Controller Malmo Library TCP/I P
  • 37. © Copyright Azul Systems 2017 Demo Scenario  Original idea: – Have agent build a house – Turns out that’s really hard  Demo revision 1 – Have the agent build a wall – Simpler, but not much, than building a house  Demo revision 2 – Have agent walk around without getting killed – Easier reinforcement learning, reward is to stay alive
  • 38. © Copyright Azul Systems 2017 Applying ML To Minecraft  DL4J/RL4J uses vectors to represent data – Initially use Minecraft world state – Long term goal is to use video frames  Have neural network extract state from this  Start with random moves – Record success/failure (live/die)  Use reinforcement to (hopefully) learn how to navigate minecraft world safely 39
  • 39. © Copyright Azul Systems 2017 Conclusions & Future Directions
  • 40. © Copyright Azul Systems 2017 Conclusions  Embedded hardware can be used for AI/ML/DL – Model on the structure of the human brain – Cheap to build multi-core, multi-CPU cluster  Java is an ideal language for this – Easy to learn – Simple threading model – Many, many useful libraries  Minecraft is a fun tool for AI testing and development 41
  • 41. © Copyright Azul Systems 2017 Future Directions  More work on ML/DL for Minecraft – Make a better player!  Investigation of jCUDA – Use NVidia Jetson TK1 board  Use of machine vision – OpenCV Java bindings 42
  • 42. © Copyright Azul Systems 2017 Further Information  www.raspberrypi.org  clusterhat.com  deeplearning4j.org  minecraft.net  www.microsoft.com/en-us/research/project/project-malmo  zulu.org  Code to be published on Github after some cleaning up – Will post a blog about this 43
  • 43. © Copyright Azul Systems 2017 Demo

Editor's Notes

  1. BPTT Back propogation through time