ASIM Fachgruppentreffen STS/GMMS Modellbasiert lernende Steuerung für Gelenkarmroboter FG Computational Engineering and Automation Georg Kunert, M.Eng. georg.kunert@cea-wismar.de Prof. Dr.-Ing. Thorsten Pawletta thorsten.pawletta@cea-wismar.de Heilbronn, 09. März 2018
FG CEA - HOCHSCHULE WISMAR Agenda Motivation Reinforcement Q-Learning Erweiterung zum Reinforcement Q-Learning Generierung einer Robotersteuerung aus Q-Learning Zusammenfassung/Ausblick
FG CEA - HOCHSCHULE WISMAR 3 Motivation Stand heute: Je Problem eine Steuerung Problem wird von Ingenieur gelöst und eine spezifische Lösung umgesetzt Ansatz: Je Problemklasse eine Steuerung
FG CEA - HOCHSCHULE WISMAR 4 Reinforcement Learning Zustandsänderung durch Agenten (Aktion) Rückgabe eines Folgezustandes Bewertung durch Umgebung (Belohnung)
FG CEA - HOCHSCHULE WISMAR Q-Learning am Beispiel Türme von Hanoi Q-Learning Lernalgorithmus: Reinforcement Q-Learning Beispielanwendung: Türme von Hanoi Anfangszustand Zielzustand Greedy-Zug: Q(s,a)=R(s,a)+ α max(q(a,:)) mit: a - Index des Folgezustandes s - Index des aktuellen Zustandes Q - Lernmatrix R - Belohnungsmatrix α Lernrate 5
FG CEA - HOCHSCHULE WISMAR Q-Learning am Beispiel Türme von Hanoi 6 s - Index des aktuellen Zustandes Q - Lernmatrix R - Belohnungsmatrix α - Lernrate
FG CEA - HOCHSCHULE WISMAR Q-Learning am Beispiel Türme von Hanoi 6
FG CEA - HOCHSCHULE WISMAR Q-Learning am Beispiel Türme von Hanoi 6
FG CEA - HOCHSCHULE WISMAR Q-Learning am Beispiel Türme von Hanoi 6
FG CEA - HOCHSCHULE WISMAR 7 Q-Learning am Beispiel Türme von Hanoi State Exploration
state FG CEA - HOCHSCHULE WISMAR Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R 8
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q Q(s,a) = R(s,a) + alpha * max(q(a,:));
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(1,4) = 0 + 0.8 * 0; Doppelpunkt entspricht der Matlab-Notaion Q(, : ) Alle Elemente der Zeile() der Q-Matrix
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(4,7) = 0 + 0.8 * 0;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(7,9) = 1 + 0.8 * 0;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(1,4) = 0 + 0.8 * 0;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 0,8 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(4,7) = 0 + 0.8 * 1;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 0,8 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(7,9) = 1 + 0.8 * 0;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 0,64 0,8 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(1,4) = 0 + 0.8 * 0.8;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 0,64 0,8 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(4,7) = 0 + 0.8 * 1;
state state FG CEA - HOCHSCHULE WISMAR 8 Q-Learning am Beispiel Türme von Hanoi Lernphase (stochastisch) Belohungsmatrix R Lernmatrix Q 0,64 0,8 1 Q(s,a) = R(s,a) + alpha * max(q(a,:)); Q(7,9) = 1 + 0.8 * 0;
FG CEA - HOCHSCHULE WISMAR 9 Erweitertes Reinforcement Q-Learning
FG CEA - HOCHSCHULE WISMAR 10 Erweitertes Q-Learning s - Index des aktuellen Zustandes Q - Lernmatrix R - Belohnungsmatrix α - Lernrate
FG CEA - HOCHSCHULE WISMAR Erweitertes Q-Learning 11 s - Index des aktuellen Zustandes Q - Lernmatrix R - Belohnungsmatrix α - Lernrate
FG CEA - HOCHSCHULE WISMAR 12 Erweitertes Q-Learning Q-Matrix mit Nullen zurücksetzen for 1 to Anzahl(Zustände) for 1 to Anzahl(Zeilen der Q-Matrix) for 1 to Anzahl(Spalten der Q-Matrix) Q(state,)=R(state, ) + α max(q(, : )) end for end for end for Doppelpunkt entspricht der Matlab-Notaion Q(, : ) Alle Elemente der Zeile() der Q-Matrix
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state state FG CEA - HOCHSCHULE WISMAR 13 Erweitertes Q-Learning Lernphase Belohungsmatrix R Lernmatrix Q
state FG CEA - HOCHSCHULE WISMAR 14 Erweitertes Q-Learning Lernphase Lernmatrix Q
FG CEA - HOCHSCHULE WISMAR 15 Generierung einer Robotersteuerung
FG CEA - HOCHSCHULE WISMAR Generierung einer Robotersteuerung 16
FG CEA - HOCHSCHULE WISMAR 17 Generierung einer Robotersteuerung Entwicklung der Datenstruktur A
FG CEA - HOCHSCHULE WISMAR 18 Generierung einer Robotersteuerung Entwicklung der Datenstruktur A
FG CEA - HOCHSCHULE WISMAR Generierung einer Robotersteuerung Rahmenprogramm der Robotersteuerung 19 Anz_Steine = 4; Trumhoehe = [Anz_Steine,0,0]; //Auf erstem Stab sind vier Steine P(:,1) = [422,211,263,-135,0-110]; // erste Ablageposition P(:,2) = [622,211,263,-135,0,-90]; // zweite Ablageposition P(:,3) = [822,211,263,-135,0,-70]; // dritte Ablageposition A = RF_QL_TvH(Anz_Steine); //Lernalgorithmus - globale Variablenübergabe Doppelpunkt entspricht der Matlab-Notaion Q(, : ) Alle Elemente der Zeile() der Q-Matrix
FG CEA - HOCHSCHULE WISMAR Generierung einer Robotersteuerung Rahmenprogramm der Robotersteuerung 19 for k=1 to Anzahl(Zeilen von A) if Umweg_noetig(Turmhoehe) //mittlerer Turm darf nicht umgefahren werden umwegp = Umweg_berechnen(A,k); rmove(r(1),umwegp); end //pick PickPos = P(A(k,1),:); // Pickposition wird anhand der A-Liste ermittelt rmove(r(1),pickpos); grapper( close ); //Greifer schließen Doppelpunkt entspricht der Matlab-Notaion Q(, : ) Alle Elemente der Zeile() der Q-Matrix
FG CEA - HOCHSCHULE WISMAR Generierung einer Robotersteuerung Rahmenprogramm der Robotersteuerung 20 end for if Umweg_noetig(Turmhoehe) //mittlerer Turm darf nicht umgefahren werden umwegp = Umweg_berechnen(A,k); rmove(r(1),umwegp); end //place PlacePos = P(A(k,2),:); // Placeposition wird anhand der A-Liste ermittelt rmove(r(1),a(k,2); grapper( open ); //Greifer oeffnen Trumhoehe = TurmhoehenBerechnung(); Doppelpunkt entspricht der Matlab-Notaion Q(, : ) Alle Elemente der Zeile() der Q-Matrix
FG CEA - HOCHSCHULE WISMAR 21 Generierung einer Robotersteuerung
FG CEA - HOCHSCHULE WISMAR 22 Zusammenfassung/Ausblick Maschinelles Lernen kann zur Generierung einer Robotersteuerung genutzt werden Lernen in der virtuellen Umgebung Anpassung in der realen Umgebung Erweiterung des Reinforcement Learning Beschleunigung von diesem Lernverfahren Ein Programm für eine Problemklasse Kombination von maschinellen Lernverfahren Anwendung von maschinellen Lernverfahren in komplexen Anwendungen
FG CEA - HOCHSCHULE WISMAR 24 Quellen (1) Wojciech Samek, Thomas Wiegand, Klaus-Robert Müller: Explainable EXPLAINABLE ARTIFICAL INTELLIGENCE: UNDERSTANDING, VISUALIZING AND INTERPRETING DEEP LEARNING MODELS, ITU Journal: ICT Discoveries, Special Issue No1 (2017) Forschungsgruppe CEA http://www.cea-wismar.de/tbx/kk_robotic_tbx/kk_robotic_tbx.html (14.01.217) Gunner Maletzki : Rapid Control Prototyping komplexer und flexibeler Robotersteuerungen auf Basis des SBC-Ansatzes; Dissertation, Universität Rostock/Hochschule Wismar (2013)
FG CEA - HOCHSCHULE WISMAR 25 Quellen (2) Birger Freymann, Thorsten Pawletta, Sven Pawletta: Multi-Robotersteuerung mit variablen Interaktionsprinzipien auf Basis des Simulation Based Control Frameworks an dem Discrete Event System Specification Formalismus. In: Proc. of ASIM-Treffen STS/GMMS, ARGSIM Report AR 50, ARGSIM/ASIM Pub. Vienna/Austria pp. 67-77 (DOI: 10.13140 / RG.2.1.3667.0564) (2015) MathWorks: Introducing Maschine Learning https://de.mathworks.com/content/dam/mathworks/tagteam/objects/i/88174_92991v00_machine_learning_section1_ebook.pdf (4.12.2017) Ethem Alpaydin: MACHINE LEARNING : the new AI; MIT Press essential; ISBN 978026259518(2016)
FG CEA - HOCHSCHULE WISMAR 26 Quellen (3) Toby Segaran: Kollektive Intelligenz analysieren, programmieren und nutzen; O Reilly Verlag; ISBN-13 978-3-89721-780-5 (2008) Kyle I S Harrington: INTRODUCING TO MACHINE LEARNING AND DATA MINING, http://kephale.github.io/tuftscomp135_spring2016/lecture19/#/2 (01.11.2017) Oliver Kramer, Computational Intelligence - Eine Einführung; DOI 10.1007/978-3-540-79739-5 (2009)