SpringOne Tour / Istanbul
Java Champion, JavaOne Rockstar, plays well with others, etc :-)
Author of several Java/JavaFX/RaspPi books
Developer Advocate & International Speaker for
Mission: "Transform how the world builds software"
Mission: "Transform how the world builds software"
@JavaFXpert
From introductory video in Machine Learning course (Stanford University & Coursera) taught by Andrew Ng.
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
(e.g. market segment discovery, and social network analysis)
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
(using the Iris flower data set)
@JavaFXpert
@JavaFXpert
@JavaFXpert
(inputs)
(output)
@JavaFXpert
(aka Deep Belief Network when multiple hidden layers)
@JavaFXpert
@JavaFXpert
@JavaFXpert
forward propagation
@JavaFXpert
For each layer:
Multiply inputs by weights:
(1 x 8.54) + (0 x 8.55) = 8.54
Add bias:
8.54 + (-3.99) = 4.55
Use sigmoid activation function:
1 / (1 + e
-4.55
) = 0.99
@JavaFXpert
@JavaFXpert
back propagation (minimize cost function)
@JavaFXpert
Linear Regression app developed by Katharine Beaumont
@JavaFXpert
Contains details on how weights and biases are adjusted during back propagation
@JavaFXpert
@JavaFXpert
Spring makes REST services and WebSockets easy as π
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
For each of the four dataset icons (Circle, Exclusive Or, Gaussian, and Spiral):
Practice tuning neural network hyperparameters
Excellent article by Preetham V V on neural networks and choosing hyperparameters
@JavaFXpert
Convolutional Neural Network for recognizing images
@JavaFXpert
@JavaFXpert
[by Adit Deshpande]
http://scs.ryerson.ca/~aharley/vis/ [by Adam Harley]
@JavaFXpert
What is happening? What is most likely to happen next?
@JavaFXpert
What is happening? What is most likely to happen next?
@JavaFXpert
@JavaFXpert
vs. traditional feed-forward network
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
@KatharineCodes @JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
word2vec vector representations of words
@JavaFXpert
word2vec vector offsets for gender relationships
@JavaFXpert
word2vec vector offsets for plural relationships
@JavaFXpert
word2vec vector arithmetic
@JavaFXpert
King – Man + Woman = Queen
@JavaFXpert
using Tensorflow Embedding Projector
@JavaFXpert
@JavaFXpert
@JavaFXpert
@JavaFXpert
Challenge: Given that there is only one state that gives a reward, how can the agent work out what actions will get it to the reward?
(AKA the credit assignment problem)
Goal of an episode is to maximize total reward
@JavaFXpert
In this example, all actions are deterministic
@JavaFXpert
@JavaFXpert
From BasicBehavior example in https://github.com/jmacglashan/burlap_examples
@JavaFXpert
@JavaFXpert
Low discount factors cause agent to prefer immediate rewards
@JavaFXpert
How often should the agent try new paths vs. greedily taking known paths?
@JavaFXpert
Left | Right | Up | Down | |
---|---|---|---|---|
... | ||||
2, 7 | 2.65 | 4.05 | 0.00 | 3.20 |
2, 8 | 3.65 | 4.50 | 4.50 | 3.65 |
2, 9 | 4.05 | 5.00 | 5.00 | 4.05 |
2, 10 | 4.50 | 4.50 | 5.00 | 3.65 |
... |
Q-Learning table of expected values (cumulative discounted rewards) as a result of taking an action from a state and following an optimal policy. Here's an explanation of how calculations in a Q-Learning table are performed.
Actions
States
@JavaFXpert
Learning to win from experience rather than by being trained
@JavaFXpert
@JavaFXpert
X
O
Our learning agent is the "X" player, receiving +5 for winning, -5 for losing, and -1 for each turn
The "O" player is part of the Environment. State and reward updates that it gives the Agent consider the "O" play.
@JavaFXpert
States | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---|---|---|---|---|---|---|---|---|---|
O I X I O X X I O, O won | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
I I I I I I O I X, in prog | 1.24 | 1.54 | 2.13 | 3.14 | 2.23 | 3.32 | N/A | 1.45 | N/A |
I I O I I X O I X, in prog | 2.34 | 1.23 | N/A | 0.12 | 2.45 | N/A | N/A | 2.64 | N/A |
I I O O X X O I X, in prog | +4.0 | -6.0 | N/A | N/A | N/A | N/A | N/A | -6.0 | N/A |
X I O I I X O I X, X won | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A |
... |
Q-Learning table of expected values (cumulative discounted rewards) as a result of taking an action from a state and following an optimal policy
Actions (Possible cells to play)
Unoccupied cell represented with an I in the States column
@JavaFXpert
@JavaFXpert
@JavaFXpert
Andrew Ng video:
https://www.coursera.org/learn/machine-learning/lecture/zcAuT/welcome-to-machine-learning
Iris flower dataset:
https://en.wikipedia.org/wiki/Iris_flower_data_set
Visual neural net server:
http://github.com/JavaFXpert/visual-neural-net-server
Visual neural net client:
http://github.com/JavaFXpert/ng2-spring-websocket-client
Deep Learning for Java: http://deeplearning4j.org
Spring initializr: http://start.spring.io
A.I Duet application: http://aiexperiments.withgoogle.com/ai-duet/view/
Self driving car video: https://vimeo.com/192179727
@JavaFXpert