Roman Weber (Geschäftsführer)
Richard Schmid (Senior Consultant)
Experiments with Tensor Flow 23.05.2017
Inhaber geführt
29
Mitarbeiter CH
2001
Gegründet
Beratung Umsetzung
Betrieb Support
IT Anbieter Partner
WEBGATE CONSULTING WEBGATE CONSULTING
Ex
WebGate North America Boston, MA, USA
WebGate HQ Dietikon, Schweiz
WebGate Support Center Brno, Czech Republic
inxire GmbH Frankfurt, Deutschland
Batix Software GmbH Saalfeld, Deutschland
4
A Smart Home?
WEBGATE WELTWEIT
WebGate USA Boston
WebGate HQ Dietikon
WebGate Support Center Brno, Tschechische Republik
6
Playing GO?
• Go is an ancient board game for two players that originated in China more than 2,000 years ago, played on a grid of 19×19 lines.
• The object of the game is to use one's stones to control a larger amount of territory of the board than the opponent.
7
«Brute Force does not help!»
“Go” has more possible positions than there are atoms in the universe.
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
times more complex than chess
An “intelligent” machine is needed instead of brute force playing
8
AlphaGo wins 5-0
• October 2015, AlphaGo wins 5-0 against the reigning 3-times European Champion, Fan Hui
• March 2016: AlphaGo beats Lee Sedol (top player in the world) 4 to 1
9
AlphaGo by Google DeepMind The Goal: Win Go against humans using a combination of tree search and deep neural networks
Buzzword bingo list: • Traditional MCTS (Monte Carlo Tree Search) • Neural networks (one for policy, one for value) • SL Supervised Learning • RL Reinforcement Learning
Full details → search for: AlphaGoNaturePaper.pdf
10
What’s behind Google’s AlphaGo
Torch7
TensorFlow Custom GPU’s called TPU (Tensor Processing Units) ASIC chip for machine learning, specifically optimized for TensorFlow, more efficient than Nvidia GPUs. The final version of AlphaGo used 40 search threads, 48 CPUs, and 8 GPUs (~5 seconds per move) Google also implemented a distributed version of AlphaGo that exploited multiple machines, 40 search threads, 1,202 CPUs and 176 GPUs
11
What is TensorFlow?
● Can run on CPUs ● GPUs (NVIDIA) ● Or even distributed ● If you’re not a 3D NVIDIA graphics gamer: ● ..just launch the Machine Learning AMI in
Amazon EC2 and assign tons of GPUs
TensorFlow™ is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. The flexible architecture allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API. TensorFlow was originally developed by researchers and engineers working on the Google Brain Team within Google's Machine Intelligence research organization for the purposes of conducting machine learning and deep neural networks research, but the system is general enough to be applicable in a wide variety of other domains as well.
12
TensorFlow examples • MNIST: the “hello world” of machine learning
• Teach tensorflow to read hand written digits
● Consists of hand written digits like these:
● Each image is 28 pixels by 28 pixels. We can interpret this as a big array of numbers:
13
To train TensorFlow, feed training data (arrays of images)
• Tensor: multi-dimensional array with the shape of e.g. [55’000, 784]
• Provide 55’000 data points of training data (used to learn) • 10’000 points test data (used to test while learning) • 5’000 points validation data (used to validate final model)
• Never use the remaining 5’000 validation points while in learning mode! • Use “Amazon Mechanical Turk” to mass-classify data by humans • TensorFlow can now start learning patterns and will be able to recognize hand
written digits with ~99.2% accuracy!
14
AutoDraw
15
Object Detection
16
Cucumber Sorting
• Train with pictures to sort cucumbers according to certain criteria..
17
Playing Video Games
gym.openai.com also uses TensorFlow OpenAI is a non-profit AI research company, discovering and enacting the path to safe artificial general intelligence. Sponsors ->
18
Atari Breakout Example Game runs in a docker “VM” container TensorFlow connects to that VM via VNC remote desktop • TensorFlow can send keystrokes (left / right) • TensorFlow can “see” the game just by looking at the
framebuffer pixels (tensor arrays of bits)
• No initial rules (no ‘if this then that’), just parsing for rewards!
• The machine does not know it has to move the bar or shoot at something.
• The machine has to learn on its own by watching, trying, verifying, repeating over and over again.
19
Atari Breakout after 100 training episodes
LEVEL: your grandma
20
Atari Breakout after 200 training episodes
LEVEL: Novice
21
Atari Breakout after 400 training episodes
LEVEL: Expert
22
The AI has found the best strategy of tunnelling and hitting the ball behind the wall for maximum reward.
Atari Breakout after 600 training episodes
LEVEL: Skynet will hunt you down and destroy you!
23
Virtual Pinball Computer starts learning and plays just like a child!
24
Virtual Pinball
25
Neural Conversational Chatbot with TensorFlow
● IBM Watson Conversation
Service ● AWS Lex ● etc ● just statically scripted “intent
→ response” dialogues Alexa meets Watson Example: https://www.youtube.com/watch?v=L1aKURvL26w
26
Neural Conversational Chatbot with TensorFlow
• Feed “tensors” with text instead of binary images. • No sentence hard-wiring.
Sources:
● Cornell Movie Dialogs ● OpenSubtitles - Movie subtitles database ● Supreme court conversation data ● Or your own conversation data
27
Hours later…
28
Neural Conversational Chatbot with TensorFlow
• Results after only 1 or 2 hours of training on a GeForce GT 740M, by drastically reducing the input sequence to 5 words and output to 3.
• Result: Failed results: After additional training:
Still far from being a “Artifical General Intelligence”, but impressive nonetheless after just a few hours of studying movie transcripts on your local GPU.
29
Failure prediction
Hard to solve using rule-based approch Let’s go back to our 1st world problem..
30
Title
31
Failure Predition
• To predict failures, watch as much sensor data as possible to find patterns • An electric powered motor can have high peaks of current while starting up,
but if the current raises above normal level during operation, something smells fishy.
• Pattern recognition of deep learning should be able to detect anomalies beyond fixed rule-based min/max thresholds by including the “big picture”.
32
• Collect KNX sensor readings for several weeks (the more, the better)
● Forwarded from KNX Bus to MQTT Broker
KNX (formerly Siemens Instabus) is a 2-wire data bus similar to CAN-Bus
Failure Predition
33
Gathering «tons» of data
34
Interacting with your Smart Home The house issues audio warning to the inhabitants using text to speech technology
35
& ANSWERS QUESTIONS
36
WebGate Consulting AG
Riedstrasse 3 8953 Dietikon
Switzerland
Address +41 44 727 9393 Phone
myWebGate
CONTACT US
[email protected] Email
@RomanWebGate
@ www.webgate.biz