<![CDATA[Philipp Muens - Artifical Intelligence & Deep Learning]]>https://philippmuens.comRSS for NodeWed, 06 Mar 2019 07:28:05 GMT<![CDATA[Learning Deep Learning]]>https://philippmuens.com/posts/learning-deep-learning/https://philippmuens.com/posts/learning-deep-learning/Tue, 05 Mar 2019 00:00:00 GMT<p><a href="https://en.wikipedia.org/wiki/Deep_learning">Deep Learning</a>, a branch of <a href="https://en.wikipedia.org/wiki/Machine_learning">Machine Learning</a> gained a lot of traction and press coverage over the last couple of years. Thanks to significant scientific breakthroughs we’re now able to solve a variety of hard problems with the help of machine intelligence.</p>
<p>Computer systems were taught to <a href="https://cs.stanford.edu/people/esteva/nature/">identify skin cancer</a> with a significantly higher accuracy than human doctors do. Neural Networks can generate <a href="https://arxiv.org/pdf/1511.06434.pdf">photorealistic</a> images of <a href="https://thispersondoesnotexist.com">fake people</a> and <a href="https://research.nvidia.com/sites/default/files/pubs/2017-10_Progressive-Growing-of/karras2018iclr-paper.pdf">fake celebrities</a>. It’s even possible for an algorithm to teach itself <a href="https://deepmind.com/blog/alphastar-mastering-real-time-strategy-game-starcraft-ii/">entire games</a> from first principles, surpassing human-level mastery after only a couple of hours training.</p>
<p>In summary Deep Learning is amazing, mystical and sometimes even scary and intimidating.</p>
<p>In order to demystify and understand this “Black Box” end-to-end I decided to take a deep dive into Deep Learning, looking at it through the practical as well as the theoretical lens.</p>
<p>With this post I’d like to share the Curriculum I came up with after spending months following the space, reading books and research papers, doing lectures, classes and courses to find some of the best educational resources out there.</p>
<p>Before we take a closer look I’d like to point out that the Curriculum as a whole is still a <strong>work in progress and might change over time</strong> since new material covering state-of-the-art Deep Learning techniques is released on an ongoing basis. Feel free to bookmark this page and revisit it from time to time to stay up-to-date with the most recent changes.</p>
<h2>The Approach</h2>
<p>During the research phase which resulted in the following Curriculum I triaged dozens of classes, lectures, tutorials, talks, MOOCs, papers and books. While the topics covered were usually the same the required levels of expertise in advanced Mathematics and computer programming were not.</p>
<p>Generally speaking one can divide most educational Deep Learning resources in two categories: “Shallow” and “Deep”. Authors of “Shallow” resources tend to heavily utilize high-level Frameworks and abstractions without taking enough time to talk about the underlying theoretical pieces. “Deep” resources on the other hand usually take the bottom-up approach, starting with a lot of Mathematical fundamentals until eventually some code is written to translate the theory into practice.</p>
<p>I personally believe that both is important: Understanding how the technology works under the covers while using Frameworks to put this knowledge into practice. The proposed Curriculum is structured in a way to achieve exactly that. Learning and understanding Deep Learning from a theoretical as well as a practical point-of-view.</p>
<p>In our case we’ll approach our Deep Learning journey with a slight twist. We won’t follow a strict bottom-up or top-down approach but will blend both learning techniques together.</p>
<p>Our first touchpoint with Deep Learning will be in a practical way. We’ll use high-level abstractions to build and train Deep Neural Networks which will categorize images, predict and generate text and recommend movies based on historical user data. This first encounter is 100% practice-oriented. We won’t take too much time to learn about the Mathematical portions just yet.</p>
<p>Excited about the first successes we had we’ll brush up our Mathematical understanding and take a deep dive into Deep Learning, this time following a bottom-up approach. Our prior, practical exposure will greatly benefit us here since we already know what outcomes certain methodologies produce and therefore have specific questions about how things might work under the hood.</p>
<p>In the last part of this Curriculum we’ll learn about Deep Reinforcement Learning which is the intersection of <a href="https://en.wikipedia.org/wiki/Reinforcement_learning">Reinforcement Learning</a> and Deep Learning. A thorough analysis of <a href="https://deepmind.com/blog/alphago-zero-learning-scratch/">AlphaGo Zero</a>, the infamous agent that learned the <a href="https://en.wikipedia.org/wiki/Go_(game)">Go board game</a> from scratch and later on played against itself to become basically unbeatable by humans, will help us understand and appreciate the capabilities this approach has to offer.</p>
<p>During our journey we’ll work on two distinct Capstone projects (“Capstone I” and “Capstone II”) to put our knowledge into practice. While working on this we’ll solve real problems with Deep Neural Networks and build up a professional portfolio we can share online.</p>
<p>Once done we’ll be in a good position to continue our Deep Learning journey reading through the most recent academic research papers, implementing new algorithms and coming up with our own ideas to contribute to the Deep Learning community.</p>
<h2>The Curriculum</h2>
<p>As already discussed above, Deep Learning is… Deep. Given the traction and momentum, Universities, Companies and individuals have published a near endless stream of resources including academic research papers, Open Source tools, reference implementations as well as educational material. During the last couple of months I spent my time triaging those to find the highest quality, yet up-to-date learning resources.</p>
<p>I then took a step back and structured the materials in a way which makes it possible to learn Deep Learning from scratch up to a point where enough knowledge is gained to solve complex problems, stay on top of the current research and participate in it.</p>
<h3>1. A Practical Encounter</h3>
<p>We begin our journey in the land of Deep Learning with a top-down approach by introducing the subject “Deep Learning” in a practical and playful way. We won’t start with advanced college Math, theoretical explanations and abstract AI topics. Rather we’ll dive right into the application of tools and techniques to solve well-known problems.</p>
<p>The main reason of doing this is that it keeps us motivated since we’ll solve those problems with state-of-the-art implementations which will help us see and understand the bigger picture. It’s a whole lot easier to take a look under the covers of the abstractions we’ll use once we know what can be achieved with such. We’ll automatically come up with questions about certain results and behaviors and develop an own intuition and excitement to understand how the results came to be.</p>
<p>In doing this we’ll take the great <a href="https://course.fast.ai">“Practical Deep Learning for Coders”</a> course by the <a href="https://fast.ai">Fast.ai</a> team which will walk us through many real-world examples of Deep Neural Network usage. Theoretical concepts aren’t completely left out but will be discussed “just-in-time”.</p>
<p>It’s important to emphasize that it’s totally fine (and expected) that we won’t understand everything which is taught during this course the first time we hear about it. Most of the topics will be covered multiple times throughout this Curriculum so we’ll definitely get the hang of it later on. If you’re having problems with one topic or the other, feel free to rewatch the respective part in the video or do some research on your own. Keep in mind though that you shouldn’t get too deep into the weeds since our main focus is still on the practical portions.</p>
<p>You should definitely recreate each and every single <a href="https://jupyter.org/">Jupyter Notebook</a> which was used in the <a href="https://fast.ai">Fast.ai</a> course from scratch. This helps you to get a better understanding of the workflow and lets you play around with the parameters to see the effects they have on the data.</p>
<p>When done it’s a good idea to watch the following <a href="https://www.youtube.com/watch?v=vq2nnJ4g6N0">great talk by Google</a> and this <a href="https://www.youtube.com/playlist?list=PLWKotBjTDoLj3rXBL-nEIPRN9V3a9Cx07">mini-course by Leo Isikdogan</a> to solidify the knowledge we’ve just acquired.</p>
<h4>Resources</h4>
<ul>
<li><a href="https://course.fast.ai">Fast.ai - Practical Deep Learning for Coders</a></li>
<li><a href="https://cloud.google.com/blog/products/gcp/learn-tensorflow-and-deep-learning-without-a-phd">Learn TensorFlow and Deep Learning without a Ph.D.</a></li>
<li><a href="https://www.youtube.com/playlist?list=PLWKotBjTDoLj3rXBL-nEIPRN9V3a9Cx07">Leo Isikdogan - Deep Learning Crash Course</a></li>
</ul>
<h3>2. Mathematical Foundations</h3>
<p>Once we have a good understanding of what Deep Learning is, how it’s used in practice and how it roughly works under the hood it’s time to take a step back and refresh our Math knowledge. Deep Neural Networks heavily utilize Matrix multiplications, non-linearities and optimization algorithms such as <a href="https://en.wikipedia.org/wiki/Gradient_descent">Gradient Descent</a>. We therefore need to familiarize ourselves with <a href="https://en.wikipedia.org/wiki/Linear_algebra">Linear Algebra</a>, <a href="https://en.wikipedia.org/wiki/Calculus">Calculus</a> and some basic <a href="https://en.wikipedia.org/wiki/Probability">Probability Theory</a> which build the Mathematical foundations of Deep Learning.</p>
<p>While this is certainly advanced Mathematics it’s important to highlight that High School level Math knowledge is usually enough to get by in the beginnings. For the most part we should just refresh our knowledge a little bit. It’s definitely not advisable to spent weeks or even months studying every aspect of Linear Algebra, Calculus or Probability Theory (if that’s even possible) to consider this part “done”. Basic fluency in the aforementioned topics is enough. There’s always enough time to learn the more advanced topics as soon as we come across them.</p>
<p>Having a good Mathematical understanding will pay dividends later on as we progress with more advanced Deep Learning topics. Don’t be intimidated by this part of the Curriculum. Mathematics can and should be fun!</p>
<p>Stanford has some great refreshers on <a href="http://cs229.stanford.edu/section/cs229-linalg.pdf">Linear Algebra</a> and <a href="http://cs229.stanford.edu/section/cs229-prob.pdf">Probability Theory</a>. If that’s too shallow and you need a little bit more to get up to speed you might find Part 1 of the <a href="https://www.deeplearningbook.org">Deep Learning Book</a> helpful.</p>
<p>Once you’ve brushed up the basics it’s worthwhile to take a couple of days and thoroughly study <a href="https://arxiv.org/pdf/1802.01528.pdf">“The Matrix Calculus You Need For Deep Learning”</a> by Terence Parr and Jeremy Howard (one of the founders of <a href="https://fast.ai">Fast.ai</a>) and the <a href="https://github.com/fastai/numerical-linear-algebra">“Computational Linear Algebra”</a> course by Rachel Thomas (also a co-founder of <a href="https://fast.ai">Fast.ai</a>). Both resources are heavily tailored to teach the Math behind Deep Learning.</p>
<h4>Resources</h4>
<ul>
<li><a href="http://cs229.stanford.edu/section/cs229-linalg.pdf">Stanford CS229 - Linear Algebra Refresher</a></li>
<li><a href="http://cs229.stanford.edu/section/cs229-prob.pdf">Stanford CS229 - Probability Theory Refresher</a></li>
<li><a href="https://www.deeplearningbook.org">Deep Learning Book - Part I</a></li>
<li><a href="https://arxiv.org/pdf/1802.01528.pdf">Terence Parr, Jeremy Howard - The Matrix Calculus You Need For Deep Learning</a></li>
<li><a href="https://github.com/fastai/numerical-linear-algebra">Rachel Thomas - Computational Linear Algebra</a></li>
</ul>
<h3>3. Deep Dive</h3>
<p>Now we’re armed with a good understanding of the capabilities and the underlying Math of Deep Learning.</p>
<p>Given this it’s time to take a deep dive to broaden our knowledge of Deep Learning. The main goal of this part is to take the practical experience and blend it with our Mathematical exposure to fully understand the theoretical building blocks of Deep Neural Networks. A thorough understanding of this will be key later on once we learn more about topics such as Deep Reinforcement Learning.</p>
<p>The following describes 3 different ways to take the deep dive. The approaches are certainly not mutually exclusive but could (and should) be used in conjunction to complement each other.</p>
<p>The path you might want to take will depend on your prior exposure to Deep Learning and you favorite learning style.</p>
<p>If you’re a person who appreciates classical MOOCs in the form of high-quality, pre-recorded videos with quizzes and exercises you’ll definitely enjoy <a href="https://www.andrewng.org">Andrew Ng’s</a> <a href="https://www.deeplearning.ai/deep-learning-specialization/">Deeplearning.ai “Specialization for Deep Learning”</a>. This course is basically split up into 5 different sub-courses which will take you from the basics of Neural Networks to advanced topics such as as <a href="https://en.wikipedia.org/wiki/Recurrent_neural_network">Recurrent Neural Networks</a>. While learning about all of this you’ll also pick up a lot of valuable nuggets Andrew shares as he talks about his prior experience as a Deep Learning practicioner.</p>
<p>You can certainly get around the tuition fee for the <a href="https://www.deeplearning.ai">Deeplearning.ai</a> specialization, but it’s important to emphasize that it’s definitely worth every penny! You’ll have access to high quality course content, can request help when you’re stuck and get project reviews by classmates and experts.</p>
<p>Readers who enjoy books should definitely look into the <a href="http://d2l.ai">“Dive into Deep Learning” book</a>. This book was created to be a companion guide for the <a href="https://courses.d2l.ai/">STAT 157 course</a> at <a href="https://www.berkeley.edu">UC Berkeley</a> but turned into more than that. The main focus of this book is to be at the intersection of Mathematical formulations, real world applications and the intuition behind Deep Learning complemented by <a href="https://github.com/d2l-ai/notebooks">interactive Jupyter Notebooks</a> to play around with. “Dive into Deep Learning” covers all of the important concepts of a modern Deep Learning class. It requires no prior knowledge and starts with the basics of Neural Networks while moving onwards to cover advanced topics such as <a href="https://en.wikipedia.org/wiki/Convolutional_neural_network">Convolutional Neural Networks</a>, ending in discussions about state-of-the-art <a href="https://en.wikipedia.org/wiki/Natural_language_processing">NLP</a> implementations.</p>
<p>Another method to study Deep Learning in great detail is with the help of recorded university class videos. <a href="http://www.mit.edu">MIT</a> released the terrific <a href="http://introtodeeplearning.com">“Introduction to Deep Learning” course</a> which is basically a recording of their 6.S191 class accessible for everyone to watch! This option is definitely one of the more advanced ways to learn the subject as some prior university-level Math and Computer Science knowledge is necessary to grok it. The huge benefit of this format is that it touches on a lot of different topics other courses simply don’t cover due to missing prerequisites. If you’ve already been exposed to university-level Computer Science and Mathematics and like to learn with a focus on more rigor theory, then this course is definitely for you.</p>
<p>Whatever route you take, it’s really important that you take your time to revisit concepts and recreate their implementations from scratch. It’s totally fine if you’re struggling at first. It’s this wandering through the dark alleys where you’ll actually learn the most! Don’t waste your time passively consuming content. Go out and reproduce what you’ve just learned!</p>
<p>At the end of the day it doesn’t really matter what format you choose. All courses will equally well prepare you for the next step in your journey to Deep Learning mastery which is your first Capstone project!</p>
<h4>Resources</h4>
<ul>
<li><a href="https://www.deeplearning.ai">Deeplearning.ai - Deep Learning Specializatios)</a></li>
<li><a href="http://d2l.ai">UC Berkeley - Dive into Deep Learning</a></li>
<li><a href="http://introtodeeplearning.com">MIT - Introduction to Deep Learning</a></li>
</ul>
<h3>4. Capstone Project I</h3>
<p><strong>Focus:</strong> Supervised Deep Learning</p>
<p>Enough theory (for now). It’s time to put our hard earned knowledge to practice.</p>
<p>In our first Capstone project we’ll demonstrate that we fully understand the basic building blocks of modern Deep Learning. We’ll pick a problem of interest and solve it with the help of a Deep Neural Network. Since we’ve mostly dealt with <a href="https://en.wikipedia.org/wiki/Supervised_learning">Supervised Learning</a> so far it’s worth mentioning that our solution will be based on such an implementation.</p>
<p>Our programmatic environment will be a separate <a href="https://jupyter.org/">Jupyter Notebook</a> where we code and describe every step together with a brief justification of its necessity in great detail. Taking the time to think through the steps necessary to solve our problem helps us check ourselves as we have to think through our architecture as well as the underlying processes that take place when our code is executed.</p>
<p>To further deepen our knowledge and help us get out of the comfort zone we’ll restrict our implementation to the usage of low-level Frameworks, meaning that we’re only allowed to use Frameworks such as <a href="https://pytorch.org">PyToch</a>, <a href="https://www.tensorflow.org">TensorFlow</a> or <a href="https://mxnet.apache.org">MXNet</a>. Any usage of high-level abstraction libraries such as <a href="https://docs.fast.ai">Fastai</a> or <a href="https://keras.io">Keras</a> is <strong>strictly forbidden</strong>. Those libraries, while being great for the experienced practicioner, abstract too much away, hindering us to go through the tough decisions and tradeoffs we have to make when working on our problem.</p>
<p>Remember that this is the part where we’ll learn the most as we’re really getting into the weeds here. Don’t give up as enlightment will find you once you made it. It’s also more than ok to go back and reread / rewatch the course material if you’re having problems and need some help.</p>
<p>While working on this project always keep in mind that it’s one of your personal portfolio projects you should definitely share online. It’s those projects where you can demonstrate that you’re capable to solve complex problems with Deep Learning technologies. Make sure that you really spend a good portion of your time on it and “make it pretty”.</p>
<p>Are you struggling to find a good project to work on? Here are some project ideas which will help you get started:</p>
<ul>
<li><a href="http://yann.lecun.com/exdb/mnist/">Hand written digit recognition</a></li>
<li><a href="http://mi.eng.cam.ac.uk/research/projects/VideoRec/CamVid/">Semantic Segmentation</a></li>
<li><a href="http://ai.stanford.edu/~amaas/data/sentiment/">Sentiment Analysis</a></li>
<li><a href="http://u.cs.biu.ac.il/~koppel/BlogCorpus.htm">Natural Language Processing</a></li>
</ul>
<h3>5. Deep Reinforcement Learning</h3>
<p>Deep Reinforcement Learning is the last major topic we’ll cover in this Curriculum.</p>
<p>One might ask the question as to what the difference between the Deep Learning we’re studying and Deep Reinforcement Learning is. All the techniques we’ve learned and used so far were built around the concept of <a href="https://en.wikipedia.org/wiki/Supervised_learning">Supervised Learning</a>. The gist of Supervised Learning is that we utilize large datasets to train our model by showing it data, letting it make predictions about what it thinks the data represents and then using the labeled solution to compute the difference between the prediction and the actual solution. We then use algorithms such as <a href="https://en.wikipedia.org/wiki/Gradient_descent">Gradient Descent</a> and <a href="https://en.wikipedia.org/wiki/Backpropagation">Backpropagation</a> to subsequently readjust our model until the predictions it makes meet our expectations.</p>
<p>You might’ve already noticed that Supervised Learning heavily relies on huge datasets to train and test our models via examples.</p>
<p>What if there’s a way that our AI can teach itself what it should do based on self-exploration and guidelines we define? That’s where <a href="https://en.wikipedia.org/wiki/Reinforcement_learning">Reinforcement Learning</a> comes into play. With Reinforcement Learning we’re able to let our model learn from first principles by exploring the environment. The researches at <a href="https://deepmind.com">DeepMind</a> were one of the first who successfully <a href="https://arxiv.org/pdf/1312.5602v1.pdf">blended Deep Learning and Reinforcement Learning</a> to let an AI teach itself to <a href="https://www.youtube.com/watch?v=eG1Ed8PTJ18">play Atari games</a>. The only inputs the AI agent got were the raw input pixels and the score.</p>
<p>In this part of our Curriculum we’ll learn what Reinforcement Learning is and how we can combine Deep Learning and Reinforcement Learning to build machine intelligence which learns to master tasks in an autodidactic way.</p>
<p>As per usual there are different ways to learn Deep Reinforcement Learning.</p>
<p><a href="https://www.simoninithomas.com/">Thomas Simonini</a> has a great <a href="https://simoninithomas.github.io/Deep_reinforcement_learning_Course/">“Deep Reinforcement Learning Course”</a> which focuses on the practical pieces of Deep Reinforcement Learning as you’ll implement real world applications throughout his class.</p>
<p><a href="https://spinningup.openai.com/en/latest/">OpenAIs “SpinningUp AI”</a> course is another great resource which strikes a really good balance between practical examples and theoretical foundations.</p>
<p>If you’re looking for a University-level class which heavily focuses on the theoretical underlyings I’d highly recommend the <a href="https://github.com/enggen/DeepMind-Advanced-Deep-Learning-and-Reinforcement-Learning">“Advanced Deep Learning and Reinforcement Learning Class”</a> which was taught by <a href="https://www.ucl.ac.uk">UCL</a> and <a href="https://deepmind.com">DeepMind</a>.</p>
<p>Every resource listed here will help you understand and apply Deep Reinforcement Learning techniques. While some are more focused on the practical portions others go really deep into the trenches of theoretical rigor. It’s definitely worthwhile to look into all of them to get the all-around view and best mixture between theory and practice.</p>
<p>Once you successfully made your way through one of the Deep Reinforcement Learning courses it’s a good idea to revisit the key ideas by reading the excellent blog posts <a href="http://karpathy.github.io/2016/05/31/rl/">“Deep Reinforcement Learning: Pong from Pixels”</a> by <a href="https://cs.stanford.edu/people/karpathy/">Andrej Karpathy</a> and <a href="https://lilianweng.github.io/lil-log/2018/02/19/a-long-peek-into-reinforcement-learning.html">“A (Long) Peek into Reinforcement Learning”</a> by <a href="https://twitter.com/lilianweng/">Lilian Weng</a> as they give a nice, broader overview of the different topics which were covered during class.</p>
<p><strong>Aside:</strong> If you’re fascinatied by the possibilities of Reinforcement Learning I’d highly recommend the book <a href="http://www.incompleteideas.net/book/the-book-2nd.html">“Reinforcement Learning: An Introduction”</a> by Richard Sutton and Andrew Barto. The recently updated 2nd edition includes chapters about Neuroscience, Deep Neural Networks and more. While it’s possible and desirable to buy the book at your local bookstore you can also access the book as a freely available PDF online.</p>
<h4>Resources</h4>
<ul>
<li><a href="https://simoninithomas.github.io/Deep_reinforcement_learning_Course/">Thomas Simonini - Deep Reinforcement Learning Course</a></li>
<li><a href="https://spinningup.openai.com/en/latest/">OpenAI - SpinningUp AI Course</a></li>
<li><a href="https://www.youtube.com/watch?v=fdY7dt3ijgY">OpenAI - SpinningUp AI Talk</a></li>
<li><a href="https://github.com/enggen/DeepMind-Advanced-Deep-Learning-and-Reinforcement-Learning">Advanced Deep Learning and Reinforcement Learning 2018 Course (UCL & DeepMind)</a></li>
<li><a href="https://github.com/lebourbon/ADL_RL">Advanced Deep Learning and Reinforcement Learning 2018 Assignments</a></li>
<li><a href="http://www.incompleteideas.net/book/the-book-2nd.html">Richard Sutton, Andrew Barto - Reinforcement Learning: An Introduction</a></li>
</ul>
<h3>6. Capstone Project II</h3>
<p><strong>Focus:</strong> Deep Reinforcement Learning</p>
<p>It’s time for our second and last Capstone Project where we’ll use Deep Reinforcement Learning to let our AI teach itself to solve difficult real-world problems.</p>
<p>The same restrictions from our first Capstone project also apply here. We’ll implement the solution in a dedicated <a href="https://jupyter.org/">Jupyter Notebook</a> where we write our code and the prose to describe what we’re doing and why we’re doing it. This helps us test our knowledge since we have to take the time to think through our current implementation and its implications to the system as a whole.</p>
<p>As with the Capstone I project <strong>it’s forbidden</strong> to use higher level abstraction libraries such as <a href="https://docs.fast.ai">Fastai</a> or <a href="https://keras.io">Keras</a>. Our implementation here should only use APIs provided by lower-level Frameworks such as <a href="https://pytorch.org">PyToch</a>, <a href="https://www.tensorflow.org">TensorFlow</a> or <a href="https://mxnet.apache.org">MXNet</a>.</p>
<p>Keep in mind that it’s totally fine to feel stuck at some point. Don’t be discouraged! Take your time to revisit the material and ensure that you fill your knowledge gaps before moving on. It’s those moments of struggle where you grow the most. Once you’ve made it, you’ll feel excited and empowered.</p>
<p>The result of this Capstone project is another crucial piece of your personal Deep Learning portfolio. Make sure to set aside enough time to be able to put in the effort so that you can showcase your implementation online.</p>
<p>Do you need some inspiration for projects you might want to work on? Here’s a list with some ideas:</p>
<ul>
<li><a href="https://gym.openai.com">OpenAI Gym Exercises</a></li>
<li><a href="https://en.wikipedia.org/wiki/Connect_Four">Connect Four Game Agent</a></li>
<li><a href="https://en.wikipedia.org/wiki/Frogger">Frogger Game Agent</a></li>
</ul>
<h2>Conclusion</h2>
<p>Deep Learning has gained a lot of traction in last couple of years as major scientific breakthroughs made it finally possible to train and utilize Deep Neural Networks to perform tasks at human expert level ranging from cancer detection to mastery in games such as Go or Space Invaders.</p>
<p>In this blog post I shared the Curriculum I follow to learn Deep Learning from scratch. Right in the beginning of the journey one learns how Deep Learning techniques are used in practice to solve real-world problems. Once a baseline understanding is established it’s time to take a deep dive into the Mathematical and theoretical pieces to demystify the Deep Learning “Black Box”. A final exploration of the intersection of Deep Learning and Reinforcement Learning puts the reader in a great position to understand state-of-the art Deep Learning solutions. Throughout the whole Curriculum we’ll pratice our skills and showcase our fluency in such while working on dedicated Capstone projects.</p>
<p>While putting this together I had the feeling that this Curriculum can look quite intimidating at first glance since lots of topics are covered and it’ll definitely take some time to get through it. While I’d advise the avid reader to follow every single step in the outlined order it’s totally possible to adapt and skip some topics given that everyone has different experiences, goals and interests. Learning Deep Learning should be fun and exciting. If you ever feel exhausted or struggle to get through a certain topic you should take a step back and revisit it later on. Oftentimes complicated facts and figures turn into no-brainers if we give ourselves the permission and time to do something else for the moment.</p>
<p>I personally believe that it’s important to follow a goal while learning a new topic or skill. Make sure that you know <strong>why</strong> you want to learn Deep Learning. Do you want to solve a problem at your company? Are you planning to switch careers? Is a high level overview enough for you since you just want to be educated about AI and its social impacts? Whatever it is, keep this goal in mind as it’ll make everything reasonable and easier during the hard times when the motivation might be lacking and everything just feels too hard to pick up.</p>
<p>Do you have any questions / feedback? Feel free to reach out to me via E-Mail or Twitter!</p><![CDATA[Learning Advanced Mathematics]]>https://philippmuens.com/posts/learning-advanced-mathematics/https://philippmuens.com/posts/learning-advanced-mathematics/Tue, 19 Feb 2019 00:00:00 GMT<p>For me personally Math was one of those mysterious subjects I had to go through in school but never really understood, let alone appreciated. It was too abstract, involved lengthy computations, rode formula memorization with little to no explanation as to why it’s useful and how it’s applied in the real world. Frankly put Math was one of my weakest spots. My parents were surprised and shocked when I told them that I planned to study Computer Science, which is a branch of applied Mathematics. Throughout my life I had a love-hate relationship with Math. I still remember that feeling of relief when I passed my last Math exam in college.</p>
<p>During my career as a Software Engineer I was mostly Math absent. From time to time I consulted old Computer Science books to do some research on algorithms I then implemented. However those were usually the only touchpoints I had with Math.</p>
<p>Something changed over the last couple of years. While looking for the next personal challenges and goals to grow I figured that most of the really exciting achievements heavily utilize Math as a fundamental building block. That’s actually true for a lot of scientific fields including Econometrics, Data Science and Artifical Intelligence. It’s easy to follow the news and roughly understand how things might work but once you try to dig deeper and look under the hood it gets pretty hairy.</p>
<p>I found myself regularly lost somewhere in the dark alleys of Linear Algebra, Calculus and Statistics. Last year I finally stuck a fork in the road. I wanted to fundamentally change my understanding and decided to re-learn Math from scratch. After countless late nights, early mornings and weekends doing classes, exercises and proofs I’m finally at a pretty decent level of understanding advanced Mathematics. Right now I’m building upon this foundation to learn even more.</p>
<p>During this process I learned one important thing: <strong>Math is really amazing!</strong></p>
<blockquote>
<p>Math is the language of nature. Understanding it helps you understand how our world works!</p>
</blockquote>
<p>With this blog post I’d like to share how I went from “What is a root of a polynomial again?” to “Generalized Autoregressive Conditional Heteroskedasticity” (at least to some extend). I’ll share the Curriculum I created and followed, the mistakes I made (spoiler: I made a lot) and the most useful resources I used throughout this journey.</p>
<p>Before we start I want to be honest with you: <strong>Math is a really involved discipline. There’s a lot out there…</strong></p>
<p>And it can certainly be overwhelming. However if you’re really dedicated and want to put in those hours you’ll make it! If I can do it so can you!</p>
<p>Please keep in mind that this is the path which worked for me. This doesn’t necessarily mean that it will be as efficient for you. In my case I need to study, self-explain and practice, practice, practice to really understand a topic at hand. I know of people who can just sit in class, listen and ultimately get it. That’s definitely not how I operate.</p>
<p>Alright. Let’s get started!</p>
<h2>The Curriculum</h2>
<p>Math is one of those subjects where you’ll find a nearly endless stream of resources. Looking closer they all vary widely in terms of quality, density and understandability.</p>
<p>My first approach to ramp up my Math skills was to skim through an interesting research paper, write down all the Math I won’t understand and look those terms up to study them in greater detail. This was fundamentally wrong on many levels. After some trial and error I took a step back and did a lot of research to figure out which topics I should study to support my goal and how those topics are related to one another.</p>
<p>The Curriculum I finally put together is a good foundation if you want to jump into other <a href="https://www.thoughtco.com/hard-vs-soft-science-3975989">“Hard Sciences”</a>. My personal goal was to learn the knowledge I need to take a really deep dive into Artificial Intelligence. To be more specific I’m really excited about Deep Learning and the next steps in the direction of Machine intelligence.</p>
<p>Every topic which is covered in this Curriculum uses 3 basic pillars to build a solid Mathematical foundation:</p>
<p><strong>Intuition</strong></p>
<p>Videos, interactive visualizations and other helpful resources which outline how the Math came to be and how it works on an intuitive level.</p>
<p><strong>Deep Dive</strong></p>
<p>A good enough “deep dive” to get familiar with the foundational concepts while avoiding confusion due to overuse of theorems, proofs, lemmas, etc.</p>
<p><strong>Practicality</strong></p>
<p>Practice, practice, practice. Resources such as books with lots of exercises to solidify the knowledge.</p>
<h3>Algebra</h3>
<p>Algebra is the first topic which should be studied <strong>extensively</strong>.</p>
<p>Having a really good understanding of Algebra makes everything a whole lot easier! Calculus comes down to 90% Algebra most of the time. If you know how to solve Algebra problems you won’t have a hard time in Calculus either.</p>
<p>Most of you might remember a phrase similar to</p>
<blockquote>
<p>“Solve this equation for x”</p>
</blockquote>
<p>That’s what Algebra is about. In an Algebra class you’ll learn about the following topics:</p>
<ul>
<li>Solving equations</li>
<li>Solving inequalities</li>
<li>Polynomials</li>
<li>Factoring</li>
<li>Functions</li>
<li>Graphing</li>
<li>Symmetry</li>
<li>Fractions</li>
<li>Radicals</li>
<li>Exponents</li>
<li>Logarithms</li>
<li>Linear systems of equations</li>
<li>Nonlinear systems of equations</li>
</ul>
<p>As stated above it’s of uber importance that you really hone your Algebra skills. I’m repeating myself but Algebra is one of the main building blocks for advanced Mathematics.</p>
<h4>Resources</h4>
<ul>
<li><a href="http://tutorial.math.lamar.edu/Classes/Alg/Alg.aspx">Paul’s Online Notes - Algebra</a></li>
<li><a href="https://www.goodreads.com/book/show/41838051-no-bullshit-guide-to-mathematics">No Bullshit Guide to Mathematics</a></li>
<li><a href="https://www.mhprofessional.com/9781260120769-usa-schaums-outline-of-college-algebra-fifth-edition">Schaum’s Outlines - College Algebra</a></li>
</ul>
<h3>Trigonometry</h3>
<p>In Trigonometry you’ll study the relationship of lengths and angles of triangles.</p>
<p>You’ll learn about the unit circle and it’s relation to sin and cos, cones and their relation to circles, ellipses, parabolas and hyperbolas, Pythagoras’ Theorem and more. Trigonometry is interesting in itself since it can be immediately applied to real life problems.</p>
<p>Here’s a list of topics you’ll usually learn in a Trigonometry class:</p>
<ul>
<li>Pythagoras’ Theorem</li>
<li>Sin and cos</li>
<li>The unit circle</li>
<li>Trigonometric identities</li>
<li>Radians vs. Degree</li>
</ul>
<p>Generally speaking this course is rather short. Nevertheless it’s a good preparation class for Calculus.</p>
<h4>Resources</h4>
<ul>
<li><a href="http://tutorial.math.lamar.edu/Extras/AlgebraTrigReview/AlgebraTrigIntro.aspx">Paul’s Online Notes - Algebra Trig Review</a></li>
<li><a href="https://www.goodreads.com/book/show/41838051-no-bullshit-guide-to-mathematics">No Bullshit Guide to Mathematics</a></li>
<li><a href="https://www.mhprofessional.com/9781260011487-usa-schaums-outline-of-trigonometry-sixth-edition-group">Schaum’s Outlines - Trigonometry</a></li>
</ul>
<h3>Calculus</h3>
<p>The study of continuous change is one of the main focus areas in Calculus.</p>
<p>This might sound rather abstract and the intuition behind it is really paradox if you think about it (see <em>“Essence of Calculus”</em> below). However you might remember that you dealt with Derivatives, Limits and area calculations for functions.</p>
<p>There are usually 3 different Calculus classes (namely Calculus I, II and II) one can take. Those 3 classes range from easy topics such as “Derivatives” and “Limits” to advanced topics such as “Triple Integrals in Spherical Coordinates”. I’d suggest to definitely take the first class (Calculus I) and continue with the second one (Calculus II) if time permits. If you’re in a hurry taking Calculus I is usually sufficient.</p>
<p>In Calculus I you’ll learn about:</p>
<ul>
<li>Limits</li>
<li>Continuity</li>
<li>L’Hospitals Rule</li>
<li>Derivatives</li>
<li>Power, Product, Quotient, Chain rule</li>
<li>Higher Order Derivatives</li>
<li>Min / Max Values</li>
<li>Concavity</li>
<li>Integrals</li>
<li>Substitution Rule</li>
</ul>
<p>Calculus is an important topic since it’s heavily used in optimization problems to find local minima. The <a href="https://en.wikipedia.org/wiki/Gradient_descent">“Gradient Descent”</a> algorithm uses techniques from Calculus such as Derivatives and is leveraged in modern (Deep) Neural Networks to adjust the weights of Neurons during <a href="https://en.wikipedia.org/wiki/Backpropagation">Backpropagation</a>.</p>
<h4>Resources</h4>
<ul>
<li><a href="https://www.youtube.com/playlist?list=PLZHQObOWTQDMsr9K-rj53DwVRMYO3t5Yr">3Blue1Brown - Essence of Calculus</a></li>
<li><a href="https://the-learning-machine.com/article/machine-learning/calculus">The Learning Machine - Calculus</a></li>
<li><a href="http://tutorial.math.lamar.edu/Classes/CalcI/CalcI.aspx">Paul’s Online Notes - Calculus I</a></li>
<li><a href="https://www.goodreads.com/book/show/22876442-no-bullshit-guide-to-math-and-physics">No Bullshit Guide to Math and Physics</a></li>
<li><a href="https://www.mhprofessional.com/9780071795531-usa-schaums-outline-of-calculus-6th-edition-group">Schaum’s Outlines - Calculus</a></li>
</ul>
<h3>Linear Algebra</h3>
<p>Linear Algebra is one of the most, if not <strong>the most</strong> important topic when learning Math for Data Science, Artificial Intelligence and Deep Learning.</p>
<p>Linear Algebra is pretty much omnipresent in modern computing since it lets you efficiently do calculations on multi-dimensional data. During childhood you probably spent quite some time in in front of your computer screen while wading through virtual worlds. Photorealistic 3D renderings are possible thanks to Math and more specifically Linear Algebra.</p>
<p>Linear Algebra courses usually cover:</p>
<ul>
<li>Systems of Equations</li>
<li>Vectors</li>
<li>Matrices</li>
<li>Inverse Matrices</li>
<li>Identity Matrix</li>
<li>Matrix Arithmetic</li>
<li>Determinants</li>
<li>Dot & Cross Product</li>
<li>Vector Spaces</li>
<li>Basis and Dimension</li>
<li>Linear Transformation</li>
<li>Eigenvectors & EigenValues</li>
</ul>
<p>As already stated above, Linear Algebra is one of the most important topics in modern computing. Lots of problems such as image recognition can be broken down into calculations on multi-dimensional data.</p>
<p>You might have heard about the Machine Learning framework <a href="https://www.tensorflow.org/">TensorFlow</a> which was developed and made publicly available by <a href="https://google.com">Google</a>. Well, a <a href="https://en.wikipedia.org/wiki/Tensor">Tensor</a> is just fancy word for a higher-dimensional way to organize information. Hence a Scalar is a Tensor of rank 0, a Vector is a Tensor of rank 1, a N x N Matrix is a Tensor of rank 2, etc.</p>
<p>Another interesting fact is that Deep Neural Networks are usually trained on <a href="https://en.wikipedia.org/wiki/Graphics_processing_unit">GPUs</a> (Graphic Processing Unit) or <a href="hhttps://cloud.google.com/blog/products/gcp/an-in-depth-look-at-googles-first-tensor-processing-unit-tpu">TPUs</a> (Tensor Processing Unit). The simple reason is that GPUs and TPUs are way better at processing Linear Algebra computations compared to CPUs since (at least GPUs) were invented as a dedicated hardware unit to do exactly that when rendering computer graphics.</p>
<p>Aside: <a href="http://robotics.stanford.edu/~ang/papers/icml09-LargeScaleUnsupervisedDeepLearningGPU.pdf">Here’s</a> the original paper by Andrew Ng et al. where GPUs were first explored to carry out Deep Learning computations.</p>
<h4>Resources</h4>
<ul>
<li><a href="https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab">3Blue1Brown - Essence of Linear Algebra</a></li>
<li><a href="https://the-learning-machine.com/article/machine-learning/linear-algebra">The Learning Machine - Linear Algebra</a></li>
<li><a href="https://www.cs.cornell.edu/courses/cs485/2006sp/LinAlg_Complete.pdf">Paul’s Online Notes - Linear Algebra</a></li>
<li><a href="https://www.goodreads.com/book/show/34760208-no-bullshit-guide-to-linear-algebra">No Bullshit Guide to Linear Algebra</a></li>
<li><a href="https://www.mhprofessional.com/9781260011456-usa-schaums-outline-of-linear-algebra-sixth-edition">Schaum’s Outlines - Linear Algebra</a></li>
</ul>
<h3>Statistics & Probabilities</h3>
<p>The last topic which should be covered in this Curriculum is Statistics & Probabilities.</p>
<p>While both topics are sometimes taught separately it makes sense to learn them in conjunction since statistics and probabilities share a deep underlying relationship.</p>
<p>A typical Statistics & Probabilities class covers:</p>
<ul>
<li>Charting and plotting</li>
<li>Probability</li>
<li>Conditional Probability</li>
<li>Bayes Rule</li>
<li>Probability Distributions</li>
<li>Average</li>
<li>Variance</li>
<li>Binomial Distribution</li>
<li>Central Limit Theorem</li>
<li>Normal Distribution</li>
<li>Confidence Intervals</li>
<li>Hypothesis Test</li>
<li>Regression</li>
<li>Correlation</li>
</ul>
<p>In Data Science one usually has to deal with statistical analysis to see if the computations actually made sense. Futhermore it’s helpful to compute and visualize correlations between data and certain events. Bayes Rule is another important tool which helps us update our belief about our view of “the world” when more evidence is available. The realms of Machine Learning and Deep Learning usually deal with lots of uncertainty. Having a good toolbox to deal with this makes our life a whole lot easier.</p>
<p>A pretty popular example of applied statistics is the <a href="https://en.wikipedia.org/wiki/Monte_Carlo_tree_search">Monte Carlo Tree Search</a> algorithm. This heuristic algorithm was used in <a href="https://deepmind.com">DeepMinds</a> AI breakthrough “AlphaGo” to determine which moves it should consider while playing the <a href="https://en.wikipedia.org/wiki/Go_(game)">Go boardgame</a>.</p>
<p>Feel free to read through the <a href="https://storage.googleapis.com/deepmind-media/alphago/AlphaGoNaturePaper.pdf">official paper</a> for more information about the underlying technologies. Trust me, it’s amazing to read and understand how Math played such a huge role to build such a powerful contestant.</p>
<h4>Resources</h4>
<ul>
<li><a href="http://www.math.louisville.edu/~pksaho01/teaching/Math662TB-09S.pdf">University of Louisville - Probability and Mathematical Statistics</a></li>
<li><a href="https://www.mv.helsinki.fi/home/jmisotal/BoS.pdf">Jarkko Isotalo - Basics of Statistics</a></li>
<li><a href="https://www.math.arizona.edu/~jwatkins/statbook.pdf">Joseph Watkins - An Introduction to the Science of Statistics</a></li>
<li><a href="https://www.youtube.com/playlist?list=PLvxOuBpazmsOGOursPoofaHyz_1NpxbhA">JBStatistics - Basics of Probability</a></li>
<li><a href="https://seeing-theory.brown.edu">Brown University - Seeing Theory</a></li>
<li><a href="https://www.mhprofessional.com/9780071795579-usa-schaums-outline-of-probability-and-statistics-4th-edition-group">Schaum’s Outlines - Probability and Statistics</a></li>
</ul>
<h2>Mistakes</h2>
<p>As I already stated above it’s been quite a journey and I made lots of mistakes along the way.</p>
<p>In this section I’d like to share some of those mistakes so that you don’t have to go through this yourself.</p>
<p>The first mistake I made was jumping straight into Math without having a clear plan / Curriculum and more importantly goal. I dived right into certain topics I picked up while reading research papers and quickly figured that some of them were too advanced since I understood only little (if anything at all). My approach was to back off and start somewhere else. “Trial an error” so to say. This was obviously very costly in terms of time and resources.</p>
<p>The solution here was to actually have a clear goal (learning Math to understand the underlyings of Artificial Intelligence) and take the time to research a lot to come up with a sound Curriculum and start from there. Having that sorted out I only had to follow the path and knew that I was good.</p>
<p>During this aforementioned trial and error phase I made the mistake of taking way too many <a href="https://en.wikipedia.org/wiki/Massive_open_online_course">MOOCs</a>. Don’t get me wrong, MOOCs are great! It has never been possible before to take an MIT course from your couch. In my case exactly that was the problem. Most of the time I was passively watching the course content nodding along. After a couple of “completed courses” and the feeling of knowing the ins and outs I jumped into more sophisticated problems to figure that I developed a pretty shallow knowledge.</p>
<p>Doing a retrospective on the “completed courses” I saw that my learning style isn’t really tailored to MOOCs. I decided to switch my focus to the good old physical textbooks. I especially focused on textbooks with good didactics, lots of examples and exercises with solutions (the <a href="https://www.mhprofessional.com/schaum-s">Schaum’s Outlines</a> series is golden here). Switching from passively consuming to actively participating in the form of working through numerous exercises was really the breakthrough for me. It ensured that I left my comfort zone, went deep into the trenches and really battle-tested my knowledge about the topic at hand.</p>
<p>The other upside of using textbooks is that it made it possible to learn in a distraction free environment. No computer, no notifications, no distractions. Just me, a black coffee and my Math textbook!</p>
<p>Another, final tip I’d like to share is that you should really keep track of your feeling and engagement while studying. Do you feel fired up? Are you excited? Or are you just consuming and your thoughts are constantly wandering off because you don’t really care that much? If that’s the case then it’s usually time to move on. Don’t try to push through. There’s nothing worse than completing a course just for the sake of completing it. If it doens’t feel right or isn’t working for you it’s important to let go and move on. There’s enough material and maybe the next one suits your needs.</p>
<h2>Conclusion</h2>
<p>In this blog post I’ve shared my journey from being someone who acknowledged Math as something one should’ve heard about to someone who learned to love Math and its applications to solve complex problems. In order to really understand and learn more about Artificial Intelligence and Deep Learning I created a Curriculum which does not only cover the underlying Math concepts of such disciplines but will serve the student well when learning more about other “Hard Sciences” such as Computer Science in general, Physics, Meterology, Biology, etc.</p>
<p>I’m still early in my Math journey and there’s an infinite amout of exciting stuff to learn. With the given Curriculum I feel confident that I’ve gained a solid foundation to pick up more complex topics I’ll encounter while learning about Artificial Intelligence, Deep Learning and Advanced Mathematics in general.</p>
<p>Do you have any questions / feedback? Feel free to reach out to me via E-Mail or Twitter!</p><![CDATA[Welcome]]>https://philippmuens.com/posts/welcome/https://philippmuens.com/posts/welcome/Fri, 08 Feb 2019 19:35:00 GMT<p>Welcome to my new blog where I’ll share my recent learnings in AI, Data Science and Software Engineering.</p>