Deep Learning
mit TensorFlow.js
Jens Siebert (@jens_siebert)
WebMontag Kassel, 03. Februar 2020
https://www.slideshare.net/JensSiebert1
Künstliche Intelligenz
Künstliche Intelligenz
Künstliche Intelligenz
KI vs. Machine Learning vs. Deep Learning
Künstliche Intelligenz
Machine Learning
Deep Learning
Klassische Algorithmen vs. Deep Learning
Model
Architektur
Model
RegelnDaten Ergebnis
Trainings-Daten
Regeln
Ergebnis
Daten
Training Inferenz
TensorFlow – Frameworks für Deep Learning
TensorFlow
• Training + Inferenz
• Client + Server
• GPU Beschleunigung
(CUDA)
• C++/Python + Language
Bindings
TensorFlow.js
• Inferenz (+ Training)
• Client (Browser) + Server
(Node.js)
• GPU Beschleunigung
(WebGL oder CUDA)
• JavaScript
TensorFlow Lite
• Inferenz
• Mobile + eingebettete
Systeme
• C/C++
Tensoren…
𝑅𝑎𝑛𝑔 0 = 1
𝑅𝑎𝑛𝑔 1 =
1
2
𝑅𝑎𝑛𝑔 2 =
1 2
3 4
Deep Learning – Neuronale Netze
∑
w1
x1
⍴w2
x2
wn
xn
Eingaben Gewichte
Übertragungs-
funktion
Aktivierungs-
funktion
Ausgabe
o
𝑜 = 𝜌
𝑖=1
𝑛
𝑥𝑖 𝑤𝑖
.
.
.
Deep Learning – Neuronale Netze
i1
x1
i2
x2
i3
x3
h11
h12
h13
h14
h15
h21
h22
h23
h24
h25
o1
o2
Input-Layer Hidden-Layer(s) Output-Layer
Ein neuronales Netz mit TensorFlow bauen...
const model = tf.sequential();
model.add(tf.layers.dense({
inputShape:[224, 224, 3],
units: 100,
activation: 'sigmoid'
}));
model.add(tf.layers.dense({units: 100, activation: 'sigmoid'}));
model.add(tf.layers.dense({units: 1, activation: 'sigmoid'}));
Überwachtes Lernen
i1
x1
i2
x2
i3
x3
h11
h12
h13
h14
h15
h21
h22
h23
h24
h25
o1
o2
l3
l1
l2
l2
𝐸 =
1
2
𝑖=1
𝑛
(𝑙𝑖 − 𝑜𝑖)2
Optimizer
Ein neuronales Netz trainieren…
model.compile({
optimizer: 'adam',
loss: 'binaryCrossentropy',
metrics: ['accuracy']
});
await model.fit(trainData.data, trainData.labels, {
batchSize,
epochs,
validationSplit: 0.2, …
Convolutional Neural Networks
Convolutional Layer(s) Classification Layer(s)
class: „golden retriever“
probability: 0.86
Transfer Learning
❌
Transfer Learning
class: „dog“
probability: 0.94
Feature Extraction Model Classification Model
Literatur
Vielen Dank!
https://www.tensorflow.org/js
https://github.com/tensorflow/tfjs-examples
https://github.com/tensorflow/tfjs-models
Slides: https://www.slideshare.net/JensSiebert1
Code: https://bitbucket.org/jenssiebert/wmksdeeplearning
Twitter: @jens_siebert

Deep Learning mit TensorFlow.js