<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Simon Hawe on Medium]]></title>
        <description><![CDATA[Stories by Simon Hawe on Medium]]></description>
        <link>https://medium.com/@simon.hawe?source=rss-a63ca22cb64b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fB3BMi5AxmS1MAcA8TlGBw.jpeg</url>
            <title>Stories by Simon Hawe on Medium</title>
            <link>https://medium.com/@simon.hawe?source=rss-a63ca22cb64b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:03:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@simon.hawe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How a Simple Change Accelerates Your Google Cloud Spanner Queries by 3x]]></title>
            <link>https://levelup.gitconnected.com/how-a-simple-change-accelerates-your-google-cloud-spanner-queries-15cad8a0572d?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/15cad8a0572d</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[cloud-spanner]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Sun, 28 Apr 2024 17:30:28 GMT</pubDate>
            <atom:updated>2024-04-29T06:37:08.654Z</atom:updated>
            <content:encoded><![CDATA[<h4>A surprisingly simple and highly effective optimization for your Spanner SQL queries.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D5LU_kZFAO8tO7H3" /><figcaption>Photo by <a href="https://unsplash.com/@curioso?utm_source=medium&amp;utm_medium=referral">Curioso Photography</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Assume you are serving a machine-learning model via an API. When exposing such an API, you probably always want to optimize for low response latency. The faster you can respond to a request, the happier your customers are. That is a given.</p><p>Multiple things can contribute to the latency of your API that <em>you</em> have under control. These include but are not limited to too complex computations during model inference, the choice of your database technology, or how you interact with your chosen database. In the following, we are going to focus on the latter two as this can be solved independently of the machine learning task you are trying to solve.</p><p>Considering which database technology to pick, <a href="https://cloud.google.com/spanner?hl=en">Google Cloud Spanner</a> is a good choice due to its high performance, horizontal scalability, and global availability. Furthermore, Spanner supports a standard SQL interface, allowing you to use familiar SQL queries and tools to interact with the database. This simplifies development and integration with your existing applications.</p><p>Though you can use standard SQL, the performance of your query can be better or worse depending on various Spanner-specific factors. In the following, I will highlight a small modification to your current queries that can greatly enhance performance and reduce costs. Are you curious? Then read on!</p><h4>The Problem</h4><p>Let’s start with outlining the general problem that we want to solve. All my code examples are written in Python, but the same principles apply to any other programming language offering a Spanner interface.</p><p>Now, assume you have an application that requires retrieving information about a user on request time. That information is stored in a Spanner table called users . A user is uniquely identified via theiruser_id , which is also the table&#39;s primary key. On request time a user_id is passed to your application and you can retrieve the corresponding information like</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62f7b0c2f0f2a8f63a081eba99fc40d2/href">https://medium.com/media/62f7b0c2f0f2a8f63a081eba99fc40d2/href</a></iframe><p>Let’s quickly go through this tiny piece of code.</p><p>First, we set up a spanner client. Next, there is a function get_userdata that gets the user information from Spanner. The interesting part here is in line 8. There, we insert or interpolate the value user_id into the query string using an f-string and send the resulting string to Spanner.</p><p>Now, why is this interesting at all? That seems to be straightforward and logical to do. That’s what I also thought until my API got more requests, and suddenly Spanner didn’t respond anymore at all due to too high CPU usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l0ut009Et_noM9Qz" /><figcaption>Photo by <a href="https://unsplash.com/@kingmaphotos?utm_source=medium&amp;utm_medium=referral">Jeff Kingma</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>What a bummer!</p><p>Now, to solve that problem we have two options. First, scale up Spanner and pay more to Google 💰, which is not an option. Second, optimize the query to be less CPU-hungry 🍴. The latter sounds more desirable to me.</p><p>But how do you want to optimize such a simple query that already uses a primary key for fast look-up? It turns out that this is quite easy.</p><h4>The Solution</h4><p>Without further ado, let’s directly jump into the code that solves the problem</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b43b8bd67a22f3c1fa83d234f36bb5b1/href">https://medium.com/media/b43b8bd67a22f3c1fa83d234f36bb5b1/href</a></iframe><p>Hmm, this looks similar to before. The only thing I have changed is moving away from string interpolation to include the user_id into the query to use <strong>query parameters. </strong>You use a query parameter in a query via @your_parameter and populate it via a dictionary called params. You can have multiple query parameters in a query and also use the same one in multiple places.</p><p>Now, what huge effect can that small change have? Let’s have a look at the latency of my query and the CPU usage when I made the switch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Mogm-xCmE5y0wCOgTbNSg.png" /><figcaption>Latency 50th Percentile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTdbrwpZiuzwuJzGVy_3DA.png" /><figcaption>Total CPU Usage</figcaption></figure><p>What you can see here is a 3x decrease in latency and a similar decrease in CPU usage. That’s a lot! When I first saw this, I was like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I55nYCGeF5JJ9b58" /><figcaption>Photo by <a href="https://unsplash.com/@theshubhamdhage?utm_source=medium&amp;utm_medium=referral">Shubham Dhage</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Now, why do we see such a performance gain? This gain is because <em>Spanner can cache the query execution plan</em> of queries that use query parameters. So if you run the same query many times but just parameterized differently, you see that huge benefit. For most HTTP-based applications, this is exactly the case.</p><p>To emphasize that once again, this benefit is not only on reduced latency but also on <em>reduced Spanner costs and stability</em>. And the best is that it comes at zero costs for you. That’s nice, isn’t it?</p><p>Last, using query parameters also makes your code more secure as it protects you from SQL injections and you don’t have to take care of quoting. That’s all handled by Spanner for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Iwo6airw2x08wc9" /><figcaption>Photo by <a href="https://unsplash.com/@hebrews12girl?utm_source=medium&amp;utm_medium=referral">Joyce Adams</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Conclusion</h3><p>In this short article, I have shown you how to improve performance and reduce costs at no cost in Cloud Spanner using query parameters. Have a look at all your queries and apply that change. It is worth it!</p><p>Thank you for following this post. As always, feel free to contact or follow me for questions, comments, or suggestions either here on Medium or via <a href="https://www.linkedin.com/in/simon-hawe-75832057">LinkedIn</a>. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15cad8a0572d" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-a-simple-change-accelerates-your-google-cloud-spanner-queries-15cad8a0572d">How a Simple Change Accelerates Your Google Cloud Spanner Queries by 3x</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NVIDIA Triton Unleashed: Elevate Your App’s Performance Game! ]]></title>
            <link>https://medium.com/tech-p7s1/nvidia-triton-unleashed-elevate-your-apps-performance-game-1b3d3f8afe85?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b3d3f8afe85</guid>
            <category><![CDATA[realtime]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 10:36:33 GMT</pubDate>
            <atom:updated>2024-02-15T10:36:33.869Z</atom:updated>
            <content:encoded><![CDATA[<h4>How we compute recommendations in real-time with low latency.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q0HYhMyOBR5vtTnF" /><figcaption>Photo by <a href="https://unsplash.com/@thomascpark?utm_source=medium&amp;utm_medium=referral">Thomas Park</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Imagine you open a web page or an app and it takes ages to load it. Probably you would be very annoyed. Worse than that, you most likely wouldn’t even wait that long but rather drop off and never come back and tell your friends that this is all crap. That would be a bummer 🤦‍♀! What do we learn from that? We learn from that that loading speed or latency is decisive for an application’s user experience.</p><p>However, we often run into these issues in various apps. Why is that? The reason for that is that it can be a <em>huge technical challenge to serve the most relevant content for a user with low latency</em>. This is especially true when you serve personalized content where caching is not a solution to speed up things. All that becomes even more challenging when your personalization is based on machine learning models that have to be executed on request time.</p><p>In this article, <a href="https://www.linkedin.com/in/victoria-sazonova/"><em>Victoria </em></a><em>(Associate Data Scientist), </em><a href="https://www.linkedin.com/in/nikita-tselousov-16555b15b/"><em>Nikita</em></a><em> (Senior Data Scientist), and </em><a href="https://www.linkedin.com/in/simon-hawe-75832057/"><em>Simon</em></a><em> (Vice President Engineering) </em>show you; <em>how to serve content recommendations computed with a machine learning model at request time with low latency.</em></p><p>In short, we do some clever engineering 🤓 and use <a href="https://github.com/triton-inference-server/server">NVIDIA Triton</a> under the hood for the heavy lifting 🏋. Want to know more details? Read on!</p><h3>Background</h3><p>At <a href="https://www.joyn.de/">Joyn</a> we use the <a href="https://blog.reachsumit.com/posts/2023/03/two-tower-model/">Two Tower model</a> for creating context-aware content recommendations. This model on a high level consists of two neural nets. The first is called Query Tower, which is used to create embeddings, i.e. long vectors, that encode users and context. The second one is called Item Tower, which creates embeddings that represent items and metadata. Similarity between users and items is measured using the dot product between the created embeddings. As item embeddings can be precomputed, this model is suited for efficient real-time serving. If you are interested in more details, have a look at <a href="https://medium.com/tech-p7s1/video-recommendations-at-joyn-two-tower-or-not-to-tower-that-was-never-a-question-6c6f182ade7c">our previous article</a>.</p><p>For model training and serving, we use the <a href="https://github.com/NVIDIA-Merlin">NVIDIA Merlin</a> framework. We train our models using <a href="https://cloud.google.com/vertex-ai/docs/training/create-custom-job">Google Cloud Vertex AI Custom Jobs</a>. The created artifacts we export in a format required by <a href="https://github.com/triton-inference-server/server">NVIDIA Triton inference server</a> which we use for efficient serving. To understand our approach and necessary steps, let’s start with having a look at what exactly we export.</p><h3>The Training Artifacts</h3><p>There are three essential parts that we export:</p><ol><li>A <a href="https://keras.io/">Keras</a> model for the Query Tower and an <a href="https://developer.nvidia.com/nvidia-merlin/nvtabular">NVTabular Workflow</a> for data preprocessing. Both are exported together as an <a href="https://github.com/triton-inference-server/server/blob/main/docs/user_guide/architecture.md#ensemble-models">ensemble in triton server format</a>.</li><li>The matrix of pre-computed item embeddings from the Item Tower, which we export in <a href="https://arrow.apache.org/docs/python/feather.html">feather format</a>.</li><li>A JSON file containing the model version string that is a unique identifier for each training job.</li></ol><p>All artifacts we put into a <a href="https://cloud.google.com/storage">Google Cloud Storage</a> (GCS) folder that is unique per model version. Apart from that, we also put them in a fixed-location GCS folder that always keeps “the latest model”. The former we use for debugging and archiving purposes and the latter is the one used in our prediction service.</p><p>Speaking of the prediction service, how does this look in more detail and how does it efficiently load the artifacts and reload models in production? Let’s have a look at this in the next section.</p><h3>Prediction Service Architecture</h3><p>In the picture below, we visualize our prediction service architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*yvBil77lDuQ_OpAvSEaEOA.png" /><figcaption>Prediction service architecture (Picture by the authors drawn with <a href="https://excalidraw.com/">excalidraw</a>)</figcaption></figure><p>This is essentially a <a href="https://fastapi.tiangolo.com/">FastAPI</a> application, that receives HTTP requests containing user features and responds with a list of recommendations. Next to the FastAPI app, we have a Triton Inference Server running in parallel. The FastAPI app and the Triton server communicate locally in an asynchronous way via <a href="https://grpc.io/">gRPC</a>. The entire service consisting of the app and the inference server is containerized and both run within the same Docker Container but as separate processes. We will debate later on why exactly we ended up with this one-container-two-processes setup.</p><p>In addition to that we have a hot storage where we keep real-time values for user features that are not available in the request itself. Such features can be demographics or recent interaction data of our users. We use<a href="https://cloud.google.com/spanner"> Google Cloud Spanner</a> to store those as it provides low-latency key lookups as well as querying data with complex queries.</p><p>We query this database on request time to enrich the user context used to create user embeddings with the Query Tower.</p><h4>Service Startup</h4><p>Considering what we aim to do when starting our service, let’s first recap what we aim to do. We are aiming to compute a score for each item given user data. We get the score as the dot product between item embeddings and user embeddings. Unsurprisingly, we need to have access to those embeddings on request time.</p><p>As mentioned, item embeddings are precomputed at training time and loaded on service startup. To get the user embeddings, we have to run the given user context through the Query Tower. This requires loading the corresponding weights and setting up the respective neural network.</p><p>With this in mind, let’s break down the startup procedure:</p><ol><li>The Docker container entry point launches two parallel processes — the FastAPI app and the Triton server.</li><li>Both the FastAPI app and Triton server load the model artifacts from the same fixed GCS location given from an environment variable. Whenever we retrain and hence update our model, the respective artifacts get written to the same GCS location as stored in the environment variable.</li><li>The FastAPI app loads the pre-trained item embeddings from a feather file into a Pandas Dataframe global object. Additionally, it loads the model version from the JSON file to a string global object. This is the cornerstone of our model update procedure, which we will break down further.</li><li>The Triton server loads the preprocessing workflow and the Query Tower Ensemble.</li></ol><p>Steps three and four run simultaneously as the two processes are executed in parallel.</p><p>Now, everything is ready to serve incoming requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*80T3jzM2OGJ2FDMr" /><figcaption>Photo by <a href="https://unsplash.com/@countchris?utm_source=medium&amp;utm_medium=referral">Count Chris</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Note: To run the Triton inference server we use the official NVIDIA Triton Docker image. However, due to its huge size as well as the described data loading steps, the startup of the service can take up to one minute, which is sub-optimal for serverless platforms like Cloud Run.</p><h4>Serving Recommendations</h4><p>Now, the service is up and running and ready to serve recommendations. Each request that comes to the service contains a user ID and some optional context features such as device information. As a first step, the FastAPI app enriches this data with time-based features, i.e. time of day and day of week. Furthermore, it obtains user features like age and gender from the hot storage. All this data is then sent as input features to the Triton server via gRPC, where our Query Tower runs.</p><p>In Triton, we have the preprocessing Workflow and the Query Tower running together as a Directed Acyclic Graph (DAG). When Triton receives a request with raw user features it first takes them through the preprocessing workflow. There, features undergo the same transformation as during training. This is a crucial step for proper inference and a core strength of using Merlin and NVTabular.</p><p>Next, these processed features are fed into the Query Tower, which produces an embedding for the given user features. This embedding is returned to the FastAPI app, where we compute the dot product between this user embedding and all item embeddings. This gives us a score for each item representing how likely this user would like it. Finally, we sort the items by scores and return the largest n as the recommendations to the user.</p><p>As you can see, this setup is pretty simple and efficient in serving recommendations, as we only need to perform resource-heavy neural net inference with half of the model, the Query Tower, and only a single user. And computing a dot product is very cheap thanks to <a href="https://numpy.org/">Numpy</a>.</p><h4>Model Update</h4><p>Until now, we have covered the easy part of starting our service from scratch. However, we re-train a model every day to include new users and items. Consequently, <em>how do we rotate the model seamlessly and most efficiently without incurring any service downtime?</em> Moreover, how do we make sure that both item embeddings in the FastAPI app and the Query Tower in Triton are in sync, meaning they are used from the same model version?</p><p>We cannot just make both processes poll the GCS bucket with the latest artifacts independently, as in this case there inevitably would be a time window where the FastAPI app finished loading new item embeddings, but Triton is still using the old Query Tower or vice versa. Why is that a problem? It is a problem because user- and item-embeddings would not be from the same vector space and their similarity would be completely random. And what if we change the model architecture or add new features? All of that would lead to different embedding spaces and random recommendations for the end users. That would be a bummer 🤦‍♀. Here is how we solved this challenge.</p><p>For two independent entities to do something in sync they need to “see” each other’s actions to do their part in time. That means that the FastAPI app and the Triton server need to communicate when the model update is running and has finished.</p><p>Luckily, Triton exposes an API to control model updates. We can call this <a href="https://github.com/triton-inference-server/server/blob/b876a90fe92d0e36621bdb66f2cc522665473222/docs/protocol/extension_model_repository.md#load">API</a> on the local Triton server, to command it to reload the model. What is great is that Triton will still serve the old model, while re-loading the new model. And once it is done one gets notified and the switch between versions is seamless.</p><p>As Triton can be commanded and we have the FastAPI app under control, the FastAPI app coordinates everything needed during model updates. But how to do that in a non-blocking way? You guessed it, we use threads for the win.</p><p>The main thread in our FastAPI app serves requests asynchronously, while another background thread coordinates model updates. The whole process is depicted in the image below. Let’s get through it step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZswEVs8DV4rGjGP9F-fwA.gif" /><figcaption>Model artifacts loading (Picture by the authors drawn with <a href="https://excalidraw.com/">excalidraw</a>)</figcaption></figure><p>The FastAPI app loads the item embeddings and the unique model version identifiers on startup. In addition, we launch a background thread inside the app that periodically loads the JSON file containing the model version and compares it with the model version global string object. Once the background thread detects a change in version, it loads the new item embedding to a temporary object.</p><p>However, it doesn’t swap the in-memory global item embeddings yet. First, it tells Triton to update the model. Triton now loads the new model from GCS in the background and responds only when it finishes the switch. Mentioning it again, while loading the new model, we can still query Triton and it still uses the old model. After Triton responds with “OK I’m now using the new model“, the background thread swaps item-embeddings and model version global objects with the newly loaded ones.</p><p>This way we (almost) always keep item embeddings and the Query Tower in sync and do not incur any downtime. Mission accomplished🕺.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zoJhCf_nOetd__QJ" /><figcaption>Photo by <a href="https://unsplash.com/@jimmy_conover?utm_source=medium&amp;utm_medium=referral">Jimmy Conover</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Results</h4><p>This setup allows us to serve thousands of requests per minute under 100ms latency per request. Emphasizing again, these 100ms include both Neural Network inference and at least two Spanner queries. All of that runs with only 2 CPUs and without any use of GPU acceleration. We think that is pretty fair 😃.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*xRt0A0TOz8ita4dbweM_uQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*CNOVZxsT-UXtdWVeYDh0eg.png" /></figure><h3>Wrap up</h3><p>Effectively adopting a recommender system doing request time computation to your use case and serving it in a production environment scaling to millions of requests is challenging. In this article, we showed how we used the NVIDIA Merlin framework, FastAPI, and Triton Inference server to solve this challenge for <a href="https://www.joyn.de/">Joyn</a> to enable our real-time context-aware content recommendations.</p><p>In the next article, we will provide several practical snippets and hacks that you might find useful (or sometimes even necessary) when building your real production recommender system using NVIDIA Merlin and Triton. Stay tuned.</p><p>Thank you for following this post. As always, feel free to contact or follow us for questions, comments, or suggestions either here on Medium or via LinkedIn <a href="https://www.linkedin.com/in/victoria-sazonova/">Victoria</a>, <a href="https://www.linkedin.com/in/nikita-tselousov-16555b15b/">Nikita</a>, and <a href="https://www.linkedin.com/in/simon-hawe-75832057">Simon</a>. 🙌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b3d3f8afe85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-p7s1/nvidia-triton-unleashed-elevate-your-apps-performance-game-1b3d3f8afe85">NVIDIA Triton Unleashed: Elevate Your App’s Performance Game! 🌐🔥</a> was originally published in <a href="https://medium.com/tech-p7s1">ProSiebenSat.1 Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Video Recommendations at Joyn: Two Tower or Not to Tower, That Was Never a Question]]></title>
            <link>https://medium.com/tech-p7s1/video-recommendations-at-joyn-two-tower-or-not-to-tower-that-was-never-a-question-6c6f182ade7c?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c6f182ade7c</guid>
            <category><![CDATA[streaming]]></category>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[joyn]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[recommender-systems]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 08:01:04 GMT</pubDate>
            <atom:updated>2024-02-15T11:12:11.240Z</atom:updated>
            <content:encoded><![CDATA[<h4>Integrate context into your recommender system to make your users and hence yourself happy.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XYchNKBDSyCQNqec" /><figcaption>Photo by <a href="https://unsplash.com/@koushikpal?utm_source=medium&amp;utm_medium=referral">Koushik Pal</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When you use a video streaming platform, the most important question for you is probably “How do I find something cool to watch?”. Most likely, you will watch something you already know or that is currently popular. However, how can you go beyond that? How can you discover awesome content that fits your taste and mood from a huge catalog without endless searching or browsing? This is where recommender systems enter the game.</p><p>A recommender system aims to simplify content discovery using algorithms and data about your behavior, preferences, and viewing patterns. By doing this, the system can offer highly personalized suggestions, ultimately enhancing your experience and ensuring that everyone easily finds and enjoys content that aligns with their unique tastes and interests.</p><p>In this article, <a href="https://www.linkedin.com/in/victoria-sazonova/"><em>Victoria </em></a><em>(Associate Data Scientist), </em><a href="https://www.linkedin.com/in/nikita-tselousov-16555b15b/"><em>Nikita</em></a><em> (Senior Data Scientist), and </em><a href="https://www.linkedin.com/in/simon-hawe-75832057/"><em>Simon</em></a><em> (Vice President Engineering)</em> give you the Why, What, and a glimpse of the How of the recommender system we built for our streaming platform <a href="https://www.joyn.de/">Joyn</a>. On a high level, it is a context-aware neural network-based online prediction system based on Nvidia’s bleeding edge open-source recommender system framework <a href="https://developer.nvidia.com/merlin">Merlin</a>. Sounds fancy, doesn’t it? Are you curious? Our recommendation for you is to <em>read on</em>!</p><h3>Recommender System Foundations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QR5k4OcSqgBio5Y8" /><figcaption>Photo by <a href="https://unsplash.com/@ballonandon?utm_source=medium&amp;utm_medium=referral">Ben Allan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Modern recommender systems can be roughly clustered into three categories:</p><ol><li><a href="https://developers.google.com/machine-learning/recommendation/content-based/basics">Content-based filtering</a> systems: They suggest items based on metadata of videos you have shown interest in or liked in the past.</li><li><a href="https://developers.google.com/machine-learning/recommendation/collaborative/basics">Collaborative filtering</a> systems: They predict a user’s preferences by leveraging the preferences and behaviors of similar users. Preferences can be either present explicitly via ratings or implicitly via users having interacted with items. The latter is most commonly used in practice as ratings are rarely given.</li><li>Hybrid systems: They combine both metadata and user interaction data.</li></ol><p>At Joyn, we historically employed a collaborative filtering approach based on <a href="https://github.com/benfred/implicit">implicit user feedback and Matrix Factorization</a>. This brought us quite far in serving high-quality personalized video recommendations. However, this approach has three major limitations:</p><ol><li>It <em>doesn’t allow you to easily integrate context information</em> to come up with recommendations. By context, we mean information like the device you are currently using, the time of the day when you request a recommendation, or your most recent video views. Why is that information valuable? It allows one to adopt recommendations towards that context. So in the morning on your mobile phone, you most likely want to watch something different compared to in the evening on your big screen device.</li><li>Directly <em>adding metadata into model training is not feasible</em>; interaction data is the sole input. Other data can only be included as post-processing in an ad hoc way. Yet, with abundant content metadata and the rise of Large Language Models (LLMs) and text embeddings, including this information can significantly enhance recommendation quality.</li><li><em>It is almost impossible to get recommendations for users not present during training</em>, which is known as the <a href="https://medium.com/@markmilankovich/the-cold-start-problem-for-recommender-systems-89a76505a7">user cold-start problem</a>.</li></ol><p>Now, what should we do? How can we address the above-mentioned shortcomings and serve the most suitable recommendations to <em>all</em> our users? This is where neural network-based recommender architectures enter the game.</p><p>How do neural network-based systems help? Roughly speaking, you input features such as interaction data, context information, or metadata, and the network determines the optimal combination through its learning mechanisms. <em>Adding new features or context consequently only means providing more data</em> without redesigning your entire architecture. That’s cool, isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EzLUA9mWEbv1xaG0" /><figcaption>Photo by <a href="https://unsplash.com/@fuerte?utm_source=medium&amp;utm_medium=referral">Collin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Several neural network-based recommender architectures exist, which you can read about <a href="https://towardsdatascience.com/modern-recommendation-systems-with-neural-networks-3cc06a6ded2c">here</a>. However, we cannot freely choose an architecture as we have one constraint; <em>context information about our users is only available at request time</em>. That means that we have to compute recommendations in real time without introducing large latencies. Hence, we need a very efficient system.</p><p>Luckily, there is one architecture that caters to all of that: <a href="https://blog.reachsumit.com/posts/2023/03/two-tower-model/"><strong>Two-Tower Recommender systems</strong></a>.</p><p>What is this you may ask yourself? That’s what we cover in the next section.</p><h3>Two-Tower Recommender System</h3><p>The idea behind the two-tower model architecture is that there are two separate neural networks, called towers. You can interpret these two towers as separate models one representing the <em>users, known as the query tower</em>, and one representing the <em>items, known as the candidate tower</em>. During training, each tower learns to transform an arbitrary set of input features into vectors known as embeddings. The dimension of these embeddings must be the same for both the users and the items as finally the similarity between them is measured using the dot product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbK2gjfLC4IFoM6AVWLaUQ.png" /><figcaption>Two-Tower Architecture (Picture by the authors drawn with <a href="https://excalidraw.com/">excalidraw</a>)</figcaption></figure><p>As you can see from the picture above, user- and item information interact solely in the final stage of the system. This characteristic enables effective model training and makes two-tower networks a perfect candidate for real-time inference.</p><p>But why is the architecture efficient when it comes to inference? <em>During inference, we can make use of the fact the item embeddings are fixed.</em> Hence, we can precompute them after training and load them at inference time, which means we don’t have to execute any neural net for items during inference.</p><p>User embeddings, however, depend on context. Therefore, we have to compute them on the go — so a user gets different predictions depending on i.e. the time of day. However, we only have to do this for one user at a time, which is again fast to compute.</p><p>Last, we calculate the dot product between the loaded item embeddings and the computed user embeddings and arrange the results in descending order based on the scores. Again, a very efficient and fast operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I0xZvL046yodIrQA" /><figcaption>Photo by <a href="https://unsplash.com/@shiroscope?utm_source=medium&amp;utm_medium=referral">Shiro hatori</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As of now, we are just speaking very high level. Next, we dive into the Merlin Framework, which we use to bring all that to action.</p><h3>Using the Nvidia Merlin Framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*juTDPvRw7u0qC8EEpwW5YA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@pixelshiftarr?utm_source=medium&amp;utm_medium=referral">Elisabeth Pieringer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The most important part when building a recommender system, or any Machine Learning system, is having the necessary data and being able to test how your data, features, and model architecture work in practice. Having standardized building blocks greatly streamlines this process, relieving you from implementing them and enabling you to focus on delivering value. This is the core offering of <a href="https://developer.nvidia.com/merlin">NVIDIA’s open-source Merlin framework</a>, which furnishes user-friendly APIs for developing scalable recommender systems ready for production.</p><p>Concretely, Merlin is a set of high-level Python libraries built around <a href="https://pytorch.org/">PyTorch</a> and <a href="https://www.tensorflow.org/">Tensorflow</a> that run on both CPU and GPU. The main libraries we use are <a href="https://developer.nvidia.com/merlin/nvtabular">Merlin NVTabular</a> and <a href="https://github.com/NVIDIA-Merlin/models">Merlin Models</a>.</p><p>NVTabular is a library to build scalable feature engineering pipelines, also known as workflows. One core benefit of it is that it ensures that <em>feature engineering is done consistently between training and prediction</em>.</p><p>Merlin Models is a library that provides standard components for recommender systems, including classic Matrix factorization-based ones but also neural-net-based ones like the Two-Tower Recommender. You can use all components out of the box, building a training pipeline with about 10 lines of code. But, you also have the flexibility to add your own components or extend existing ones. That’s all pretty nice.</p><p>Looking at the downsides, as always with new frameworks, you have to consider that finding help when running into issues is difficult due to a small community and improvable documentation. Hence, when you find bugs, and be sure you will, you have to be able to help yourself. When asking ChatGPT about Merlin, you will probably end up reading things about wizards. Still, we think this framework is the right choice and has a bright future with more people adopting it.</p><h3>Data, Training, and Serving</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqXyCWprOtTficNWeCSSnw.png" /><figcaption>Training and Serving architecture (Picture by the authors drawn with <a href="https://excalidraw.com/">excalidraw</a>)</figcaption></figure><h4>The Dataset</h4><p>The key information we feed into the model is user-item interactions. As we have many shows and series on our platform, we have multiple interactions, one per episode, with the same content. <em>We do not aggregate these on a user/series level but keep each interaction as one event</em>. This approach has proven effective for us, possibly because the number of interactions reflects a user’s genuine interest in the content.</p><p>We enrich the interaction data with both user and item metadata. User features include contextual information i.e. device, time of day, day of the week, and demographics.</p><p>For items, we add categorical information such as genres or type (movie or series). But an item is best characterized by its textual description, hence, it is beneficial to use that information too. How can we do that? We can do that by creating text embeddings and <em>adding those to the model as untrainable weights</em>, helping the model to better understand item similarity. Text embeddings we create via a <a href="https://huggingface.co/sentence-transformers/all-mpnet-base-v2">Hugging Face </a>LLM, but you are free to choose what to use.</p><p>Another thing to mention is the so-called “user-take” features. Those involve incorporating a user’s nmost recent interactions as additional model features. NVTabular can encode these jointly with the main item-ID feature, creating a connection for the model. This approach has multiple benefits.</p><p>First, it <em>provides additional context about a user’s current interests</em> and steers the recommendations toward that.</p><p>Second, <em>this helps address the cold start problem</em>, offering recommendations for new users right after their first interaction without having to retrain the model. For that to work, we take a share of users’ data and remove their user-ID. This allows our model to learn to make predictions solely based on user takes, and hence mitigate the cold start problem.</p><p>To combine and execute all these steps into a single processing pipeline, we use NVTabular. It also takes care of handling missing values or encoding categorical features with a minimal amount of code. This is exactly what we love about Merlin — it hides a lot of boilerplate from you when it comes to setting up and exporting a machine-learning pipeline. Hence, it lets you focus on actual feature and model development.</p><p>Let’s have a look at that in the next section.</p><h4>Model Training</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5jEHXVGkN8ldoIrghl8Zg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/de/@john_cameron">John Cameron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Before we train anything on our dataset, we need to build a model. This includes taking all our user and item features, splitting them correspondingly between the query- and item tower, creating input embedding layers of the correct size for every feature, adding a couple of dense layers, and defining a loss function. Quite a lot isn’t it?</p><p>Luckily, Merlin abstracts all of that away from us. When we apply our NVTabular preprocessing pipeline to our training events, the underlying schema object of the NVTabular Dataset will have all the information necessary for Merlin to create the correct inputs for your model. Last, you have to choose the model architecture and the loss function from the Merlin model package.</p><p>But, there is one more thing to consider. Our dataset contains interactions between users and items, which we all treat as <em>positive samples, so something a user likes</em>. However, <em>we also have to show the model negative samples</em>, so items a user does not like. Why? Otherwise, the model would just learn to always spit out a perfect positive score independent of its input. This would be pretty useless, wouldn’t it?</p><p>One approach to get negative training examples is to use negative sampling. In that, for each positive sample, we select nitems that a user has not interacted with as negative examples. <a href="https://github.com/RUCAIBox/Negative-Sampling-Paper">Various methods exist</a> on how to draw these samples from your data. The most efficient one that also works well in practice is <a href="https://research.google/pubs/pub48840/">In-Batch negative sampling</a>. Here, you select samples from the current training batch and not from the entire training set. For this to work, your training set must be randomly shuffled and not sorted by user-ID or item-ID.</p><p>Considering the implementation of sampling, <a href="https://nvidia-merlin.github.io/models/main/_modules/merlin/models/tf/blocks/sampling/base.html">Merlin offers an interface</a> to add any sampler of your choice. It also comes with a set of predefined samples, including <a href="https://nvidia-merlin.github.io/models/main/generated/merlin.models.tf.InBatchSampler.html">In-Batch negative sampling</a>.</p><p>With this, we have everything ready to train our two-tower recommender. Exciting!</p><p>For fast training and maximum flexibility, we use<a href="https://cloud.google.com/vertex-ai/docs/training/create-custom-job"> Google Cloud Vertex AI Custom Jobs</a>. Here, you can run your customized Docker containers based on <a href="https://cloud.google.com/vertex-ai/docs/training/pre-built-containers">prebuilt vertex ai base images</a>, which gives you flexibility, on a GPU-powered machine of choice, which makes it fast. The resulting model artifacts we store in a Google Cloud Storage (GCS) bucket. One important fact to note is that we store the network weights for the query tower, i.e., the user model. However, for the items we compute the output of the nets, i.e. the item embeddings, and store only them on GCS.</p><p>We retrain the model daily to incorporate information about new users and new items. Training Done!</p><p>Now, what do we do with those stored artifacts? That’s what comes in the last section.</p><h4>Serving Recommendations to Our Users</h4><p>With our trained model, we want to compute recommendations in real-time. Sounds simple doesn’t it? Theoretically, it is. However, to bring this to a scalable production-grade solution serving millions of requests per day, we had to invest quite some brain and coding power here, which deserves its own article, which you find <a href="https://medium.com/tech-p7s1/nvidia-triton-unleashed-elevate-your-apps-performance-game-1b3d3f8afe85">here</a>. Nevertheless, here we give you a high-level overview of our solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xJhOgoN0yLh9NCpHtBjjUg.png" /><figcaption>Serving details(Picture by the authors drawn with <a href="https://excalidraw.com/">excalidraw</a>)</figcaption></figure><p>We have a <a href="https://fastapi.tiangolo.com/">FastAPI</a>-based HTTP API that accepts requests for recommendations. Those requests contain information about the user. With these user features, <em>we compute user embeddings given the trained Query Tower</em>. To do that, we use <a href="https://developer.nvidia.com/triton-inference-server">Nvidia’s Triton Inference Server</a>, an optimized application to execute model inference with low latency. This we run as a second process next to our API application within the same Docker Container. Crazy stuff isn’t it?</p><p>In the FastAPI app, <em>we load the item embeddings on startup</em>. After calculating user embeddings, we determine final recommendations by computing the dot product with the item embeddings and sorting the scores in descending order.</p><p>The entire application is hosted on <a href="https://cloud.google.com/run?hl=en">Google Cloud Run</a>. As loading times are rather long due to loading the model and initializing Triton, Cloud Run is not the best choice considering the cost/benefit ratio. Hence, we will move to bare-metal <a href="https://cloud.google.com/compute?hl=en">Google Compute Engine (GCE)</a>, but this is just an implementation detail.</p><p>As pointed out earlier, we periodically retrain our model. This means we have to update the model artifacts used in the container to make use of a fresh model. Doing this without incurring service downtime or high latency is a non-trivial task, and we will cover it in depth in the serving article. But in a nutshell, there is a background thread running that observes file changes on GCS and is responsible for reloading the item embeddings and the Triton instance such that those are in synch.</p><p>And that is the whole story, of how we build a context-aware real-time recommender system for our stream platform Joyn using Nvidia Merlin. Feels like magic!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KwhfgnExjL24vl9t" /><figcaption>Photo by <a href="https://unsplash.com/@dollargill?utm_source=medium&amp;utm_medium=referral">Dollar Gill</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Wrap Up</h3><p>Matching recommendations to a user’s context is crucial to offer them the most suitable choices at any given point in time. In this article, we at Joyn have given you a high-level overview of why we have chosen the Two-Tower recommender architecture for that purpose, how we build and train it using NVIDIA Merlin, and how we serve contextualized recommendations in real-time using Triton and Merlin. Stay tuned for our follow-up article on the details of efficient model serving.</p><p>Thank you for following this post. As always, feel free to contact or follow us for questions, comments, or suggestions either here on Medium or via LinkedIn <a href="https://www.linkedin.com/in/victoria-sazonova/">Victoria</a>, <a href="https://www.linkedin.com/in/nikita-tselousov-16555b15b/">Nikita</a>, and <a href="https://www.linkedin.com/in/simon-hawe-75832057">Simon</a>. 🙌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c6f182ade7c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-p7s1/video-recommendations-at-joyn-two-tower-or-not-to-tower-that-was-never-a-question-6c6f182ade7c">Video Recommendations at Joyn: Two Tower or Not to Tower, That Was Never a Question</a> was originally published in <a href="https://medium.com/tech-p7s1">ProSiebenSat.1 Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Mitigate Memory Issues in Python]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/how-to-mitigate-memory-issues-in-python-c791b2c5ce7e?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*IkbH-5noT_ntLxut" width="6000"></a></p><p class="medium-feed-snippet">A small hack that can save you time, energy, and costs.</p><p class="medium-feed-link"><a href="https://medium.com/data-science/how-to-mitigate-memory-issues-in-python-c791b2c5ce7e?source=rss-a63ca22cb64b------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/how-to-mitigate-memory-issues-in-python-c791b2c5ce7e?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c791b2c5ce7e</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Tue, 15 Nov 2022 21:34:46 GMT</pubDate>
            <atom:updated>2022-11-15T21:34:46.451Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Work With Python Generators]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/how-to-work-with-python-generators-d30d8d0af7fa?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*yxutmcUKX5LnaR7G" width="5430"></a></p><p class="medium-feed-snippet">Improve readability, memory consumption, and performance by knowing how to write generators</p><p class="medium-feed-link"><a href="https://medium.com/data-science/how-to-work-with-python-generators-d30d8d0af7fa?source=rss-a63ca22cb64b------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/how-to-work-with-python-generators-d30d8d0af7fa?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d30d8d0af7fa</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Tue, 21 Dec 2021 16:13:39 GMT</pubDate>
            <atom:updated>2021-12-21T16:47:25.366Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Four Functions to Level up Your Pandas Skills]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/four-functions-to-level-up-your-pandas-skills-c89f95a1773a?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/1936/0*YrTnZVdtHcL-jOD2" width="1936"></a></p><p class="medium-feed-snippet">Assign, Map, Query, and Explode; the hottest methods in town</p><p class="medium-feed-link"><a href="https://medium.com/data-science/four-functions-to-level-up-your-pandas-skills-c89f95a1773a?source=rss-a63ca22cb64b------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/four-functions-to-level-up-your-pandas-skills-c89f95a1773a?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c89f95a1773a</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Tue, 07 Dec 2021 13:28:43 GMT</pubDate>
            <atom:updated>2021-12-07T16:42:12.135Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[All You Need to Know About Python Dictionaries]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/all-you-need-to-know-about-python-dictionaries-ccd05e5c61dd?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*cOrQc5SIWMwqhM_D" width="6016"></a></p><p class="medium-feed-snippet">What they are when to use them, and how to use them efficiently!</p><p class="medium-feed-link"><a href="https://medium.com/data-science/all-you-need-to-know-about-python-dictionaries-ccd05e5c61dd?source=rss-a63ca22cb64b------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/all-you-need-to-know-about-python-dictionaries-ccd05e5c61dd?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccd05e5c61dd</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Wed, 01 Dec 2021 22:29:10 GMT</pubDate>
            <atom:updated>2021-12-01T22:29:10.723Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Write Awesome Python Classes]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/how-to-write-awesome-python-classes-f2e1f05e51a9?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*5QvB5J1O0DxAHIMu" width="4512"></a></p><p class="medium-feed-snippet">It&#x2019;s a kind of magic</p><p class="medium-feed-link"><a href="https://medium.com/data-science/how-to-write-awesome-python-classes-f2e1f05e51a9?source=rss-a63ca22cb64b------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/how-to-write-awesome-python-classes-f2e1f05e51a9?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2e1f05e51a9</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 13:48:47 GMT</pubDate>
            <atom:updated>2021-11-24T13:48:47.846Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Context Managers; The Best Managers for Python Developers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science/context-managers-the-best-managers-for-python-developers-a5809fb7e428?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*IReZWlatfuL7zsV1" width="6361"></a></p><p class="medium-feed-snippet">How to avoid leaving the light on</p><p class="medium-feed-link"><a href="https://medium.com/data-science/context-managers-the-best-managers-for-python-developers-a5809fb7e428?source=rss-a63ca22cb64b------2">Continue reading on TDS Archive »</a></p></div>]]></description>
            <link>https://medium.com/data-science/context-managers-the-best-managers-for-python-developers-a5809fb7e428?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5809fb7e428</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Thu, 18 Nov 2021 20:39:47 GMT</pubDate>
            <atom:updated>2021-11-22T07:15:28.537Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How To Make Your Pytest Tests as DRY as Bone]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/how-to-make-your-pytest-tests-as-dry-as-bone-e9c1c35ddcb4?source=rss-a63ca22cb64b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*fgSDahSIOMGujb6t" width="5472"></a></p><p class="medium-feed-snippet">Use parameterized fixtures and enjoy</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/how-to-make-your-pytest-tests-as-dry-as-bone-e9c1c35ddcb4?source=rss-a63ca22cb64b------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/how-to-make-your-pytest-tests-as-dry-as-bone-e9c1c35ddcb4?source=rss-a63ca22cb64b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9c1c35ddcb4</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Simon Hawe]]></dc:creator>
            <pubDate>Tue, 09 Nov 2021 02:35:53 GMT</pubDate>
            <atom:updated>2021-11-09T02:35:53.613Z</atom:updated>
        </item>
    </channel>
</rss>