<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Jesper Dramsch</title>
    <description>The latest articles on Forem by Jesper Dramsch (@jesperdramsch).</description>
    <link>https://forem.com/jesperdramsch</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F435637%2F2350b268-4c36-4ab7-b03d-7cc2ef86513c.jpg</url>
      <title>Forem: Jesper Dramsch</title>
      <link>https://forem.com/jesperdramsch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jesperdramsch"/>
    <language>en</language>
    <item>
      <title>Deepmind built a competitive coding AI called AlphaCode here's the gist of it</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Sun, 06 Feb 2022 16:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/deepmind-built-a-competitive-coding-ai-called-alphacode-heres-the-gist-of-it-2o5c</link>
      <guid>https://forem.com/jesperdramsch/deepmind-built-a-competitive-coding-ai-called-alphacode-heres-the-gist-of-it-2o5c</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OnINt4gj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-deepmind-alphacode.thumbnail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OnINt4gj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-deepmind-alphacode.thumbnail.jpg" alt="" width="450" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm obsessed with Alphacode.&lt;/p&gt;

&lt;p&gt;How do you go from a mediocre text generator to an AI that can compete competitively?&lt;/p&gt;

&lt;p&gt;Deepmind attempts this with AlphaCode.&lt;/p&gt;

&lt;p&gt;Let's look at their research together.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I can safely say the results of AlphaCode exceeded my expectations. I was sceptical because even in simple competitive problems it is often required not only to implement the algorithm, but also (and this is the most difficult part) to invent it. AlphaCode managed to perform at the level of a promising new competitor. I can't wait to see what lies ahead! ~ Mike Mirzayanov&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WEgHV0ed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dramsch.net/images/alphacode.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WEgHV0ed--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dramsch.net/images/alphacode.gif" alt="Quick scroll though the Alphacode blog post" width="880" height="790"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  😼 The Problem
&lt;/h2&gt;

&lt;p&gt;Competitive programming is a whiteboard interview on steroids.&lt;/p&gt;

&lt;p&gt;You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text problem statements&lt;/li&gt;
&lt;li&gt;Description of inputs&lt;/li&gt;
&lt;li&gt;Specifics of outputs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You have to understand and implement a solution.&lt;/p&gt;

&lt;p&gt;Finally there are hidden tests.&lt;/p&gt;

&lt;p&gt;The Backspace Problem &lt;a href="https://ioi.te.lv/oi/pdf/v14_2020_133_142.pdf"&gt;(Mirzayanov, 2020)&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lrmiJ543--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-backspace-problem.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lrmiJ543--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-backspace-problem.jpg" alt="The Backspace Problem (Mirzayanov, 2020)" width="421" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  💾 The Data
&lt;/h2&gt;

&lt;p&gt;Best results were obtained by Pre-training on the entirety of Github. Not just Python (the target language) but C++, C#, Go, Java, Rust......&lt;/p&gt;

&lt;p&gt;Then fine-tuning the AI on the CodeContests dataset&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Teach AI code&lt;/li&gt;
&lt;li&gt;Get into competitions&lt;/li&gt;
&lt;li&gt;???&lt;/li&gt;
&lt;li&gt;Profit!&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3️⃣ ???
&lt;/h2&gt;

&lt;p&gt;There is a third step:&lt;/p&gt;

&lt;p&gt;Reduce False Positives.&lt;/p&gt;

&lt;p&gt;Create extra hidden tests.&lt;/p&gt;

&lt;p&gt;Large test variance reduces false positives.&lt;/p&gt;

&lt;p&gt;Implementing "slow positives" reduces inefficient code.&lt;/p&gt;

&lt;p&gt;Going from 12 to 200+ tests/problem shows significant improvement!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bqhXnOr0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-codeforces-false-positives.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bqhXnOr0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-codeforces-false-positives.jpg" alt="False positive rate on different datasets" width="637" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ☝️ Intermission: Amazing tools
&lt;/h2&gt;

&lt;p&gt;"Hypothesis" can automatically generate more tests for you:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hypothesis.works"&gt;https://hypothesis.works&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Advent of code is competitive coding light often with "slow positives":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://adventofcode.com"&gt;adventofcode.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dramsch.net/posts/every-december-i-become-a-better-programmer-and-you-could-too/"&gt;My Short essay&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔬 The Evaluation
&lt;/h2&gt;

&lt;p&gt;You can't just submit solutions until one works in competitive coding.&lt;/p&gt;

&lt;p&gt;So to simulate that Deepmind settled on a n@k metric.&lt;/p&gt;

&lt;p&gt;Submit n solutions to k coding problems.&lt;/p&gt;

&lt;p&gt;They're going for n=10, so 10@k to evaluate AlphaCode.&lt;/p&gt;

&lt;p&gt;(Also pass@k as an upper bound.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XkrmJHOw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-nk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XkrmJHOw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-nk.jpg" alt="Performance of Deepmind AlphaCode on different problems" width="880" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🧮 The Algorithm
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Train a model on a bunch of code.&lt;/li&gt;
&lt;li&gt;Then focus on contests. &lt;/li&gt;
&lt;li&gt;Then generate a bunch of potential solutions.&lt;/li&gt;
&lt;li&gt;Filter out trivial solutions.&lt;/li&gt;
&lt;li&gt;Cluster similar solutions.&lt;/li&gt;
&lt;li&gt;Select candidates (at most 10).&lt;/li&gt;
&lt;li&gt;Submit and evaluate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2HaONTT7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-algorithm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2HaONTT7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-algorithm.jpg" alt="The Deepmind AlphaCode algorithm" width="880" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🤖 It's a transformer!
&lt;/h2&gt;

&lt;p&gt;Specifically, encoder-decoder architecture takes flat text + tokenized metadata.&lt;/p&gt;

&lt;p&gt;Tokenizer: &lt;a href="https://arxiv.org/abs/1808.06226"&gt;SentencePiece (Kudo &amp;amp; Richardson, 2018)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Internally, uses &lt;a href="https://arxiv.org/abs/1911.02150"&gt;multi-query attention (Shazeer, 2019)&lt;/a&gt; but shared key &amp;amp; value per attention block.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://alphacode.deepmind.com/"&gt;Visualize the multi-query model here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🦾 Let's stop here. This is long.
&lt;/h2&gt;

&lt;p&gt;AlphaCode is an above-average competitive programmer.&lt;/p&gt;

&lt;p&gt;The paper has ablation studies on tricks in the transformer&lt;/p&gt;

&lt;p&gt;and compares impact of different pre-training datasets&lt;/p&gt;

&lt;p&gt;and different training tricks.&lt;/p&gt;

&lt;p&gt;It's a &lt;a href="https://storage.googleapis.com/deepmind-media/AlphaCode/competition_level_code_generation_with_alphacode.pdf"&gt;great read&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DIiAU-5f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-performance.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DIiAU-5f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/alphacode-performance.jpg" alt="Performance of AlphaCode on the Codeforces website." width="880" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pre-train on huge GitHub data&lt;/li&gt;
&lt;li&gt;Fine-tune on CodeContest data with extra test cases&lt;/li&gt;
&lt;li&gt;Transformer with multi-query attention&lt;/li&gt;
&lt;li&gt;Generate then filter 99% &amp;amp; cluster solutions&lt;/li&gt;
&lt;li&gt;Submit a max of 10&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read the &lt;a href="https://www.deepmind.com/blog/article/Competitive-programming-with-AlphaCode"&gt;Deepmind blog post&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deepmind</category>
      <category>machinelearning</category>
      <category>transformer</category>
    </item>
    <item>
      <title>Follow these 5 great ML creators on Twitter</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Thu, 03 Feb 2022 11:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/follow-these-5-great-ml-creators-on-twitter-3p0a</link>
      <guid>https://forem.com/jesperdramsch/follow-these-5-great-ml-creators-on-twitter-3p0a</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LSivgxjR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-twitter-follows.thumbnail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LSivgxjR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-twitter-follows.thumbnail.jpg" alt="" width="450" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How is the Twitter website free?!&lt;/p&gt;

&lt;p&gt;If you're getting into machine learning and deep learning, you can get a whole education on Twitter.&lt;/p&gt;

&lt;p&gt;Check out these creators:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/svpino"&gt;@svpino&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Jeande_d"&gt;@Jeande_d&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/gusthema"&gt;@gusthema&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/philipvollet"&gt;@philipvollet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/abhi1thakur"&gt;@abhi1thakur&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at their work!&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 In this thread Jean de Nyandwi goes into depth on ConvNets!
&lt;/h2&gt;

&lt;p&gt;The development from Dense networks to Convolutional layers onto the secret enabler of deep learning Pooling Layers.&lt;/p&gt;

&lt;p&gt;Sharing great courses and resources along the way!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The image you see below is a typical architecture of Convolutional Neural Networks, a.k.a ConvNets.  &lt;/p&gt;

&lt;p&gt;ConvNets is a neural network type architecture that is mostly used in image recognition tasks.  &lt;/p&gt;

&lt;p&gt;More about ConvNets 🧵🧵  &lt;/p&gt;

&lt;p&gt;Image credit: CS 231n &lt;a href="https://t.co/fWTMiOUP4r"&gt;pic.twitter.com/fWTMiOUP4r&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;— Jean de Nyandwi (@Jeande_d) &lt;a href="https://twitter.com/Jeande_d/status/1466415643876417540?ref_src=twsrc%5Etfw"&gt;December 2, 2021&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🔎 But ConvNets have recently been dethroned by Transformers!
&lt;/h2&gt;

&lt;p&gt;In this thread Abhishek Thakur (4x @Kaggle Grandmaster &amp;amp; Huggingface autoNLP)&lt;/p&gt;

&lt;p&gt;goes into detail for an implementation of transformers in @PyTorch!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Attention is all you need" implementation from scratch in PyTorch. A Twitter thread:&lt;br&gt;&lt;br&gt;
1/&lt;/p&gt;

&lt;p&gt;— abhishek (@abhi1thakur) &lt;a href="https://twitter.com/abhi1thakur/status/1470406419786698761?ref_src=twsrc%5Etfw"&gt;December 13, 2021&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🤝 Transformers and ConvNets are united by one player!
&lt;/h2&gt;

&lt;p&gt;The Softmax function (in most cases).&lt;/p&gt;

&lt;p&gt;Santiago Veldarrama writes some epic threads (you've likely seen).&lt;/p&gt;

&lt;p&gt;More recently started sharing these neat 30-second visuals on core ML concepts:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Softmax is one of the most popular activation functions.  &lt;/p&gt;

&lt;p&gt;Here is a 30-second introduction to it. &lt;a href="https://t.co/cgwWR1vQS9"&gt;pic.twitter.com/cgwWR1vQS9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;— Santiago (@svpino) &lt;a href="https://twitter.com/svpino/status/1482427385823727616?ref_src=twsrc%5Etfw"&gt;January 15, 2022&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ✒️ How do you get a text into a Transformer or ConvNet though?!
&lt;/h2&gt;

&lt;p&gt;Images are easy, right? They're just matrixes.&lt;/p&gt;

&lt;p&gt;For text you need something called Text Embedding, which converts your words into numbers.&lt;/p&gt;

&lt;p&gt;So Luiz Gustavo made a thread about Embeddings:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Models like &lt;a href="https://twitter.com/hashtag/AlphaCode?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AlphaCode&lt;/a&gt;, &lt;a href="https://twitter.com/hashtag/LaMDA?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#LaMDA&lt;/a&gt; &lt;a href="https://twitter.com/hashtag/Copilot?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#Copilot&lt;/a&gt;, &lt;a href="https://twitter.com/hashtag/GPT?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#GPT&lt;/a&gt;, &lt;a href="https://twitter.com/hashtag/CLIP?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#CLIP&lt;/a&gt;, &lt;a href="https://twitter.com/hashtag/DALL?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#DALL&lt;/a&gt;-e depends on a very important concept:   &lt;/p&gt;

&lt;p&gt;➡️Text Embeddings  &lt;/p&gt;

&lt;p&gt;But do you know what a Text Embedding is and how to create one?&lt;br&gt;&lt;br&gt;
Do you even need to create one?  &lt;/p&gt;

&lt;p&gt;Let's take a look...  &lt;/p&gt;

&lt;p&gt;[1.32 min]&lt;br&gt;&lt;br&gt;
[This is a good one!👀]  &lt;/p&gt;

&lt;p&gt;1/9🧵&lt;/p&gt;

&lt;p&gt;— Luiz GUStavo 💉💉💉🎉 (@gusthema) &lt;a href="https://twitter.com/gusthema/status/1489268532038799361?ref_src=twsrc%5Etfw"&gt;February 3, 2022&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🛠️ Finally you need the right tools to train your models, right?
&lt;/h2&gt;

&lt;p&gt;Philip Vollet finds the libraries and apps before they're cool.&lt;/p&gt;

&lt;p&gt;Accidentally DDOS'd a few websites, sharing them.&lt;/p&gt;

&lt;p&gt;Maybe the latest Tuner mixed with automatic feature selection using Shap?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;shap-hypetune a python package for simultaneous Hyperparameters Tuning and Features Selection for Gradient Boosting Models!  &lt;/p&gt;

&lt;p&gt;pip install shap-hypetune  &lt;/p&gt;

&lt;p&gt;Don't forget to star the repository! &lt;a href="https://t.co/UYV4GA432t"&gt;https://t.co/UYV4GA432t&lt;/a&gt; &lt;a href="https://t.co/REybOPVX6f"&gt;pic.twitter.com/REybOPVX6f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;— Philip Vollet (&lt;a class="mentioned-user" href="https://dev.to/philipvollet"&gt;@philipvollet&lt;/a&gt;) &lt;a href="https://twitter.com/philipvollet/status/1488076877436751874?ref_src=twsrc%5Etfw"&gt;January 31, 2022&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;In this thread I shared 5 top ML creators on Twitter with content about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ConvNets&lt;/li&gt;
&lt;li&gt;Transformers&lt;/li&gt;
&lt;li&gt;Softmax&lt;/li&gt;
&lt;li&gt;Text Embedding&lt;/li&gt;
&lt;li&gt;Great Tools (Hyperparameter tuning with shap-based feature selection!)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
    </item>
    <item>
      <title>4 Tools Kaggle Grandmasters use to win $100,000s in competitions</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Wed, 02 Feb 2022 16:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/4-tools-kaggle-grandmasters-use-to-win-100000s-in-competitions-1628</link>
      <guid>https://forem.com/jesperdramsch/4-tools-kaggle-grandmasters-use-to-win-100000s-in-competitions-1628</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5kxNuMqf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-bullseye.thumbnail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5kxNuMqf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-bullseye.thumbnail.jpg" alt="" width="450" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4 Tools Kaggle Grandmasters use to win $100,000s in competitions&lt;/p&gt;

&lt;p&gt;Expertise is figuring out what works and what doesn't.&lt;/p&gt;

&lt;p&gt;Why not let the experts tell you?&lt;/p&gt;

&lt;p&gt;Rather than experiment from the ground up for a decade!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pseudolabelling&lt;/li&gt;
&lt;li&gt;Negative Mining&lt;/li&gt;
&lt;li&gt;Augmentation Tricks&lt;/li&gt;
&lt;li&gt;Test-time augmentation&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🎨 Pseudolabelling
&lt;/h2&gt;

&lt;p&gt;Some competitions don't have a lot of data.&lt;/p&gt;

&lt;p&gt;Pseudo labels are created by building a good model on the training data.&lt;/p&gt;

&lt;p&gt;Then predict on the public test data.&lt;/p&gt;

&lt;p&gt;Finally, use labels with high confidence as additional training data!&lt;/p&gt;

&lt;h2&gt;
  
  
  📉 Hard Negative Mining
&lt;/h2&gt;

&lt;p&gt;This works best on classifiers with a binary outcome.&lt;/p&gt;

&lt;p&gt;The core idea:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take misclassified samples from your training data.&lt;/li&gt;
&lt;li&gt;Retrain the model on this data specifically.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sometimes this is specifically applied to retraining on false positives as negatives.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏁 Finish training unaugmented
&lt;/h2&gt;

&lt;p&gt;Data augmentation is a way to artificially create more data by slightly altering the existing data.&lt;/p&gt;

&lt;p&gt;This trains the ML model to recognize more variance in the data.&lt;/p&gt;

&lt;p&gt;Finishing the last training epochs unaugmented usually increases accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔃 Test-Time Augmentation (TTA)
&lt;/h2&gt;

&lt;p&gt;Augmentation during training? Classic.&lt;/p&gt;

&lt;p&gt;How about augmenting your data during testing though?&lt;/p&gt;

&lt;p&gt;You can create an ensemble of samples through augmentation.&lt;/p&gt;

&lt;p&gt;Predict on the ensemble and then use the average prediction from our model!&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Kaggle can teach you some sweet tricks for your machine learning endeavours.&lt;/p&gt;

&lt;p&gt;This article was about these four:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create extra training data&lt;/li&gt;
&lt;li&gt;Train on bad samples&lt;/li&gt;
&lt;li&gt;Top of training with original data&lt;/li&gt;
&lt;li&gt;Test on an ensemble of your data&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>competition</category>
      <category>kaggle</category>
      <category>tips</category>
      <category>tricks</category>
    </item>
    <item>
      <title>Pandas borrows a core concept from SQL and these 3 emoji tell you exactly how to use it</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Mon, 31 Jan 2022 11:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/pandas-borrows-a-core-concept-from-sql-and-these-3-emoji-tell-you-exactly-how-to-use-it-1p7k</link>
      <guid>https://forem.com/jesperdramsch/pandas-borrows-a-core-concept-from-sql-and-these-3-emoji-tell-you-exactly-how-to-use-it-1p7k</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ya9zFoGn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-pandas-joins.thumbnail.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ya9zFoGn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-pandas-joins.thumbnail.png" alt="" width="450" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pandas borrows a core concept from SQL:&lt;/p&gt;

&lt;p&gt;the Join&lt;/p&gt;

&lt;p&gt;But there are so many different types of joining two DataFrames&lt;/p&gt;

&lt;p&gt;Let's make this easy and go through Left, Right, Inner and Outer joins&lt;/p&gt;

&lt;p&gt;Knowing these is great in interviews in addition to your usual DataFrame shenanigans&lt;/p&gt;

&lt;p&gt;Joins always happen on two DataFrames.&lt;/p&gt;

&lt;p&gt;This explanation will use: 🟩🟪⬛&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🟩: The left DataFrame&lt;/li&gt;
&lt;li&gt;🟪: The right DataFrame&lt;/li&gt;
&lt;li&gt;⬛: The result&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't get the word "join" wrong though, you can actually end up with a smaller DataFrame ⬛ than either or 🟩🟪&lt;/p&gt;

&lt;h2&gt;
  
  
  ⬅️ The Left Join is selfish
&lt;/h2&gt;

&lt;p&gt;This one takes the complete left DataFrame 🟩 and only checks for overlaps from the right 🟪&lt;/p&gt;

&lt;p&gt;No 🟪 from outside of the bounds of 🟩 will make it into ⬛&lt;/p&gt;

&lt;h2&gt;
  
  
  ➡️ The Right Join is almost the same as Left
&lt;/h2&gt;

&lt;p&gt;Only take everything in 🟪 and overlapping 🟩&lt;/p&gt;

&lt;h2&gt;
  
  
  ⤵️ The Inner Join
&lt;/h2&gt;

&lt;p&gt;This one is tricky.&lt;/p&gt;

&lt;p&gt;Almost always ⬛ will be smaller than 🟩&amp;amp;🟪.&lt;/p&gt;

&lt;p&gt;For the Inner join, you only look at the parts of 🟩 and 🟪 that overlap.&lt;/p&gt;

&lt;p&gt;Nothing is included in ⬛ that exists outside of this common area.&lt;/p&gt;

&lt;h2&gt;
  
  
  ↔️ The Outer Join
&lt;/h2&gt;

&lt;p&gt;Is possibly the simples one.&lt;/p&gt;

&lt;p&gt;It is exactly what we would expect from a "join".&lt;/p&gt;

&lt;p&gt;Take all of 🟩 and all of 🟪 and combine it into ⬛.&lt;/p&gt;

&lt;p&gt;All of the data is in our result.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Pandas borrows from SQL using Joins&lt;/li&gt;
&lt;li&gt;Left and Right join maintain the original and whatever overlaps in the other&lt;/li&gt;
&lt;li&gt;Inner is only the common ground&lt;/li&gt;
&lt;li&gt;Outer uses all the data in both DataFrames&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>pandas</category>
      <category>python</category>
      <category>sql</category>
    </item>
    <item>
      <title>3 Ways you can use Jupyter Notebook as an excellent Communication Tool</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Sun, 30 Jan 2022 11:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/3-ways-you-can-use-jupyter-notebook-as-an-excellent-communication-tool-1b1p</link>
      <guid>https://forem.com/jesperdramsch/3-ways-you-can-use-jupyter-notebook-as-an-excellent-communication-tool-1b1p</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sgArtKfZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-python.thumbnail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sgArtKfZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-python.thumbnail.jpg" alt="" width="450" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;People love to hate Jupyter Notebooks!&lt;/p&gt;

&lt;p&gt;They're missing out on a great communication tool.&lt;/p&gt;

&lt;p&gt;Here's how data scientists and machine learners can&lt;/p&gt;

&lt;p&gt;build great Jupyter Notebooks that people love to read&lt;/p&gt;

&lt;h2&gt;
  
  
  🧮 Fix your dang code
&lt;/h2&gt;

&lt;p&gt;You can make a mess in notebooks when experimenting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;All Imports into Cell 1&lt;/li&gt;
&lt;li&gt;Extract some functions and classes&lt;/li&gt;
&lt;li&gt;Comments.&lt;/li&gt;
&lt;li&gt;Fix your variable names&lt;/li&gt;
&lt;li&gt;Fix the order and outputs&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://github.com/drillan/jupyter-black"&gt;black&lt;/a&gt; to standardize your code format&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  ✒️ Jupyter has Markdown Cells!
&lt;/h2&gt;

&lt;p&gt;Use them.&lt;/p&gt;

&lt;p&gt;If you're not using Markdown in your Notebooks, you should not be using Notebooks.&lt;/p&gt;

&lt;p&gt;Write some prose to explain your code.&lt;/p&gt;

&lt;p&gt;Whether analysis or model, do yourself a favour and document it.&lt;/p&gt;

&lt;p&gt;In case you need a &lt;a href="https://www.markdownguide.org/getting-started/"&gt;markdown guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔂 Final checks
&lt;/h2&gt;

&lt;p&gt;We all do it.&lt;/p&gt;

&lt;p&gt;We forget to run a cell and wonder for an embarrassing amount of time, why we have an error in the next one.&lt;/p&gt;

&lt;p&gt;Before you share your notebook:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Restart Kernel to forget all variables&lt;/li&gt;
&lt;li&gt;Run All Cells&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Not by hand. Automatic.&lt;/p&gt;

&lt;p&gt;It'll show any mix ups&lt;/p&gt;

&lt;h2&gt;
  
  
  🏆 Extra Credit
&lt;/h2&gt;

&lt;p&gt;🦾 Use nbconvert to run all cells from the command line&lt;/p&gt;

&lt;p&gt;🧠 Write a utils file with reusable functions&lt;/p&gt;

&lt;p&gt;⌨ Learn keyboard shortcuts for efficiency&lt;/p&gt;

&lt;p&gt;🎨 Make it interactive with ipykernel&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Care about code quality&lt;/li&gt;
&lt;li&gt;Use markdown cells (More than just headings)&lt;/li&gt;
&lt;li&gt;Make sure the notebook runs&lt;/li&gt;
&lt;li&gt;Use extra tools to make your life easier&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>codequality</category>
      <category>coding</category>
      <category>jupyter</category>
      <category>notebooks</category>
    </item>
    <item>
      <title>How to deal with data changing and machine learning models doing worse after training</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Fri, 28 Jan 2022 11:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/how-to-deal-with-data-changing-and-machine-learning-models-doing-worse-after-training-2ai4</link>
      <guid>https://forem.com/jesperdramsch/how-to-deal-with-data-changing-and-machine-learning-models-doing-worse-after-training-2ai4</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--00PNHVQl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-ml-production-shift.thumbnail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--00PNHVQl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-ml-production-shift.thumbnail.jpg" alt="" width="450" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Machine Learning in Production 101&lt;/p&gt;

&lt;p&gt;I just finished some writing for the UN (ITU) about machine learning models in production.&lt;/p&gt;

&lt;p&gt;Wonder how to deal with data changing and models doing worse after training? (when deployed)&lt;/p&gt;

&lt;p&gt;This is for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  📌 We're talking about Drift
&lt;/h2&gt;

&lt;p&gt;Our training data is static. Contact with the real world is non-stationary.&lt;/p&gt;

&lt;p&gt;This drift can happen in three ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The input data changes&lt;/li&gt;
&lt;li&gt;The labels for the data change&lt;/li&gt;
&lt;li&gt;The inherent relationship changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⚗️ Input data changes!
&lt;/h2&gt;

&lt;p&gt;One way to monitor these is by checking the distribution of the new data vs the training data.&lt;/p&gt;

&lt;p&gt;We can use these tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continuous: Kolmogorov-Smirnov test&lt;/li&gt;
&lt;li&gt;Categorical: Chi-squared test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Solution:&lt;/p&gt;

&lt;p&gt;Retraining the models regularly.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧩 Target / Label changes
&lt;/h2&gt;

&lt;p&gt;These can be natural changes similar to the input changes.&lt;/p&gt;

&lt;p&gt;In that case, you can use the same approach.&lt;/p&gt;

&lt;p&gt;But sometimes, our categories change, because we make discoveries or mgmt decisions.&lt;/p&gt;

&lt;p&gt;Solution: Updates are best reflected in automated pipelines&lt;/p&gt;

&lt;h2&gt;
  
  
  🔀 Concept shift
&lt;/h2&gt;

&lt;p&gt;This one sucks.&lt;/p&gt;

&lt;p&gt;ML models learn the relationship between input and label (ideally).&lt;/p&gt;

&lt;p&gt;When that relationship changes our entire historic data set is obsolete.&lt;/p&gt;

&lt;p&gt;Essentially what happened in early 2020.&lt;/p&gt;

&lt;p&gt;Solution: New data, but setting up auto alerts is essential&lt;/p&gt;

&lt;h2&gt;
  
  
  📖 More info?
&lt;/h2&gt;

&lt;p&gt;I wrote an ebook about machine learning validation.&lt;/p&gt;

&lt;p&gt;I give it away to my newsletter subscribers.&lt;/p&gt;

&lt;p&gt;I have just made the biggest update to the ebook, including production models and machine learning drift.&lt;/p&gt;

&lt;p&gt;Subscribe to receive weekly insights from &lt;a href="https://dramsch.net/dramsch.net/newsletter"&gt;Late to the Party&lt;/a&gt; on machine learning, data science, and Python.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We hope training data represents real-world data in machine learning, but it doesn't always.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up MLOps automation&lt;/li&gt;
&lt;li&gt;Retrain for input data changes&lt;/li&gt;
&lt;li&gt;Care for label changes&lt;/li&gt;
&lt;li&gt;Hope it's not concept drift, where the relationship of data changes&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>drift</category>
      <category>machinelearning</category>
      <category>production</category>
    </item>
    <item>
      <title>My first first-author paper broke 50 citations. I think I know why and you can do it too</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Thu, 27 Jan 2022 11:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/my-first-first-author-paper-broke-50-citations-i-think-i-know-why-and-you-can-do-it-too-4i5m</link>
      <guid>https://forem.com/jesperdramsch/my-first-first-author-paper-broke-50-citations-i-think-i-know-why-and-you-can-do-it-too-4i5m</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_NTR00vb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-scientist-on-a-computer.thumbnail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_NTR00vb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-scientist-on-a-computer.thumbnail.jpg" alt="" width="450" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first first-author paper broke 50 citations. I think I know why and you can do it too.&lt;/p&gt;

&lt;p&gt;I shared my code and made it ridiculously easy to use.&lt;/p&gt;

&lt;p&gt;I'm lazy myself.&lt;/p&gt;

&lt;p&gt;If I find a paper that gives me all its ingredients ready to go,&lt;/p&gt;

&lt;p&gt;I'm happy.&lt;/p&gt;

&lt;p&gt;But how do you do this?&lt;/p&gt;

&lt;h2&gt;
  
  
  4️⃣ There are four essential files in the repo:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;License file - tell people how they're allowed to use it&lt;/li&gt;
&lt;li&gt;conda_env.yml - tell people how to install&lt;/li&gt;
&lt;li&gt;Readme - Document everything!&lt;/li&gt;
&lt;li&gt;Jupyter NB - The actual code (with inline documentation)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💼©️™️ How do you choose a license for your files?
&lt;/h2&gt;

&lt;p&gt;I like &lt;a href="https://choosealicense.com"&gt;choosealicense.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Personally, I often go with the MIT license. It's easy, it removes your liability, it gives people the right to use and modify your code.&lt;/p&gt;

&lt;p&gt;Modification means new research. That means citations!&lt;/p&gt;

&lt;h2&gt;
  
  
  🤖 Install Stuff.
&lt;/h2&gt;

&lt;p&gt;It's great to provide a requirements.txt for pip&lt;/p&gt;

&lt;p&gt;and/or&lt;/p&gt;

&lt;p&gt;a conda_env.yml for conda installation.&lt;/p&gt;

&lt;p&gt;I made it terribly hard for people and didn't provide package versions. Rookie mistake.&lt;/p&gt;

&lt;p&gt;Step it one up and use poetry for exact reproduction of environments!&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 Write that Readme.md
&lt;/h2&gt;

&lt;p&gt;The readme file magically goes to the forefront of your @github repo.&lt;/p&gt;

&lt;p&gt;Do the minimum, tell folks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is this about&lt;/li&gt;
&lt;li&gt;How to install&lt;/li&gt;
&lt;li&gt;How to use (files, commands, etc)&lt;/li&gt;
&lt;li&gt;How to CITE! Put a bibtex file for extra credit.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🤷 People love to hate Jupyter Notebooks
&lt;/h2&gt;

&lt;p&gt;But here's the thing.&lt;/p&gt;

&lt;p&gt;Jupyter Notebooks are great, if you clean them before publication.&lt;/p&gt;

&lt;p&gt;Put stuff into neat functions, organize sections, and make some nice plots.&lt;/p&gt;

&lt;p&gt;Above all, use Markdown cells for inline documentation!&lt;/p&gt;

&lt;h2&gt;
  
  
  🏆 For extra credit:
&lt;/h2&gt;

&lt;p&gt;🐳 Use docker to completely freeze the computational environment&lt;/p&gt;

&lt;p&gt;🧮 Register your code on zenodo to give it a DOI&lt;/p&gt;

&lt;p&gt;📌 Pin the repo to your github profile&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Choose the right license for your code&lt;/li&gt;
&lt;li&gt;Write amazing documentation&lt;/li&gt;
&lt;li&gt;Make it easy to install, read, and use&lt;/li&gt;
&lt;li&gt;Consider making it incredibly easy to use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/JesperDramsch/seismic-transfer-learning"&gt;Here's my repo.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not a stellar example, but I give Jesper from 5 years ago a pass.&lt;/p&gt;

</description>
      <category>coding</category>
      <category>python</category>
      <category>reproducibility</category>
      <category>research</category>
    </item>
    <item>
      <title>Scientists make great Data Scientists</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Sun, 10 Oct 2021 10:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/scientists-make-great-data-scientists-2cbk</link>
      <guid>https://forem.com/jesperdramsch/scientists-make-great-data-scientists-2cbk</guid>
      <description>&lt;p&gt;I love it when an applied scientist asks me how to get into data science or machine learning.&lt;/p&gt;

&lt;p&gt;Sure, any scientist, but geologists, biologists, oceanographers and environmental scientists especially. Applied disciplines that are commonly looked down upon by fields like physics or math. Those are the gems in the rough.&lt;/p&gt;

&lt;p&gt;I hear the outcry already:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But math! But statistics! Those are mud people!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But here's the thing.&lt;/p&gt;

&lt;p&gt;Few people have an intuitive understanding of complexity, like applied scientists. Few people can make a decision and gain insight in an environment where new data isn't available, and uncertainty is high.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Applied scientists know data.&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It's a marvel to watch an applied scientist dig through a data set. Depending on the scientist, it may also be good to keep the kids out of earshot, but that's another story.&lt;/p&gt;

&lt;p&gt;Data is messy.&lt;/p&gt;

&lt;p&gt;Nothing pokes a hole in well-laid-out plans like getting the real-world data set. Andrew Ng, after teaching the world machine learning, now teaches the world how important data is. And for a good reason, your neural network, your random forest, they're random numbers in a computer until they are conditioned on data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Applied scientists have seen it before.
&lt;/h2&gt;

&lt;p&gt;An applied scientist has seen it before, even if the imposter syndrome is there because this knowledge is hard to quantify. Analyzing the genes from a dinosaur's bone marrow that is thousands of years dead or understanding how a region formed over millions of years after looking at a weathered cliff are awe-inspiring feats.&lt;/p&gt;

&lt;p&gt;Those are hard skills. Those are skills that teach you to handle data. Those are skills that are hard to teach and hard to learn.&lt;/p&gt;

&lt;p&gt;Teaching basic statistical concepts is easy after that.&lt;/p&gt;

&lt;p&gt;That’s why I love when applied scientists are interested in data science.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R5QaBssK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/atomic-essays/day1-scientists-make-great-data-scientists.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R5QaBssK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/atomic-essays/day1-scientists-make-great-data-scientists.png" alt="Image of Atomic Essay Day 1 - Scientists make great Data Scientists"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This atomic essay was part of the October 2021 &lt;a href="https://enroll.ship30for30.com/october-enrollment/6jztd"&gt;#Ship30for30&lt;/a&gt; cohort. A 30-day daily writing challenge by Dickie Bush and Nicolas Cole. &lt;a href="https://dramsch.net/r/ship30"&gt;Want to join the challenge?&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>datascience</category>
      <category>ship30for30</category>
    </item>
    <item>
      <title>I recreated Hey.com in Gmail</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Fri, 13 Aug 2021 10:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/i-recreated-hey-com-in-gmail-2g06</link>
      <guid>https://forem.com/jesperdramsch/i-recreated-hey-com-in-gmail-2g06</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jaxeIDDO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2blyquz24v6vejfsqcuf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jaxeIDDO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2blyquz24v6vejfsqcuf.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had some problems with Gmail, particularly emails landing in spam, that definitely weren't spam. I love the functionality of Gmail, albeit still mourning Inbox. When I tweeted about it, I got the suggestion to try a few different services, including &lt;a href="http://hey.com"&gt;Hey.com&lt;/a&gt; by Basecamp. I both remembered people clamouring for invites to Hey.com back in the day. I also remember vaguely that something was up with Basecamp.&lt;/p&gt;

&lt;p&gt;I signed up for Hey and after two important emails directly ended up in spam and I read up on what happened at Basecamp, I decided it was time to give Gmail another shot, but make it work for me. The Hey email service promised to revolutionise email. It's opinionated approach is both a blessing and its downfall.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I liked about Hey.com
&lt;/h2&gt;

&lt;p&gt;The idea of auto-sorting email after touching them once seemed intriguing. Hey sorts emails into three buckets, namely, your inbox, a feed for newsletters and a papertrail for receipts you need searchable but never need your attention. The revolutionary idea is that hey does not use an algorithm or machine learning. Any email from a new sender does &lt;em&gt;not&lt;/em&gt; land in your inbox but on a sorting table. There you decide where this email goes in the future.&lt;/p&gt;

&lt;p&gt;Hey has a few other features that are neat, but that is the main feature that I liked. Touch an email once and have all subsequent email be dealt with. Without learning algorithms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can you auto-sort email in Gmail?
&lt;/h2&gt;

&lt;p&gt;Gmail is strong on filters and labels. I love email filters.&lt;/p&gt;

&lt;p&gt;The problem here, is that I will not go into the settings and update a filter every time I get a new email. This is in no way similar to Hey obviously, where it's one click.&lt;/p&gt;

&lt;p&gt;I went ahead and scoured the web for some good filters and found one for the Papertrail.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;subject:("Order Receipt"|"your order"|"order confirmaton"|"your payment"|"your etsy purchase"|"my account payment processed"|"your purchase"|"your gift purchase"|"thinkgeek order"|"Your threadless order"|"order from Woot"|"your amazon order"|"Return Confirmation"|"your amazon order"|"Your package"|"Order Has Been Updated"|"UPS My Choice"|"UPS Ship Notification"|"Netrition order"|"Your payment"|"Your contribution"|"order has shipped"|"Your download"|"Your Amazon.com order"|"Payment scheduled"|"bill is ready"|"order confirmation"|"thanks for becoming a backer"|"you have authorized a payment"|"changed your pledge"|"successfully funded"|"you sent a payment"|"amazon.com order"|"payment received"|"Purchase Confirmation"|"pledge receipt"|"Your TopatoCo Order"|"Humble Bundle order"|"your transaction"|"Package From TopatoCo"|"Your best offer has been submitted"|"Offer Retraction Notice"|"You've received a gift copy"|"Your Etsy Order"|"Thanks for contributing to"|"Shipping Confirmation"|"Purchase Receipt")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;That was a great start but not really what I liked about Hey, where you could make a decision based on sender. So let's try and do that!&lt;/p&gt;
&lt;h2&gt;
  
  
  Google Apps Scripts to the rescue!
&lt;/h2&gt;

&lt;p&gt;Google Scripts have a special place in the Google Cinematic Universe. It's easier to get access to some APIs than it may be with conventional tools. Additionally, you can have them run on a repeating basis.&lt;/p&gt;

&lt;p&gt;So I had the idea of auto-updating certain filters. This is where the meat starts.&lt;/p&gt;

&lt;p&gt;Google Apps scripts have access to the Gmail service, where you can easily retrieve filters using &lt;code&gt;Gmail.Users.Settings.Filters.list('me')&lt;/code&gt;. The &lt;code&gt;me&lt;/code&gt; keyword is a special access token to your personal Gmail, making it infinitely easier to work with (rather than setting up API keys).&lt;/p&gt;

&lt;p&gt;Technically, there's no update functionality for filters. I decided to use the &lt;code&gt;remove&lt;/code&gt; and &lt;code&gt;create&lt;/code&gt; functionality instead. So I just have to make sure to not accidentally delete the filter and not create a new one during the auto-update.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting up Gmail
&lt;/h2&gt;

&lt;p&gt;Gmail uses labels rather than folders, which is why I originally started using it.&lt;/p&gt;

&lt;p&gt;I set up the &lt;code&gt;Wanted&lt;/code&gt;, &lt;code&gt;Feed&lt;/code&gt;, &lt;code&gt;Papertrail&lt;/code&gt; labels to sort emails into and set up the multiple Inboxes setting as the main inbox. I'm still working on improving the system and have also added labels for social media, unwanted email and a few others that fit into my system better.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Wanted&lt;/code&gt;, &lt;code&gt;Feed&lt;/code&gt;, and &lt;code&gt;Papertrail&lt;/code&gt; are the main labels though and the script I will show you can work with any label.&lt;/p&gt;

&lt;p&gt;I want this system to work with other labels that aren't just based on the email address of the sender. Therefore, I added another label &lt;code&gt;To Sort&lt;/code&gt; to explicitly set a flag for emails to be used by the auto-sorting script.&lt;/p&gt;

&lt;p&gt;Then, when I get a new email newsletter that is supposed to end up in &lt;code&gt;Feed&lt;/code&gt; I assign the &lt;code&gt;Feed&lt;/code&gt; and &lt;code&gt;To Sort&lt;/code&gt; to that email. Then the script picks up this email address and it to the filter.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting up Filters
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WPXGFK6p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/luke-porter-iweAJreEerQ-unsplash.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WPXGFK6p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/luke-porter-iweAJreEerQ-unsplash.jpg" alt="Filters in coffe."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A long time ago, I figured that you can label Gmail filters by just including a small "text label OR actual filter". I'd normally obscure that text label, so it's never accidentally true in an actual email. Then a filter would look like &lt;code&gt;{_Text_La_bel_} OR from:(test@example.com)&lt;/code&gt;. Then I never have to remember what a filter does and can simply look it up.&lt;/p&gt;

&lt;p&gt;I kept the filter above for orders. There are a lot of emails coming from different places you order online these days. It would be redundant to add that address or addresses from other filters to the auto-update.&lt;/p&gt;

&lt;p&gt;This is one reason, I decided to add the &lt;code&gt;To Sort&lt;/code&gt; label.&lt;/p&gt;

&lt;p&gt;The script is supposed to only pick up specific filters, hence I decided that the Google Apps Script below will strictly pick up filters that begin with &lt;code&gt;_Auto_&lt;/code&gt;. To make it easier to associate auto-sort filters with a label, I then add the label name to the text label.&lt;/p&gt;

&lt;p&gt;I wanted to make sure it doesn't accidentally pick up the word, for example &lt;code&gt;_Auto_Feed&lt;/code&gt; (as if that would happen), so all underscores are removed from the label, like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{_Auto_F_e_ed_} OR ...

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  The Script to Sort Them All
&lt;/h2&gt;

&lt;p&gt;The following script can be run. &lt;code&gt;Initialize()&lt;/code&gt; sets up the Gmail service. &lt;code&gt;Install()&lt;/code&gt; sets up the recurring trigger to run every 10 minutes. &lt;code&gt;updateFilter()&lt;/code&gt; is where the meat is.&lt;/p&gt;

&lt;p&gt;Let's walk through relevant parts in &lt;code&gt;updateFilter()&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get All Filters in Gmail&lt;/li&gt;
&lt;li&gt;Iterate through All Filters and if the filter contains &lt;code&gt;_Auto_&lt;/code&gt; process the following&lt;/li&gt;
&lt;li&gt;Extract Gmail label name from text label in filter called &lt;code&gt;autolabel&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Search Gmail for anything that has both &lt;code&gt;autolabel&lt;/code&gt; and &lt;code&gt;To Sort&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If we find no new emails, go to next label, otherwise extract email address and add to filter, if the filter doesn't exist yet, to try and keep filter small with unique emails&lt;/li&gt;
&lt;li&gt;Remove &lt;code&gt;To Sort&lt;/code&gt; label from email conversation&lt;/li&gt;
&lt;li&gt;Gmail filters cannot be longer than 1500 characters. When the filter gets too long, split out old filters into a new label e.g. &lt;code&gt;_Backup_F_e_ed_&lt;/code&gt; instead. These are not updated after. &lt;/li&gt;
&lt;li&gt;Update Filter with new email addresses&lt;/li&gt;
&lt;/ol&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Google Apps Scripts are surprisingly useful in the pursuit of auto-sorting emails.&lt;/p&gt;

&lt;p&gt;I'm sure there are smarter ways to program the things above, however, for now it works well for me and has already saved me a lot of time processing email.&lt;/p&gt;

&lt;p&gt;Now I just have to figure out what to do with all that time I used to waste on email.&lt;/p&gt;

</description>
      <category>email</category>
      <category>gmail</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Polywork Is Made for Multi-passionate Folks like Me</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Sat, 24 Jul 2021 10:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/polywork-is-made-for-multi-passionate-folks-like-me-5aa8</link>
      <guid>https://forem.com/jesperdramsch/polywork-is-made-for-multi-passionate-folks-like-me-5aa8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NsnapiNR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-polywork.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NsnapiNR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-polywork.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's hardly a that I'm interested in way too many things. My PhD changed because this machine learning thing just seemed too interesting not to pursue.&lt;/p&gt;

&lt;p&gt;Was that enough to keep my full attention?&lt;/p&gt;

&lt;p&gt;Of course not. I also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learnt Python&lt;/li&gt;
&lt;li&gt;Taught Python&lt;/li&gt;
&lt;li&gt;Went to and won hackathons&lt;/li&gt;
&lt;li&gt;Played around on kaggle&lt;/li&gt;
&lt;li&gt;Created Youtube videos&lt;/li&gt;
&lt;li&gt;Wrote blogposts&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;... you get the gist. I like creating things. I like doing things.&lt;/p&gt;

&lt;p&gt;When cassidoo mentioned Polywork in her newsletter, I was intrigued. What would a social network that focuses on the many facets that make us up be?&lt;/p&gt;

&lt;h2&gt;
  
  
  What already exists with Linkedin?
&lt;/h2&gt;

&lt;p&gt;Linkedin focuses on titles and credentials first.&lt;/p&gt;

&lt;p&gt;This is also what Corporate America focuses on.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Oh, you graduated from Harvard? A job at McKinsey? Impressive. Here's my card.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Additionally, you try to gain a following by "showing thought leadership".&lt;/p&gt;

&lt;p&gt;Recruiters telling incredible stories of empathy that none of us workers has ever experienced. Like being given a chance despite showing up late. Or a chance despite being drenched from the rain.&lt;/p&gt;

&lt;p&gt;Double spaced creative writing assignments, followed by "Thoughts?" and "Agree?".&lt;/p&gt;

&lt;p&gt;I'm not the kind of person that would get a job at McKinsey or Accenture (despite people working in these companies telling me otherwise). I would not get into Harvard or MIT. I don't receive awards either I'm afraid.&lt;/p&gt;

&lt;p&gt;I try to share interesting things on Linkedin that are relevant for people getting into machine learning, but I've never been great in the popularity contest.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Reality I See?
&lt;/h2&gt;

&lt;p&gt;The most interesting people I see are the creators and doers.&lt;/p&gt;

&lt;p&gt;Marie Forleo coined the phrase of multi-passionate individuals. And I feel seen with that description.&lt;/p&gt;

&lt;p&gt;Yes I could talk about machine learning for hours. It is what I chose to talk about online.&lt;/p&gt;

&lt;p&gt;But we could just as well talk about climbing, weight-lifting, pen &amp;amp; paper, scuba diving, or many many other topics and I'd be happy as a fish in water.&lt;/p&gt;

&lt;p&gt;I love building things with others. Writing these things. Creating videos online. Speaking at events. Teaching, Learning, Communicating.&lt;/p&gt;

&lt;p&gt;Sure thing life would be easier with Harvard credentials, an ex-Google in the Twitter bio, or any of these credentials. But only as long as they come with the other fun things.&lt;/p&gt;

&lt;p&gt;My favourite human trait is curiosity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do I like Polywork so much?
&lt;/h2&gt;

&lt;p&gt;Polywork focuses on the things you do.&lt;/p&gt;

&lt;p&gt;You have two small lines for your jobs and all the space in the world for an update of what you've been up to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9eaxFpNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/polywork-jobs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9eaxFpNQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/polywork-jobs.png" alt="Limited space for jobs on polywork"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But let's start at the beginning.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Badges. All the Badges.
&lt;/h3&gt;

&lt;p&gt;When you set up your profile you can choose badges you'd like to add to your about-me.&lt;/p&gt;

&lt;p&gt;You can even create some yourself that you deem missing.&lt;/p&gt;

&lt;p&gt;When I scrolled through, even the ones I didn't identify with were badges I thought "oh interesting!".&lt;/p&gt;

&lt;p&gt;Check out this thread for inspiration.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's time for a 𝔪𝔢𝔤𝔞 𝔱𝔥𝔯𝔢𝔞𝔡🤘🧑‍🎤🎸  &lt;/p&gt;

&lt;p&gt;What are your favorite Badges you've created or discovered on Polywork that nail your personality? Drop 'em below and we'll share some of our favorites!&lt;/p&gt;

&lt;p&gt;— Polywork (@PolyworkHQ) &lt;a href="https://twitter.com/PolyworkHQ/status/1418280518328537090?ref_src=twsrc%5Etfw"&gt;July 22, 2021&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now I can proudly display that I play chess, when I'm procrastinating on my Python code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RJv4gviO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/polywork-profile.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RJv4gviO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/polywork-profile.png" alt="Jesper Dramsch' Polywork profile"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These badges are the link to posts you can make.&lt;/p&gt;

&lt;h3&gt;
  
  
  Activities and Posts
&lt;/h3&gt;

&lt;p&gt;Once you have your little profile set up, you can post activities.&lt;/p&gt;

&lt;p&gt;You can be as granular as you want.&lt;/p&gt;

&lt;p&gt;Some people post big life updates.&lt;/p&gt;

&lt;p&gt;Other people are way more granular:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Streamed on Twitch? Update.&lt;/li&gt;
&lt;li&gt;Wrote some Code? Update.&lt;/li&gt;
&lt;li&gt;Hit rank 1200 on chess.com? Update.&lt;/li&gt;
&lt;li&gt;Published a new newsletter issue? Update!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's my approach. I love adding activities to the feed.&lt;/p&gt;

&lt;p&gt;It feels rewarding to get to score with the small things. Something that isn't a fully-fledged project.&lt;/p&gt;

&lt;p&gt;I get to talk about the things I'm up to and they don't need to be Linkedin-polished.&lt;/p&gt;

&lt;p&gt;This is my favourite bit about Polywork.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXb3YdYv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/polywork-timeline.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXb3YdYv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/polywork-timeline.png" alt="Polywork Timeline of Jesper Dramsch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can tag each post with activities.&lt;/p&gt;

&lt;p&gt;These activities in turn are connected to the badges you saw before.&lt;/p&gt;

&lt;p&gt;This makes your posts discoverable under badges, so you can see what other people that enjoy the things you enjoy are up to.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Polywork Doesn't Do.
&lt;/h3&gt;

&lt;p&gt;Deliberately, Polywork has decided against likes.&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;Your activity isn't a popularity contest.&lt;/p&gt;

&lt;p&gt;It just is and is allowed to stand for itself.&lt;/p&gt;

&lt;p&gt;There's also no algorithmic curation of your feed. However, that used to be the case on every platform until they ran out of funding, so we'll see how that develops.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Polywork Does Do.
&lt;/h3&gt;

&lt;p&gt;Polywork has community in mind.&lt;/p&gt;

&lt;p&gt;You decide beforehand, which things you are open to be contacted about.&lt;/p&gt;

&lt;p&gt;Guest lecture? Yes. Angel Investing? No.&lt;/p&gt;

&lt;p&gt;This is a feature that has moderation in mind.&lt;/p&gt;

&lt;p&gt;Considering the types of harassment folks are subjected to on other social media platforms, where anything but the most egregious threats is "in line with the community guidelines", this is a refreshing approach.&lt;/p&gt;

&lt;p&gt;Polywork has recently called for moderators to apply, as user-generated badges will always be a target of abuse as well.&lt;/p&gt;

&lt;p&gt;Building a welcoming community? Yes, please.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's to come
&lt;/h3&gt;

&lt;p&gt;Polywork has just announced the Spacestation.&lt;/p&gt;

&lt;p&gt;A feature where you can find people that are open to help on the specific things you are looking for.&lt;/p&gt;

&lt;p&gt;Angel investing? I may not be your go-to, but the people open to investing are!&lt;/p&gt;

&lt;p&gt;Need a podcast guest? The Spacestation can provide your next guest!&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I get in?
&lt;/h2&gt;

&lt;p&gt;I understand that Polywork may not be for everyone.&lt;/p&gt;

&lt;p&gt;But it scratches an itch personally, to build a community of passionate individuals that like to draw outside of the box.&lt;/p&gt;

&lt;p&gt;Currently, Polywork is invite-only.&lt;/p&gt;

&lt;p&gt;I talked to them to get a special code for my readers, so of course it's&lt;/p&gt;

&lt;p&gt;&lt;code&gt;late-tothe-party&lt;/code&gt; 🎉&lt;/p&gt;

&lt;p&gt;Because we're all &lt;a href="https://dramsch.net/newsletter"&gt;late to the party&lt;/a&gt; sometimes.&lt;/p&gt;

&lt;p&gt;Find my profile here: &lt;a href="https://www.polywork.com/jesper"&gt;polywork.com/jesper&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>job</category>
      <category>polywork</category>
      <category>socialmedia</category>
    </item>
    <item>
      <title>What I consider in a Laptop for Machine Learning</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Thu, 01 Jul 2021 10:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/what-i-consider-in-a-laptop-for-machine-learning-l72</link>
      <guid>https://forem.com/jesperdramsch/what-i-consider-in-a-laptop-for-machine-learning-l72</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RGZ8RfOi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-training-on-a-laptop.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RGZ8RfOi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/banner-training-on-a-laptop.jpg" alt="A laptop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many researchers hear about the huge hardware clusters that companies use for machine learning and AI. When you get started and even start doing more extensive projects, do you really need to move away from your work laptop?&lt;/p&gt;

&lt;p&gt;Most people use laptops as hardware these days. Desktop computers are clunky pieces of hardware only used by people doing numerical or image processing work and gamers, so they've become very niche. Yet many people own laptops either bought themselves or through work. I've had several friends ask me if they can buy the new Macbook M1 or need $3000 laptops to break into data science.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LHiM0WnRaD8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  So the new Apple, eh?
&lt;/h2&gt;

&lt;p&gt;Historically Apples were marketed toward "creatives". But in their most recent iteration on the Macbooks, Apple has stepped up their game. Everyone working close to hardware was nervous when Apple bought ARM and moved away from Intel due to compatibility. Still, with the M1 laptops, they're also right away publishing a version of Google's popular deep learning framework Tensorflow!&lt;/p&gt;

&lt;p&gt;The crazy thing is I've never even owned an Apple product, and I'm impressed with the execution. Before, my Mac-Owning friends and colleagues had to buy expensive external GPUs to run simulations, and now this! But this isn't just about Macs. Let's look at machine Learning itself because not all ML is Deep Neural Networks. Your 2016 Macbook may still be adequate to run many machine learning applications. And the best part? If they're not enough anymore, you can still rent an instance in the cloud for a few dollars during training!&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware Considerations for Machine Learning
&lt;/h2&gt;

&lt;p&gt;Let's have a quick chat about computer hardware. Computers made up of some essential parts to do the computery things. For the kind of numerical work we are talking about, we're primarily interested in three things. The CPU is the brain of the computer. It enables complex tasks and computation and runs every program you have. The CPU closely interact with special memory called RAM, which is quite similar to short-term memory in humans. This is opposed to regular hard drives, which are much slower but perfect for longer-term storage of information.&lt;/p&gt;

&lt;p&gt;Then there's the graphical processing unit or GPU. GPUs developed over time to make games more realistic, but because 3D graphics are essentially just a bunch of linear algebra and matrix calculations, people slowly figured out that you can do scientific calculations with them as well. These GPUs are really good at this one thing and one thing only: Throwing a bunch of matrixes at each other. These GPUs often have a dedicated memory, often called VRAM, even faster and even smaller than your CPUs RAM.&lt;/p&gt;

&lt;p&gt;Many laptops, especially work-issued office laptops, only have a CPU and so-called integrated graphics. They can play Netflix and Youtube but will usually buckle when you want to start up any 3D game. It gets really specific real quick, but do you even need a GPU?&lt;/p&gt;

&lt;p&gt;No, probably not. Most of machine learning is done on the normal CPU every laptop has. So you should be able to train most simple models in scikit-learn, even on your phone.&lt;/p&gt;

&lt;p&gt;The CPU decides how fast your model trains, and usually, it doesn't matter. Model training times are relatively short anyways; the limiting factor on your laptop is RAM. There are only a few classic machine learning methods that can be trained iteratively, feeding it your entire dataset piece by piece and non of them are the ones I usually throw at any problem like Support-Vector Machines or Random Forests. There are some tricks, of course, but basically, you need to fit the whole data AND your model into memory (also called RAM) of the laptop. On smaller problems, this is also negligible. Still, some of the problems I'm working on right now require millions of data points. At this scale, I'm consuming 100s of GB of data. In my experience, for classic machine learning, you should prioritize RAM and then CPU or GPU.&lt;/p&gt;

&lt;p&gt;Especially in office computers, the amount of RAM can be as low as 4GB (at which point opening Excel files can become a dread). That laptop quickly reaches capacity on your problem. But essentially, you should be able to validate your code for machine learning on any old machine with enough memory and often even train models in a reasonable time. Random Forests, for example, are popular because they're also very fast to train.&lt;/p&gt;

&lt;p&gt;You can switch classical Machine Learning to the GPU with Nvidia Rapids cuML, which is basically scikit-learn on a GPU. That speeds up a lot of processing but puts you in front of some similar problems regarding the memory space on the GPU card. However, let's be honest here, if you want to train a deep learning model, you definitely want an Nvidia GPU in your laptop or desktop PC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reasons against running Deep Learning on your Beefy PC
&lt;/h2&gt;

&lt;p&gt;Is that all?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm not a fan of running deep learning on local hardware anymore. Running a reasonably big deep learning problem on your main PC will usually lock up the entire machine. Opening even small programs on the same machine can be a drag, as powerful as it may be. Deep learning models train for hours or even weeks, where your machine can be barely usable with significant power usage.&lt;/p&gt;

&lt;p&gt;Where there's power, there's heat! Training deep learning models for extended periods of time can become quite hot. If you're like me during the pandemic, a lot of my work is done on the couch cosied up, despite having an amazing desk with screens and everything. Training might make the machine a bit more toasty than you'd prefer. Gaming laptops with dedicated Nvidia graphics cards are ok for this kind of training, and the Macbooks M1 will be too. Gaming laptops are notorious for not being particularly uncomfortable on the legs when playing heavy games or training models for extended periods, something to consider.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Recommendation
&lt;/h2&gt;

&lt;p&gt;You can totally train machine learning models on laptops or even your phone. Deep learning is a bit more tricky but is also becoming much more commonplace with Apple's adoption of the M1 chip.&lt;/p&gt;

&lt;p&gt;For Machine Learning for Science, I personally recommend getting a reasonable work computer with enough RAM and a decent CPU, but leave Deep Learning to dedicated machines or the cloud. Try it&lt;/p&gt;

&lt;p&gt;Try it out train a model on your laptop!&lt;/p&gt;

</description>
      <category>gpu</category>
      <category>laptop</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Transfer Learning is the Most Important Tool You Need to Learn</title>
      <dc:creator>Jesper Dramsch</dc:creator>
      <pubDate>Fri, 25 Jun 2021 10:33:00 +0000</pubDate>
      <link>https://forem.com/jesperdramsch/transfer-learning-is-the-most-important-tool-you-need-to-learn-1d5g</link>
      <guid>https://forem.com/jesperdramsch/transfer-learning-is-the-most-important-tool-you-need-to-learn-1d5g</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D-KzyK8e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/transfer-learning.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D-KzyK8e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/banner/transfer-learning.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You almost immediately learn about transfer learning when you take the &lt;a href="https://fast.ai"&gt;fast.ai&lt;/a&gt; course. This is no mistake! Transfer learning gets you started in your deep learning journey quickly, building your first neural network-based classifier in minimal time.&lt;/p&gt;

&lt;p&gt;But transfer learning is so much more, and it's surprisingly important for machine learning in science.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Transfer Learning?
&lt;/h2&gt;

&lt;p&gt;From a technical standpoint, transfer learning means taking a trained machine learning model and using it on a new, different, but related task. Let's say you take a classifier trained on ImageNet, like a ResNet. It's effortless these days to download that ResNet with trained weights on ImageNet! Usually, that training takes days to weeks and a significant chunk of money from a research grant.&lt;/p&gt;

&lt;p&gt;However, our data isn't ImageNet. Let's say you want to start with a cat/dog classifier. Then transfer learning enables you to utilize the existing weights on the complex ImageNet data that has many more classes and more complexity captured in the weights of the network. Oftentimes, machine learning practitioners will retrain the network with a low learning rate, called fine-tuning, to maintain said complexity of the network, but adjust the weights ever so slightly for their cat/dog classifier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why for Science?
&lt;/h2&gt;

&lt;p&gt;Science doesn't really care about cat/dog classifiers. We want to scan brains, find black holes and explore the core of the Earth!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---VWwo3D---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/blackhole.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---VWwo3D---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dramsch.net/images/blackhole.png" alt="BLACK HOLE IMAGE"&gt;&lt;/a&gt;&lt;em&gt;Credits: Event Horizon Telescope collaboration et al.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is where the big sibling of transfer learning comes in: &lt;strong&gt;Domain adaptation&lt;/strong&gt;. Domain adaptation posits that an agent trained on a task &lt;strong&gt;A&lt;/strong&gt; can do task &lt;strong&gt;B&lt;/strong&gt; with minimal retraining if &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; are sufficiently similar. Sound familiar? Yes, it's a general version of transfer learning. The underlying idea is that the agents learn a distribution over task &lt;strong&gt;A&lt;/strong&gt; , just like a neural network learns a representation of, i.e. ImageNet. Then the agent or our network can be adapted to work on a task, where the distribution is similar enough for the learned distribution to be "shiftable" towards our goal task.&lt;/p&gt;

&lt;p&gt;What does that mean?&lt;/p&gt;

&lt;p&gt;How can this help me in science?&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a pre-trained Network directly
&lt;/h2&gt;

&lt;p&gt;ImageNet weights are readily available and capture a lot of complexity in a classification task. Of course, there are larger datasets, but the availability here is vital. In case you're more interested in other tasks, like object identification PASCAL-VOC or COCO are good choices.&lt;/p&gt;

&lt;p&gt;Then you can use these pre-trained networks and see whether you can fine-tune them on your data. In fact, pre-trained ImageNet ResNets were used in the Kaggle competition to segment salt in seismic data! And yes, this my &lt;a href="https://dramsch.net/files/SEG_expanded_abstract_2018___Deep_learning_seismic_facies_on_state_of_the_art_CNN_architectures.pdf"&gt;conference paper&lt;/a&gt; from 2018 was a direct precursor to &lt;a href="https://www.kaggle.com/jesperdramsch/intro-to-seismic-salt-and-how-to-geophysics"&gt;this work&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Be aware that some networks generalize better than others. VGG16 is known for its general convolutional filters, whereas a ResNet can be tricky, depending on how much data you have available.&lt;/p&gt;

&lt;p&gt;Remember that you can always use a pre-trained network in a larger architecture! In the competition above, people included the pre-trained ResNet within a U-Net to perform semantic segmentation instead of classic single image classification!&lt;/p&gt;

&lt;h2&gt;
  
  
  Train Once, Fine-Tune Next
&lt;/h2&gt;

&lt;p&gt;In science, especially in emerging applications, scientists will publish a proof of concept paper. Making a network work on a specific use case can be a valuable gateway to a general method.&lt;/p&gt;

&lt;p&gt;Great scientists will publish their trained model alongside the code to reproduce these results. Frequently, you can use that trained network and fine-tune the network on a new site of a similar problem set. An example from the &lt;a href="https://www.itu.int/en/ITU-T/focusgroups/ai4ndm/Pages/default.aspx"&gt;Focus Group meeting for AI for Natural Disaster Management&lt;/a&gt; I attended today is to train a network on an avalanche-prone site where a lot of data is available and then transfer the model to the new complexity captured by the first site.&lt;/p&gt;

&lt;p&gt;This is not the generalization that most machine learning scientists strive for. However, it can be a valuable use case for applied scientists in specific areas. It's also great as a proof of concept to obtain grants for more data collection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Train the Big One
&lt;/h2&gt;

&lt;p&gt;The holy grail. The network to rule them all. The GPT-3 to my little corner of science.&lt;/p&gt;

&lt;p&gt;When you're in the lucky position to have massive amounts of diverse datasets, you can train a model on all of it. This model ideally captures general abstractions from the data. Then, you fine-tune it to specific areas when needed.&lt;/p&gt;

&lt;p&gt;This is, for example, done in active seismic. Many of the data brokers and service companies create large-scale models that can then be fine-tuned to the specific segmentation task a customer has at hand.&lt;/p&gt;

&lt;p&gt;These models are particularly exciting to examine in ablation and explainability studies to gain deeper insight into specific domains and how a neural network interprets it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't take My Word for it!
&lt;/h2&gt;

&lt;p&gt;You could start with the fast.ai course and learn about transfer learning, or maybe read some research papers on the &lt;a href="https://paperswithcode.com/task/domain-adaptation/latest"&gt;fantastic paperswithcode&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Or maybe you'd like to watch the &lt;a href="http://cvpr2021.thecvf.com/"&gt;CVPR 2021 workshop&lt;/a&gt; that in part inspired me to write this short look into applications of transfer learning: &lt;a href="https://vita-group.github.io/cvpr_2021_data_efficient_tutorial.html"&gt;Data- and Label-efficient Learning in an Imperfect World&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>deeplearning</category>
      <category>machinelearning</category>
      <category>transferlearning</category>
      <category>science</category>
    </item>
  </channel>
</rss>
