Machine Learning and Deep Learning with the Wolfram Language Jérôme Louradour - Wolfram Research [email protected] 2 2018-10-13 Aiukraine.Nb
Total Page:16
File Type:pdf, Size:1020Kb
Machine Learning and Deep Learning with the Wolfram Language Jérôme Louradour - Wolfram Research [email protected] 2 2018-10-13_AIUkraine.nb Wolfram Language http://reference.wolfram.com/language/ In[]:= ◼ 5000+ functions ◼ High-level and Coherent ◼ Interactive notebook ◼ Polished documentation ◼ Knowledgebase access 2018-10-13_AIUkraine.nb 3 In[]:= blurSingleFaceimage_, face_ := ImageComposeimage, Blurface["Image"], 20, face"Position"; BlurFacesimage_ := FoldblurSingleFace, image, FindFacesimage, "Position", "Image"; In[]:= BlurFaces Out[]= 4 2018-10-13_AIUkraine.nb In[]:= In[ ]:= What are the notable people from Kiev? Kyiv CITY notable people born in city Out[]= Mila Kunis Day: Sun 14 Aug 1983 Milla Jovovich Day: Wed 17 Dec 1975 Andriy Shevchenko Day: Wed 29 Sep 1976 Golda Meir Day: Sun 15 May 1898 Kazimir Malevich Day: Sun 23 Feb 1879 → , → , → , → , → , Vladimir Horowitz Day: Thu 1 Oct 1903 John Demjanjuk Day: Sat 3 Apr 1920 Mikhail Bulgakov Day: Fri 15 May 1891 Vaslav Nijinsky Day: Wed 12 Mar 1890 Max Levchin Year: 1975 → , → , → , → , → , Alexandr Dolgopolov Day: Mon 7 Nov 1988 Elena Baltacha Day: Sun 14 Aug 1983 Louise Nevelson Day: Sun 23 Sep 1900 Yevgeny Primakov Day: Tue 29 Oct 1929 → , → , → , → , Irène Némirovsky Day: Tue 24 Feb 1903 Sergiy Stakhovsky Day: Mon 6 Jan 1986 Victor Pinchuk Day: Wed 14 Dec 1960 German Khan Day: Fri 26 Oct 1962 → , → , → , → , Viktor Khryapa Day: Tue 3 Aug 1982 Vitaly Potapenko Day: Fri 21 Mar 1975 Anatole Litvak Day: Fri 23 May 1902 Denis Kudla Day: Mon 17 Aug 1992 Ephraim Katzir Day: Mon 29 May 1916 → , → , → , → , → , Dimitrij Ovtcharov Day: Fri 2 Sep 1988 Dema Kovalenko Day: Sun 28 Aug 1977 Anna Sten Day: Wed 16 Dec 1908 Leonid Fedun Day: Tue 5 Apr 1955 Alex Kuznetsov Day: Thu 5 Feb 1987 → , → , → , → , → , Zhan Beleniuk Day: Thu 24 Jan 1991 Mariya Koryttseva Day: Sat 25 May 1985 Nikolai Kuksenkov Day: Fri 2 Jun 1989 Anastasia Grymalska Day: Thu 12 Jul 1990 → , → , → , → , Gleb Lozino-Lozinskiy Day: Sat 25 Dec 1909 Daryna Zevina Day: Thu 1 Sep 1994 Józef Bohdan Zaleski Day: Sun 14 Feb 1802 Tetiana Luzhanska Day: Tue 4 Sep 1984 → , → , → , → , Tetyana Arefyeva Day: Tue 3 Sep 1991 Mykola Suk Day: Fri 21 Dec 1945 Mikhail Morgulis Day: Wed 1 Oct 1941 Anatoly Bannik Month: Dec 1921 Vladimir Novosiad Day: Fri 12 Apr 1968 → , → , → , → , → , Yonnie Starr Day: Fri 11 Aug 1905 Nina Svetlanova Day: Sat 23 Jan 1932 Margaryta Pesotska Day: Fri 9 Aug 1991 Angelina Kysla Day: Fri 15 Feb 1991 → , → , → , → , Anissa Khelfaoui Day: Thu 29 Aug 1991 Alexander Peli Year: 1915 Pavlo Tymoshchenko Day: Mon 13 Oct 1986 Jerzy Zagórski Day: Tue 3 Dec 1907 → , → , → , → In[]:= Hold @ Entity"City", "Kiev", "Kiev", "Ukraine"EntityProperty"City","PeopleBornInCity" Out[]= Kyiv notable people born in city Hold 2018-10-13_AIUkraine.nb 5 Machine Learning in the Wolfram Language Tools to Train, Evaluate and Deploy models ◼ Supervised Classification Classify ◼ → Regression Predict ◼ → ◼ Unsupervised Clustering FindClusters ◼ → Dimensionality reduction DimensionReduce ◼ → Density estimation LearnDistribution, AnomalyDetection ◼ → Model Zoo ◼ Big Neural Network Repository High-level Applications ◼ Computer Vision ◼ Natural Language Processing ◼ Audio Signal Processing 6 2018-10-13_AIUkraine.nb Applications: Computer Vision Object Recognition In[]:= ImageIdentify Out[]= Easter egg 2018-10-13_AIUkraine.nb 7 Semantic Feature Extraction In[]:= FacialFeatures Out[]= happiness anger Image → , Age → 26, Gender → Male, Emotion → , Image → , Age → 37, Gender → Male, Emotion → , happiness neutral Image → , Age → 44, Gender → Male, Emotion → , Image → , Age → 30, Gender → Male, Emotion → , neutral anger neutral Image → , Age → 25, Gender → Male, Emotion → , Image → , Age → 32, Gender → Male, Emotion → , Image → , Age → 26, Gender → Male, Emotion → , happiness happiness Image → , Age → 43, Gender → Male, Emotion → , Image → , Age → 28, Gender → Male, Emotion → , happiness neutral Image → , Age → 34, Gender → Male, Emotion → , Image → , Age → 30, Gender → Male, Emotion → 8 2018-10-13_AIUkraine.nb Art In[]:= ImageRestyle , Out[]= 2018-10-13_AIUkraine.nb 9 Applications: Natural Language Processing Question Answering In[]:= StringTake[WikipediaData["Sergei Polunin"], 1000] Out[]= Sergei Vladimirovich Polunin (Ukrainian: Сергій Володимирович́ Полу́нін, Serhiy Volodymyrovych Polunin; Russian: Сергей́ Владимирович́ Полунин́ , Sergey Vladimirovich Polunin; born 20 November 1989) is a Ukrainian ballet dancer, actor and model. As a freelance principal dancer, Polunin is guest artist at various theaters worldwide such as Royal Ballet, Sadler's Wells Theatre, Bolshoi Theatre, Stanislavski and Nemirovich-Danchenko Moscow Academic Music Theatre, La Scala Theatre, Teatro San Carlo and is currently permanent guest artist for the Bayerisches Staatsballet. == Life and career == Sergei Polunin was born in Kherson, Ukrainian SSR. From the age of four to eight, he trained at a gymnastics academy, and then spent another four years at the Kiev State Choreographic Institute. His mother, Galina, moved with him to Kiev, while his father, Vladimir Polunin, worked in Portugal to support them.After Polunin graduated from the Kyiv Choreographic Academy (КДХУ) he joined the British Roy In[]:= FindTextualAnswer[ WikipediaData["Sergei Polunin"], "What is the nationality of Sergei Polunin?", 3, "HighlightedSentence"] // Column Sergei Polunin was born in Kherson, Ukrainian SSR. Out[]= Polunin also holds Serbian citizenship. Sergei Vladimirovich Polunin ( Ukrainian : Сергій Володимирович́ Полунін́ , Serhiy Volodymyrovych Polunin; 10 2018-10-13_AIUkraine.nb Entity Recognition (and more...) In[]:= TextContents "The flag of Ukraine is blue and yellow. In 1934 Kiev became the capital of Soviet Ukraine. The city has a density of 3,299 people/km², with a population of 2,887,974 people in July 2015 and an area of 839 km²(324 sq mi)." String Type Position Probability Interpretation HighlightedSnippet Ukraine Country {13, 19} 0.926602 Ukraine The flag of Ukraine is blue and yellow. In 1934 Kiev became blue Color {24, 27} 0.97199 The flag of Ukraine is blue and yellow. In 1934 Kiev yellow Color {33, 38} 0.989897 of Ukraine is blue and yellow . In 1934 Kiev became the 1934 Date {44, 47} 0.860395 1934 is blue and yellow. In 1934 Kiev became the capital Kiev AdministrativeDivision {49, 52} 0.956012 Kiev, Ukraine blue and yellow. In 1934 Kiev became the capital of Kiev City {49, 52} 0.94606 Kiev, Kiev, Ukraine blue and yellow. In 1934 Kiev became the capital of Out[]= Ukraine Country {83, 89} 0.785337 Ukraine yellow. In 1934 Kiev became the capital of Soviet Ukraine . 3,299 people/km² Quantity {118, 133} 0.8 3299 people/km2 The city has a density of 3,299 people/km² , with a population of 2,887,974 people Quantity {157, 172} 0.9 2 887 974 people with a population of 2,887,974 people in July 2015 and an area July 2015 Date {177, 185} 0.934119 Jul 2015 of 2,887,974 people in July 2015 and an area of 839 839 km² Quantity {202, 208} 0.8 839 km2 people in July 2015 and an area of 839 km² (324 sq mi). 324 sq mi Quantity {210, 218} 0.8 324 mi2 people in July 2015 and an area of 839 km²( 324 sq mi ). In[]:= TextContents["I have a dog. I eat an hot dog."] String Type Position Probability Interpretation HighlightedSnippet dog Species {10, 12} 0.541379 Infraspecies:Canis Lupus Familiaris I have a dog . I eat an hot dog Out[]= hot dog Food {24, 30} 0.8 Entity["Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{Entity["FoodType", "Frankfurter"]}], EntityProperty["Food", "AddedFoodTypes"] -> ContainsExactly[{}]}] I have a dog. I eat an hot dog In[]:= notablePeople = TextCases[ WikipediaData["Kiev"], "Person" → "Interpretation"] Out[]= Abraham Ortelius Joseph M. Marshall III Aung San Suu Kyi Paul Sefchek Natalia Khoreva Aung San Suu Kyi Ptolemy Andrew Aung San Suu Kyi , , , , , , , , , Paul Sefchek , Natalia Khoreva , Batu Khan , Taras Shevchenko , Cyril of Alexandria , Josef Stalin , Vitali Klitschko , Vitali Klitschko , Tsar Nicholas I , Lenin , Josef Stalin , Vladimir the Great , Aung San Suu Kyi , Natalia Khoreva , Mikhail Bulgakov , Viktor Yanukovych , Shakira , Mikhail Bulgakov , Valentin Boreyko , Martin Luther King Vladimir Horowitz Milla Jovovich Kazimir Malevich Golda Meir Alexander Markowich Ostrowski Nicholas Pritzker II Andriy Shevchenko Igor Sikorsky , , , , , , , , 2018-10-13_AIUkraine.nb 11 In[]:= notablePeopleBornInKiev = DeleteDuplicates@SelectnotablePeople, # place of birth === Kyiv CITY & Out[]= Mikhail Bulgakov Vladimir Horowitz Milla Jovovich Kazimir Malevich Golda Meir Andriy Shevchenko , , , , , In[]:= AssociationThreadnotablePeopleBornInKiev → EntityValuenotablePeopleBornInKiev, occupation Out[]= Mikhail Bulgakov { } Vladimir Horowitz { } Milla Jovovich { } Kazimir Malevich { } Golda Meir { } Andriy Shevchenko { } → author , → pianist , → actor , → painter , → politician , → soccer player In[]:= TextCases WikipediaData["Kiev"], Mikhail Bulgakov PERSON , Vladimir Horowitz PERSON , Milla Jovovich PERSON , Kazimir Malevich PERSON , Golda Meir PERSON , Andriy Shevchenko PERSON → "HighlightedSnippet" Out[]= Mikhail Bulgakov → Andrew's Church; the home of Kiev born writer, Mikhail Bulgakov ; the monument to Yaroslav the Wise, the Grand, Mikhail Bulgakov , Russian writer, Vladimir Horowitz Milla Jovovich → Vladimir Horowitz , classical pianist, → Milla Jovovich , American actress, Kazimir Malevich - → Kazimir Malevich , pioneer of geometric abstract art and the originator of the avant garde Suprematist movement, Golda Meir Andriy