{"componentChunkName":"component---src-templates-blog-post-js","path":"/data/machine-learning/","result":{"data":{"site":{"siteMetadata":{"title":"Explain Programming","author":"André Kovac","siteUrl":"https://www.explainprogramming.com"}},"markdownRemark":{"id":"b188a66b-7807-5764-a9ae-bab62f9ace81","excerpt":"General concepts Papers Read about current machine learning papers: https://paperswithcode.com/ Neural Network Last layer is usually called . Recurrent Neural…","html":"<h2 id=\"general-concepts\" style=\"position:relative;\"><a href=\"#general-concepts\" aria-label=\"general concepts permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>General concepts</h2>\n<h3 id=\"papers\" style=\"position:relative;\"><a href=\"#papers\" aria-label=\"papers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Papers</h3>\n<p>Read about current machine learning papers: <a href=\"https://paperswithcode.com/\" target=\"_blank\" rel=\"nofollow\">https://paperswithcode.com/</a></p>\n<h3 id=\"neural-network\" style=\"position:relative;\"><a href=\"#neural-network\" aria-label=\"neural network permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Neural Network</h3>\n<p>Last layer is usually called <code class=\"language-text\">L</code>.</p>\n<h4 id=\"recurrent-neural-networks\" style=\"position:relative;\"><a href=\"#recurrent-neural-networks\" aria-label=\"recurrent neural networks permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Recurrent Neural Networks</h4>\n<ul>\n<li><a href=\"http://karpathy.github.io/2015/05/21/rnn-effectiveness/\" target=\"_blank\" rel=\"nofollow\">The Unreasonable Effectiveness of Recurrent Neural Networks</a></li>\n<li><a href=\"https://stanford.edu/~shervine/teaching/cs-230/cheatsheet-recurrent-neural-networks\" target=\"_blank\" rel=\"nofollow\">Recurrent Neural Networks cheatsheet</a></li>\n</ul>\n<h5 id=\"machine-learning-and-sound\" style=\"position:relative;\"><a href=\"#machine-learning-and-sound\" aria-label=\"machine learning and sound permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Machine Learning and Sound</h5>\n<ul>\n<li><a href=\"https://analyticsindiamag.com/using-deep-learning-for-sound-classification-an-in-depth-analysis/\" target=\"_blank\" rel=\"nofollow\">Using Deep Learning For Sound Classification: An In-Depth Analysis</a></li>\n</ul>\n<h4 id=\"reinforcement-learning\" style=\"position:relative;\"><a href=\"#reinforcement-learning\" aria-label=\"reinforcement learning permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Reinforcement Learning</h4>\n<ul>\n<li><a href=\"https://www.youtube.com/watch?v=zR11FLZ-O9M&#x26;list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf\" target=\"_blank\" rel=\"nofollow\">MIT 6.S091: Introduction to Deep Reinforcement Learning (Deep RL)</a></li>\n<li><a href=\"https://medium.com/@SmartLabAI/reinforcement-learning-algorithms-an-intuitive-overview-904e2dff5bbc\" target=\"_blank\" rel=\"nofollow\">Reinforcement Learning algorithms — an intuitive overview</a></li>\n<li>Article about <a href=\"https://thegradient.pub/the-promise-of-hierarchical-reinforcement-learning/\" target=\"_blank\" rel=\"nofollow\">Hierarchical Reinforcement Learning</a></li>\n</ul>\n<h4 id=\"deep-learning\" style=\"position:relative;\"><a href=\"#deep-learning\" aria-label=\"deep learning permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Deep Learning</h4>\n<ul>\n<li><a href=\"https://deeplearning.mit.edu/\" target=\"_blank\" rel=\"nofollow\">Deep Learning course by Lex Fridman</a></li>\n<li><a href=\"https://www.youtube.com/watch?v=0VH1Lim8gL8\" target=\"_blank\" rel=\"nofollow\">Deep Learning State of the Art (2020)</a></li>\n</ul>\n<h4 id=\"convolutional-neural-network\" style=\"position:relative;\"><a href=\"#convolutional-neural-network\" aria-label=\"convolutional neural network permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Convolutional Neural Network</h4>\n<ul>\n<li><a href=\"https://mc.ai/convolutional-neural-networks-in-10-steps-lesson-3-fast-ai/\" target=\"_blank\" rel=\"nofollow\">Great fast.ai explanation with Excel</a></li>\n</ul>\n<h5 id=\"layers\" style=\"position:relative;\"><a href=\"#layers\" aria-label=\"layers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Layers</h5>\n<ul>\n<li><strong>Pooling</strong> layer: Combination of fields via a function (e.g. <code class=\"language-text\">MAX_POOLING</code>) - no parameters to learn</li>\n<li>\n<p><strong>Convolutional</strong> layers: Applying a convolution function with weights to learn and update</p>\n<ul>\n<li><a href=\"https://towardsdatascience.com/types-of-convolutions-in-deep-learning-717013397f4d\" target=\"_blank\" rel=\"nofollow\">Here</a> different convolutional layers are described.</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"activation-function\" style=\"position:relative;\"><a href=\"#activation-function\" aria-label=\"activation function permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Activation function</h3>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 590px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/26c1715d39aa6f0f02d6a7256f3b048d/f55e8/activationFunctions.jpg\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 106.75675675675676%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAVABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAe21SKICg//EABcQAAMBAAAAAAAAAAAAAAAAAAABEBH/2gAIAQEAAQUCiqMv/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAwEBPwEf/8QAFBEBAAAAAAAAAAAAAAAAAAAAIP/aAAgBAgEBPwEf/8QAGBAAAgMAAAAAAAAAAAAAAAAAADEBECD/2gAIAQEABj8CY6nX/8QAHBABAAMAAgMAAAAAAAAAAAAAAQARIUFRMWGR/9oACAEBAAE/IW918gImpZPM3pOSWrYjfc5HqBRP/9oADAMBAAIAAwAAABDABzz/xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/EB//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAECAQE/EB//xAAbEAEAAwEBAQEAAAAAAAAAAAABABEhMWFBcf/aAAgBAQABPxBLdBFoJZenIlI6tNI4p+PJbQpyH1XMGvbKOixRsyB+3P/Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Activation Functions\"\n        title=\"Activation Functions\"\n        src=\"/static/26c1715d39aa6f0f02d6a7256f3b048d/1c72d/activationFunctions.jpg\"\n        srcset=\"/static/26c1715d39aa6f0f02d6a7256f3b048d/a80bd/activationFunctions.jpg 148w,\n/static/26c1715d39aa6f0f02d6a7256f3b048d/1c91a/activationFunctions.jpg 295w,\n/static/26c1715d39aa6f0f02d6a7256f3b048d/1c72d/activationFunctions.jpg 590w,\n/static/26c1715d39aa6f0f02d6a7256f3b048d/a8a14/activationFunctions.jpg 885w,\n/static/26c1715d39aa6f0f02d6a7256f3b048d/f55e8/activationFunctions.jpg 918w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<ul>\n<li>\n<p>The <a href=\"https://en.wikipedia.org/wiki/Rectifier_(neural_networks)\" target=\"_blank\" rel=\"nofollow\">rectifier</a> is a popular activation function - the positive part of its argument.</p>\n<blockquote>\n<p>A unit employing the rectifier is also called a <strong>rectified linear unit</strong> (ReLU)</p>\n</blockquote>\n<p>In pytorch: <code class=\"language-text\">res.max(tensor(0.0))</code> or <code class=\"language-text\">F.relu</code> (plot it: <code class=\"language-text\">plot_function(F.relu)</code>)</p>\n</li>\n</ul>\n<p>Why <strong>ReLU</strong>? - <strong>Vanishing gradient problem</strong>. Easy to compute.</p>\n<p><strong>Leaky</strong> ReLU - instead of 0 for x &#x3C; 0 -> choose slightly decreasing value</p>\n<p>The universal approximation theorem shows that any function can be approximated as closely as needed using just one nonlinearity. So why do we normally use more?</p>\n<h3 id=\"mindset\" style=\"position:relative;\"><a href=\"#mindset\" aria-label=\"mindset permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Mindset</h3>\n<ul>\n<li>\n<p><strong>Data Science</strong> Mindset</p>\n<p>Prefer ugly pipeline over nicely implemented pipeline</p>\n</li>\n<li>\n<p><strong>Engineering</strong> Mindset</p>\n<p>Build nice pipeline</p>\n</li>\n</ul>\n<h3 id=\"accuracy--recall-tradeoff\" style=\"position:relative;\"><a href=\"#accuracy--recall-tradeoff\" aria-label=\"accuracy  recall tradeoff permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><a href=\"https://en.wikipedia.org/wiki/Precision_and_recall#Recall\" target=\"_blank\" rel=\"nofollow\">Accuracy / recall tradeoff</a></h3>\n<p><strong>Accuracy/Precision</strong>: Correct vs. total amount of test cases (only works reliably for data sets where classes are well balanced).</p>\n<ul>\n<li>True Positives / (True Positives + False Positives)</li>\n<li>Own words: They really positive ones among the ones you believe are positive.</li>\n</ul>\n<p><strong>Recall</strong>: Ability of a model to find all the relevant cases within a dataset:</p>\n<ul>\n<li>True Positives / (True Positives + False Negatives)</li>\n<li>Own words: They ones successfully found to be positive ones among all the really positive ones (i.e. the ones who should have been found as positive).</li>\n<li><strong>Note</strong>: False negative: You think it’s positive although it’s not, i.e. falsly say its negative, e.g. telling someone they don’t have cancer although they actually do.</li>\n<li>Can easily be achieved by just labeling all as positive. —> Also need precision.</li>\n</ul>\n<p><strong>F_1 score</strong>: Harmonic mean of recall and precision</p>\n<ul>\n<li><strong>Formula</strong>: 2 * (precision * recall) / (precision + recall)</li>\n<li><strong>Note</strong>: Harmonic mean punishes extreme differences between precision and recall</li>\n</ul>\n<h2 id=\"confustion-matrix\" style=\"position:relative;\"><a href=\"#confustion-matrix\" aria-label=\"confustion matrix permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Confustion matrix</h2>\n<p>Compare everything in a confusion matrix.</p>\n<ul>\n<li><strong>True Positive (TP)</strong>: Correctly classified as positive</li>\n<li><strong>True Negative (TN)</strong>: Correctly classified as negative</li>\n<li><strong>False Positive (FP)</strong>: Incorrectly classified as positive (I say it’s positive although it’s not)</li>\n<li><strong>False Negative (FN)</strong>: Incorrectly classified as negative (I say it’s negative although it’s not)</li>\n</ul>\n<h3 id=\"specificity-vs-sensitivity\" style=\"position:relative;\"><a href=\"#specificity-vs-sensitivity\" aria-label=\"specificity vs sensitivity permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Specificity vs. Sensitivity</h3>\n<ul>\n<li>\n<p><strong>Specificity</strong>: True Negative Rate</p>\n<ul>\n<li><strong>Formula</strong>: TN / All negative cases = TN / (TN + FP)</li>\n<li>How well can I find the truely negative ones, aka. the irrelevant ones?</li>\n<li>How well can I rule out the truely negative ones?</li>\n<li><strong>Reduce false positives</strong> for a higher specificity.</li>\n</ul>\n<blockquote>\n<p>“Specificity” is often remembered as “SpPIn” (like <strong>“specifically pinning down”</strong> a disease or condition), as it refers to the proportion of true negative cases that are correctly identified by a test.</p>\n</blockquote>\n<blockquote>\n<p>“Specificity” - “SpPIn” (like “Specificity Pins Down” the true negatives)</p>\n</blockquote>\n</li>\n<li>\n<p><strong>Sensitivity</strong>: True Positive Rate</p>\n<ul>\n<li><strong>Formula</strong>: TP / All positive cases = TP / (TP + FN)</li>\n<li>How well can I find the truely positive ones, aka. the relevant ones?</li>\n<li>\n<p><strong>Reduce false negatives</strong> for a higher sensitivity.</p>\n<blockquote>\n<p>“Sensitivity” is often remembered as “SnNout” (like “sniffing out” a disease or condition), as it refers to the proportion of true positive cases that are correctly identified by a test.]</p>\n</blockquote>\n</li>\n</ul>\n<blockquote>\n<p>“Sensitivity” - “SeSeize” (like “Sensitivity Seizes” the true positives)</p>\n</blockquote>\n</li>\n</ul>\n<h4 id=\"examples\" style=\"position:relative;\"><a href=\"#examples\" aria-label=\"examples permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Examples</h4>\n<ul>\n<li><em>🩻 medical test (e.g. cancer screening)</em> want a high <strong>sensitivity</strong> -> screening tests aim to accurately identify people with cancer, thereby having a high true positive rate - you don’t want to miss a person with cancer. Avoidance of false positives (false alarms) is not the main goal - so people who don’t have cancer might be falsely identified as having cancer. </li>\n<li><em>✈️ airport security scanners</em> want high specificity -> they are able to accurately identify non-threat objects (i.e. identify passangers without bombs)</li>\n</ul>\n<h3 id=\"how-to-choose-the-right-threshold\" style=\"position:relative;\"><a href=\"#how-to-choose-the-right-threshold\" aria-label=\"how to choose the right threshold permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to choose the right threshold?</h3>\n<blockquote>\n<p>How to decide whether to prefer specificity or sensitivity?</p>\n</blockquote>\n<ul>\n<li>Decide what is more dangerous: False positive or false negative?</li>\n<li>An airport security scanner is an example for a system where false positives (an actual weapon not detected) are more dangerous than false negatives (stopping a person although they don’t have a weapon).</li>\n<li>A medical test is an example for a system where false negatives are more dangerous than false positives.</li>\n<li>\n<p><strong>ROC curve</strong>: Plot sensitivity vs. 1 - specificity</p>\n<ul>\n<li><strong>Note</strong>: 1 - specificity = false positive rate (FPR) = 1 - TN / (TN + FP)</li>\n</ul>\n</li>\n<li>\n<p><strong>AUC</strong>: Area under the ROC curve</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">- **Note**: AUC = 1: Perfect classifier\n- **Note**: AUC = 0.5: Random classifier</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span><span></span></span></pre></div>\n</li>\n</ul>\n<h3 id=\"data-loader\" style=\"position:relative;\"><a href=\"#data-loader\" aria-label=\"data loader permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Data Loader</h3>\n<p>An iterator which collects the data and makes it ready to be trained by a neural network.</p>\n<h3 id=\"understand-model\" style=\"position:relative;\"><a href=\"#understand-model\" aria-label=\"understand model permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Understand model</h3>\n<p>Show what weights are doing.. what does one of the first layers do/emphasize?</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-python line-numbers\"><code class=\"language-python\">show_image<span class=\"token punctuation\">(</span>w<span class=\"token punctuation\">[</span><span class=\"token number\">2</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">.</span>view<span class=\"token punctuation\">(</span><span class=\"token number\">28</span><span class=\"token punctuation\">,</span><span class=\"token number\">28</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span></code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n<h3 id=\"classification\" style=\"position:relative;\"><a href=\"#classification\" aria-label=\"classification permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Classification</h3>\n<p><strong>Exclusive</strong> vs. <strong>non-exclusive</strong> classes.</p>\n<p>Use <em>one-hot-encoding</em> to encode output layer.</p>\n<h4 id=\"activation-functions\" style=\"position:relative;\"><a href=\"#activation-functions\" aria-label=\"activation functions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Activation functions</h4>\n<p>How to filter the output value of a neuron before passing it on.</p>\n<ol>\n<li>\n<p>Non-exclusive classes</p>\n<p>Use <code class=\"language-text\">Sigmoid</code> activation function</p>\n</li>\n<li>\n<p>Exclusive classes</p>\n<ul>\n<li>Use <code class=\"language-text\">Softmax</code> activation function to ensure that sum of all classes equals 1.</li>\n<li>This way you can choose the value with highest probability.</li>\n</ul>\n</li>\n</ol>\n<h3 id=\"gradient-descent\" style=\"position:relative;\"><a href=\"#gradient-descent\" aria-label=\"gradient descent permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Gradient descent</h3>\n<ul>\n<li>\n<p>Metric vs. Loss</p>\n<ul>\n<li>Metric is what we really care about (to communicate result to humans)</li>\n<li>Loss is smooth function which does not have plateaus or bumps and where you can take a good derivative</li>\n</ul>\n<p>e.g. …</p>\n</li>\n<li>\n<p>Cost/Loss functions</p>\n<ul>\n<li>Regression problems: <strong>Quadratic cost</strong></li>\n<li>Classification problems: <strong>Cross entropy</strong> - model predicts a probablity distribution over all classes.</li>\n</ul>\n</li>\n<li>\n<p>Optimized <strong>learning rate</strong></p>\n<ul>\n<li>Adaptive gradient descent</li>\n<li>Optimizer: Adam: A Method for Stochastic Optimization</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"backpropagation\" style=\"position:relative;\"><a href=\"#backpropagation\" aria-label=\"backpropagation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Backpropagation</h3>\n<ol>\n<li>How sensitive is cost function to changes in weight matrix <code class=\"language-text\">w</code>?</li>\n<li>Take partial derivative of cost function with respect to weight <code class=\"language-text\">w</code>.</li>\n<li>Apply chain-rule to get <code class=\"language-text\">dC/dw = dC/da * da/dz * dz/dw</code>.</li>\n<li>Compute <code class=\"language-text\">dC/db</code> to also compute how much a change in the bias impacts the cost.</li>\n<li><a href=\"https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/\" target=\"_blank\" rel=\"nofollow\">A Step by Step Backpropagation Example</a></li>\n</ol>\n<p><strong>Stochastic</strong> gradient descent: Uses random mini-batches instead of calculating the gradient of the entire dataset.</p>\n<h2 id=\"terms\" style=\"position:relative;\"><a href=\"#terms\" aria-label=\"terms permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Terms</h2>\n<ul>\n<li><strong>Hadamard Product</strong>: Element-by-element multiplication of two vectors</li>\n<li><strong>Noise profile</strong> of generated inputs</li>\n</ul>\n<h2 id=\"resources\" style=\"position:relative;\"><a href=\"#resources\" aria-label=\"resources permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Resources</h2>\n<ul>\n<li>\n<p>A nice machine learning graphic:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 590px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/92e7280c6dda560d7e2407fd1e558792/ec605/machine-learning-graphic.jpg\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 129.05405405405406%; position: relative; bottom: 0; left: 0; background-image: url('data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAaABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAECAwQF/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/9oADAMBAAIQAxAAAAHu1RWWgkVXStBIQf/EABsQAAIDAAMAAAAAAAAAAAAAAAABAhExEiEy/9oACAEBAAEFAmchO1L3DSVi6FkB4j//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAEDAQE/AR//xAAUEQEAAAAAAAAAAAAAAAAAAAAg/9oACAECAQE/AR//xAAeEAAABAcAAAAAAAAAAAAAAAAAARAhESAxQXGBwf/aAAgBAQAGPwIcSN8ih7RgTlL/AP/EABwQAAIDAAMBAAAAAAAAAAAAAAERACExEEFxUf/aAAgBAQABPyEhkCaCx0MsLHsEBAPzgQBoz4OAe3fkodlgXGR7BCau7gjpMn2f/9oADAMBAAIAAwAAABArF8P/xAAXEQEAAwAAAAAAAAAAAAAAAAAQARFB/9oACAEDAQE/ELg0/8QAFhEBAQEAAAAAAAAAAAAAAAAAEBEx/9oACAECAQE/ENIf/8QAHBABAAMAAwEBAAAAAAAAAAAAAQARITFBUWFx/9oACAEBAAE/EEW1vML7hBQt3X92ERLOhSSziCwhMriaoSxVo92QKKMIBSKhZfrmXZ5QFt/MgAbpsACN8G8sJgG+RLY3H//Z'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Machine Learning Graphic\"\n        title=\"Machine Learning Graphic\"\n        src=\"/static/92e7280c6dda560d7e2407fd1e558792/1c72d/machine-learning-graphic.jpg\"\n        srcset=\"/static/92e7280c6dda560d7e2407fd1e558792/a80bd/machine-learning-graphic.jpg 148w,\n/static/92e7280c6dda560d7e2407fd1e558792/1c91a/machine-learning-graphic.jpg 295w,\n/static/92e7280c6dda560d7e2407fd1e558792/1c72d/machine-learning-graphic.jpg 590w,\n/static/92e7280c6dda560d7e2407fd1e558792/a8a14/machine-learning-graphic.jpg 885w,\n/static/92e7280c6dda560d7e2407fd1e558792/ec605/machine-learning-graphic.jpg 1125w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n</li>\n<li><a href=\"https://blog.dataiku.com/machine-learning-explained-algorithms-are-your-friend\" target=\"_blank\" rel=\"nofollow\">Machine Learning Explained: Algorithms Are Your Friend</a></li>\n</ul>\n<h2 id=\"tools\" style=\"position:relative;\"><a href=\"#tools\" aria-label=\"tools permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Tools</h2>\n<ul>\n<li><a href=\"https://lobe.ai/\" target=\"_blank\" rel=\"nofollow\">Lobe.ai</a> - Upload a few tagged samples - it creates ML model for you.</li>\n</ul>\n<h2 id=\"transfer-learning\" style=\"position:relative;\"><a href=\"#transfer-learning\" aria-label=\"transfer learning permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Transfer Learning</h2>\n<ul>\n<li>Complex Model (many parameters) trained on small amount of data generalizes badly!</li>\n<li>See <a href=\"https://www.youtube.com/watch?v=BqqfQnyjmgg&#x26;list=PLo2EIpI_JMQtNtKNFFSMNIZwspj8H7-sQ&#x26;index=3\" target=\"_blank\" rel=\"nofollow\">this video</a> from hugging faces about it.</li>\n</ul>\n<h2 id=\"ensemble\" style=\"position:relative;\"><a href=\"#ensemble\" aria-label=\"ensemble permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Ensemble</h2>\n<p>Winning Kaggle Contributions are usually an ensemble of neural networks</p>\n<h2 id=\"transformers\" style=\"position:relative;\"><a href=\"#transformers\" aria-label=\"transformers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><a href=\"https://en.wikipedia.org/wiki/Transformer_(machine_learning_model)\" target=\"_blank\" rel=\"nofollow\">Transformers</a></h2>\n<p>Deep Learning with Attention.</p>\n<h2 id=\"computer-vision\" style=\"position:relative;\"><a href=\"#computer-vision\" aria-label=\"computer vision permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Computer Vision</h2>\n<h3 id=\"up-and-down-movement-detection-algorithm\" style=\"position:relative;\"><a href=\"#up-and-down-movement-detection-algorithm\" aria-label=\"up and down movement detection algorithm permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Up-and down Movement detection algorithm</h3>\n<ol>\n<li>An area of interest in the center of the image between <code class=\"language-text\">0.45</code> and <code class=\"language-text\">0.55</code> percent of the height is defined.</li>\n<li>\n<p>The image data comes in as a long array (height x width) and it’s overall (sampled at every third pixel) grayscale values (Hex values between <code class=\"language-text\">#000</code> and <code class=\"language-text\">#fff</code>) are averaged.</p>\n<p>Android: Inside a for loop over all pixels these grayScaleValues are summed up:</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-java line-numbers\"><code class=\"language-java\">grayScaleValue <span class=\"token operator\">=</span> data<span class=\"token punctuation\">[</span>i<span class=\"token punctuation\">]</span> <span class=\"token operator\">&amp;</span> <span class=\"token number\">0xFF</span><span class=\"token punctuation\">;</span></code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n</li>\n<li>Additionally, grayscale values of a small area (less than <code class=\"language-text\">0.025</code> percent) at the top of the image is also recorded and used to normalize the values of the center (e.g. for cases in which the phone moves and thus the background changes)</li>\n<li>The overall grayscale values of this area are moved around the mean value so that traversals of objects through the center of the screen are detected via detecting changes from negative to positive (and vice versa) values between subsequent frames.</li>\n<li>The final result is <code class=\"language-text\">innerZeroCrossings</code> - <code class=\"language-text\">outerZeroCrossings</code>. In fact the object which traverses the center (<code class=\"language-text\">innerZeroCrossings</code>) has to be more prominent than the grayscale changes in the background (<code class=\"language-text\">outerZeroCrossings</code>). Otherwise, the center (inner) grayscale change is just a copy of the grayscale changes in the periphery of the image.</li>\n</ol>\n<h3 id=\"detect-unusual-sound\" style=\"position:relative;\"><a href=\"#detect-unusual-sound\" aria-label=\"detect unusual sound permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Detect unusual sound</h3>\n<ol>\n<li>Collect baseline sound pressure level</li>\n<li>Compare sound to baseline</li>\n</ol>\n<h2 id=\"links\" style=\"position:relative;\"><a href=\"#links\" aria-label=\"links permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Links</h2>\n<h3 id=\"good-reads\" style=\"position:relative;\"><a href=\"#good-reads\" aria-label=\"good reads permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Good reads</h3>\n<ul>\n<li><a href=\"http://neuralnetworksanddeeplearning.com/\" target=\"_blank\" rel=\"nofollow\">Neural Networks and Deep Learning is a free online book.</a></li>\n<li><a href=\"https://github.com/chiphuyen/machine-learning-systems-design\" target=\"_blank\" rel=\"nofollow\">Machine Learning Systems Design - with exercises</a></li>\n<li><a href=\"https://github.com/andkret/Cookbook\" target=\"_blank\" rel=\"nofollow\">The Data Engineering Cookbook - by Andreas Kraetz</a></li>\n<li><a href=\"https://blog.google/products/search/discovering-millions-datasets-web/\" target=\"_blank\" rel=\"nofollow\">Millions of accessible data sets</a></li>\n<li><a href=\"https://github.com/aburkov/theMLbook\" target=\"_blank\" rel=\"nofollow\">The 100 page machine learning book</a></li>\n<li><a href=\"https://www.slideshare.net/sawjd/deep-learning-for-natural-language-processing-by-roopal-garg\" target=\"_blank\" rel=\"nofollow\">Deep Learning for Natural Language Processing</a></li>\n<li><a href=\"https://github.com/oxford-cs-ml-2015\" target=\"_blank\" rel=\"nofollow\">Oxford Machine Learning Course</a></li>\n</ul>\n<h3 id=\"links-from-daniel-wessel-motius\" style=\"position:relative;\"><a href=\"#links-from-daniel-wessel-motius\" aria-label=\"links from daniel wessel motius permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Links from Daniel Wessel (Motius)</h3>\n<ul>\n<li><a href=\"https://www.reddit.com/r/learnmachinelearning/\" target=\"_blank\" rel=\"nofollow\">https://www.reddit.com/r/learnmachinelearning/</a> usually has a lot of good and interesting content for beginners</li>\n<li><a href=\"https://developers.google.com/machine-learning/guides/rules-of-ml\" target=\"_blank\" rel=\"nofollow\">https://developers.google.com/machine-learning/guides/rules-of-ml</a> a set of best practices for doing ML at google which can be applied to our own projects</li>\n<li><a href=\"https://github.com/mercari/ml-system-design-pattern\" target=\"_blank\" rel=\"nofollow\">https://github.com/mercari/ml-system-design-pattern</a></li>\n<li><a href=\"https://github.com/chiphuyen/machine-learning-systems-design\" target=\"_blank\" rel=\"nofollow\">https://github.com/chiphuyen/machine-learning-systems-design</a></li>\n<li><a href=\"https://github.com/AMAI-GmbH/AI-Expert-Roadmap/\" target=\"_blank\" rel=\"nofollow\">https://github.com/AMAI-GmbH/AI-Expert-Roadmap/</a></li>\n<li><a href=\"https://github.com/EthicalML/awesome-production-machine-learning\" target=\"_blank\" rel=\"nofollow\">https://github.com/EthicalML/awesome-production-machine-learning</a></li>\n</ul>\n<h2 id=\"universal-approximation-theorem\" style=\"position:relative;\"><a href=\"#universal-approximation-theorem\" aria-label=\"universal approximation theorem permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Universal approximation theorem</h2>\n<p>Adding non-linearity -> You can approximate any function if weights and bias are big enough.</p>\n<h2 id=\"how-to-run-it\" style=\"position:relative;\"><a href=\"#how-to-run-it\" aria-label=\"how to run it permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to run it</h2>\n<ul>\n<li>\n<p><a href=\"https://colab.research.google.com/\" target=\"_blank\" rel=\"nofollow\">Colab</a></p>\n<ul>\n<li>Use a graphics card for free for ~12 hours</li>\n</ul>\n</li>\n</ul>","frontmatter":{"title":"Machine Learning","description":"General concepts and useful links concerning machine learning","category":"data","tags":["data-science","machine-learning"]},"fields":{"slug":"/data/machine-learning/"}}},"pageContext":{"slug":"/data/machine-learning/","previous":{"fields":{"slug":"/markdown/"},"frontmatter":{"title":"Markdown"}},"next":{"fields":{"slug":"/web-development/web-developer-tools/"},"frontmatter":{"title":"Web Developer Tools"}}}},"staticQueryHashes":["2311906963","2901804786","3096804680"]}