experiments with tensor flow 06.07 - webgate · pdf fileexperiments with tensor flow...

33
Roman Weber (Geschäftsführer) Richard Schmid (Senior Consultant) Experiments with Tensor Flow 06.07.2017

Upload: donguyet

Post on 06-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Roman Weber(Geschäftsführer)

Richard Schmid(Senior Consultant)

Experiments with Tensor Flow06.07.2017

2

A Smart Home?

WEBGATE WELTWEIT

WebGate USABoston

WebGate HQDietikon

WebGate Support CenterBrno, Tschechische Republik

4

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.

5

«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

6

AlphaGo wins!

• 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

• May 2017, AlphaGo beats Ke Jie, ranked world Nr. 1 in a 3 game match.

AlphaGo currently holds 9-dan by the Korea Baduk Association and the professional 9-dan by Chinese Weiqi Association

7

AlphaGo by Google DeepMindThe 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

8

What’s behind Google’s AlphaGoTorch7TensorFlow

Custom GPU’s called TPU (Tensor Processing Units)

ASIC chip for machine learning, specifically optimizedfor 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

9

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. TensorFlowwas 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.

10

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:

11

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!

12

AutoDraw

13

Object Detection

14

Cucumber Sorting

• Train with pictures to sort cucumbers according to certain criteria..

15

Playing Video Games

gym.openai.com also uses TensorFlow

OpenAI is a non-profit AI research company,

discovering and enacting the path to safeartificial general intelligence.

Sponsors ->

16

Atari Breakout ExampleGame runs in a docker “VM” containerTensorFlow 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.

17

Atari Breakoutafter 100 training episodes

LEVEL: your grandma

18

Atari Breakoutafter 200 training episodes

LEVEL: Novice

19

Atari Breakoutafter 400 training episodes

LEVEL: Expert

20

The AI has found the best strategy of tunnelling and hitting the ball behind the wall for maximum reward.

Atari Breakoutafter 600 training episodes

LEVEL: Skynet will hunt you down and destroy you!

21

Virtual PinballComputer starts learning and plays just like a child!

22

Virtual Pinball

23

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

24

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

25

Hours later…

26

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.

27

Failure prediction

Hard to solve using rule-based approch

Let’s go back to our 1st world problem..

28

Title

29

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”.

30

• 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

31

Gathering «tons» of data

32

Interacting with your Smart Home

The house issuesaudio warning tothe inhabitantsusing text tospeech technology

33

WebGate Consulting AG

Riedstrasse 38953 Dietikon

Switzerland

Address+41 44 727 9393Phone

myWebGate

CONTACT US

[email protected]

@RomanWebGate

@ www.webgate.biz