<?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 Andrew B. Martin on Medium]]></title>
        <description><![CDATA[Stories by Andrew B. Martin on Medium]]></description>
        <link>https://medium.com/@andrew.brown.martin?source=rss-e1e8bdb7b063------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*PZCSfkFJ95UwEOO0lY98Rg.png</url>
            <title>Stories by Andrew B. Martin on Medium</title>
            <link>https://medium.com/@andrew.brown.martin?source=rss-e1e8bdb7b063------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:12:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andrew.brown.martin/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[Looka Is Hiring Developers]]></title>
            <link>https://medium.com/looka-engineering/looka-is-hiring-developers-f166ddbe382a?source=rss-e1e8bdb7b063------2</link>
            <guid isPermaLink="false">https://medium.com/p/f166ddbe382a</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[hiring]]></category>
            <dc:creator><![CDATA[Andrew B. Martin]]></dc:creator>
            <pubDate>Tue, 21 Sep 2021 20:26:47 GMT</pubDate>
            <atom:updated>2021-10-19T13:25:11.019Z</atom:updated>
            <content:encoded><![CDATA[<p>For the first time in over 2 years, <a href="https://looka.com/">Looka</a> is hiring full time software developers. We’re at a point where the business is solid, we’re comfortable working remotely, and our road map is full of interesting projects. It wasn’t easy to get here though. Below I’ll give you some context on where we’re coming from, how we got to be in a solid position, and what it would be like working for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dH3xlDumufhpa5x8huX2jA.png" /><figcaption>Looka’s logo maker</figcaption></figure><h3>Background</h3><p>In October 2019 we laid off 32 employees, reducing Looka’s team from 42 employees to 10. We did that because we lost most of our revenue when we rebranded from Logojoy to Looka, and could no longer afford a team of 42. In fact, even after the layoffs we still were not profitable with only 10 employees.</p><p>However, with 10 employees we were confident we could turn things around. Rallying around that goal, we put our heads down and got to work building Looka back up.</p><p>For the next 6 months we worked on the business relentlessly. We wanted to reach profitability by April. To do that we made serious changes. We changed how we shipped features. We used to take our time shipping new features. Now we were shipping multiple features a week. We changed how we viewed quality. Bugs had been the constant bane of our Customer Success (CS) team, so we started converting the most bug prone part of the codebase to TypeScript. We changed how we tested features. We used to rigorously A/B test even minor features. Now we were using a modified multi-armed bandit approach to quickly find features that had large positive impacts.</p><p>It didn’t take long for this shipping first approach to pay off. Within 2 months we’d increased revenue per user more than 20%. The CS team gleefully reported that they could focus on helping customers because they were no longer apologizing for bugs. Our ads started making money for the first time in years. Our organic rankings were still in the dumps, but that was okay because we were so lean. At a team Valentine’s Day lunch, the Marketing and CS teams told me that things were “actually going really well” with visible surprise in their faces. Right on schedule, in April 2020, we hit profitability. Big thanks to Andre, Annisha, Christine, Kiah, Matthew, and Rach for helping us get there!</p><p>With the business back in the black, we set ourselves a new goal: build a subscription product. Looka is a great transactional revenue business. However, as we so brutally learned, when you have a transactional revenue business all that revenue can disappear overnight, and you’re left with nothing. We called our subscription offering the Brand Kit. For about $100 / year it gave a user 300+ branding, marketing, and business designs that automatically matched their logo.</p><p>That was over a year ago. Since then we’ve pushed two major updates to the Brand Kit. Added curved text logos to our logo maker. Launched a business name generator. Launched custom branded websites, and a print shop. Not to mention running over 150 experiments. Looking at the results alone, you can tell we’ve been shipping oriented. Since you’ve made it this far, I hope you care as much about shipping as we do.</p><h3>Why hire now?</h3><p>Since Fall 2019 we’ve gotten along fine without hiring full time devs. We’ve used recruiter services to bring in contract developers as we’ve needed them. Dawson and I have done a lot of development, and we’ve made Looka a much more useful product for our users.</p><p>We’re hiring now because we need more committed hands to balance keeping the codebase nimble for the long term, and shipping new features and products. There are enough things going on now that we don’t have the attention to give to all the areas of the product to see them grow to their full potential.</p><p>Our current plan is to build a small dev team. We want a solid core of experienced developers who like shipping, like writing documentation, and who want to improve the codebase as they work on it.</p><p>Everyone we hire should have full-stack experience, so they can own features end to end. ReactJS/TypeScript/(Golang or NodeJS) experience is necessary. Kubernetes, and AWS would be useful. Graphic Design, Python, and data engineering experience could also help you stand out.</p><p>Uncommon but valuable experience would include deep knowledge of SVG, ability to make dynamic mockups, and prior experience working on graphic editors.</p><p>A strong candidate will be conscientious, self-motivated, detail oriented, a strong writer, and open to giving/receiving feedback.</p><h3>What’s the job like?</h3><p>We have 1 regular meeting a week. It’s a team wide sync that usually takes less than an hour.</p><p>We write our ideas and our plans out. We find it’s much easier to think critically while writing than while sitting in a meeting. It’s also easier to collect team feedback on written ideas, since it can be done asynchronously.</p><p>We’re fully remote. We have an office in downtown Toronto but you get no extra points for going in. It’s a quiet place to work if you need one, and an occasional set for filming videos.</p><p>Most communication is async. Outside of rare urgent situations, you never need to respond to something “right now”. Do your work, and respond to messages when it suits you.</p><p>Both Dawson and I write code. In fact, we love writing code. Part of the reason we’ve put off hiring until now is because it’s so much fun to write code. All this to say, your leaders appreciate what you do, and have empathy for how you work (including <a href="http://www.paulgraham.com/makersschedule.html?viewfullsite=1">minimal meetings</a>).</p><p>As far as management style goes, we focus on communicating things clearly (in writing and designs) and then getting out of your way. Not every dev wants such a hands-off management style, but if you are a dev that does, we think you’ll be able to do the best work of your life at Looka.</p><p>We’re benchmarking salaries and paying in the top 15% of Toronto employers for developers. We want you to be able to work without the nagging feeling that you could be making more elsewhere. If working at Looka is a good fit for you, then we’ll pay you enough so that you feel your abilities are appreciated.</p><h3>The values that we’re building into the team</h3><p>We use trunk based development</p><p>We love to write and read</p><p>We own our features</p><p>We ship as quickly as possible</p><p>We seek out feedback</p><p>We leave the codebase better than we found it</p><h3>What’s next?</h3><p>If this sounds like a place you’d like to work, then please apply through <a href="https://angel.co/l/2vQUi7">Angel List</a> or message me on <a href="https://twitter.com/andrewbrownmart">Twitter</a>. We’d love to hear from you. We have big plans to continue growing profitably at Looka, and we need an incredible team to do that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f166ddbe382a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/looka-engineering/looka-is-hiring-developers-f166ddbe382a">Looka Is Hiring Developers</a> was originally published in <a href="https://medium.com/looka-engineering">Looka Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What do Canadian Politicians Talk About in Parliament?]]></title>
            <link>https://medium.com/@andrew.brown.martin/what-do-canadian-politicians-talk-about-in-parliament-1baf9cf78f1c?source=rss-e1e8bdb7b063------2</link>
            <guid isPermaLink="false">https://medium.com/p/1baf9cf78f1c</guid>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[canada]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Andrew B. Martin]]></dc:creator>
            <pubDate>Mon, 06 Sep 2021 22:52:44 GMT</pubDate>
            <atom:updated>2021-09-06T22:52:44.477Z</atom:updated>
            <content:encoded><![CDATA[<p>Did you know that in parliament the NDP and Conservatives talk about families more than the other parties? Or that our elected leaders talk about Quebec 100x more than Nova Scotia, Newfoundland, and New Brunswick combined?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*bRCsmsdQ28dHHHuKrOoqDA.png" /><figcaption>How much time does each party spend talking about each province. Darker equals more time.</figcaption></figure><p>Before starting this project, I didn’t either. And to be honest I still don’t know what our MPs actually talk about. All I have is an approximation. I’ve pulled all parliamentary transcripts from the past two sessions, and done some simple text analysis on them. I’ll share with you data and my approach. This could give a starting point for helping lay people gain insight into what our elected officials talk about once they’re elected.</p><p><em>Warning: all the analysis that follows is casual and done over a weekend. If you want to re-create it, or do your own, likely better, analysis than check out the </em><a href="https://github.com/AndrewBMartin/canadian_parliamentary_text_analysis"><em>Github repo</em></a><em>!</em></p><h3>Sunlight is the best disinfectant</h3><p>What goes on in parliament has always been a mystery to me. We Canadians elect and pay for hundreds of representatives every year to live in Ottawa, engage in what we hope is honest conversation, and make the decisions and laws we live by. However, despite this weighty mantle of responsibility, for me as a member of the public, it’s hard to get a view into what’s going on in parliament.</p><p>This isn’t due to any deliberate measures to make that information inaccessible. Parliamentary sessions are publicly broadcast, and the transcripts of every session can be found online. Unfortunately, these resources have limitations. Our representatives can be loquacious to the point of inarticulacy, and there is a vast amount of context needed to follow the discussions. Taken together, these factors make it difficult for a lay person to stay engaged.</p><p>With the election coming up, I thought it would be fun to shine a light onto what goes on in parliament. After all, an election is an opportunity to clean our collective house, and they say sunlight is the best disinfectant.</p><p>In what follows, I’ll share how often politicians of each party use certain words. There is no doubt more sophisticated ways to analyze the parliamentary text corpus, and I hope readers use them!</p><h3>What’s everyone talking about?</h3><p>All the text is taken from Government Bills &amp; Private Member Bills (starting with C-) from sessions 43–1 and 43–2 of the Canadian parliament. Some parties talk more than others, so I’ve normalized the data so that all the frequencies are relative to the party. I looked at keyword analysis as well, but found simple word frequency to be more effective and easier to reason about. In the charts below, I show the relative frequency each party uses the displayed words. Someone well versed the latest NLP models may be able to take this much further than I can.</p><p>Again, you can find all the data and my code on <a href="https://github.com/AndrewBMartin/canadian_parliamentary_text_analysis">Github</a>!</p><p>Without further adieu, here’s some results.</p><h4>Popularity contest</h4><p>No surprise that the Liberals are the most talked about party in parliament. It is surprising how little they talk about themselves (maybe has to do with being in power?). Conservatives are a close second, with the NDP and Bloc coming in 3rd and 4th. Another interesting point, the NDP seems to talk about themselves more than any other party.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*af_CRlhRK_0NFS8ecz_OcQ.png" /><figcaption>The relative amount of time each party spends talking about the other parties. Darker equals more time.</figcaption></figure><h4>A mari usque ad mare</h4><p>All the parties talk about Quebec way more than any other province (maybe more than all the other provinces combined). As I mentioned in the introduction, Quebec is talked about more than 100x more than all of Atlantic Canada. All parties talk about Canada approximately the same amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*kdQyYlXmnMEEKCkeL-BRUQ.png" /><figcaption>The relative amount of time each party spends talking about Canadian provinces. Darker equals more time.</figcaption></figure><h4>Pandemic Response</h4><p>Covid-19 hit in the middle of session 43–1. For the most part, parties were uniform in how they discussed the pandemic. I’m surprised so little time was spent talking about “lockdown”. Perhaps this is a problem with my approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*qvratTba7wSY2NAQXt8kHg.png" /><figcaption>The relative amount of time each party spends talking about the pandemic. Darker equals more time.</figcaption></figure><h4>Social Terms</h4><p>I left “climate” off this chart because the Greens talk about it so much that it throws off the scale for the rest of the topics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*qacHLyAC5D0eqrkHM_HkxA.png" /><figcaption>The relative amount of time each party spends talking about social topics. Darker equals more time.</figcaption></figure><h4>Economic Terms</h4><p>A decision here was to include “tax” instead of “taxes” because “tax” is talked about more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*SHd6NKRxZGaKUYdcwFY08A.png" /><figcaption>The relative amount of time each party spends talking about economic topics. Darker equals more time.</figcaption></figure><h3>Conclusion</h3><p>I hope you’ve enjoyed this birds-eye view of what our MPs have been talking about for the last two years. You may have noticed this approach makes it hard to capture context, and there are some associations that were intentionally overlooked. For example, “tax” and “taxes”. If you see ways to improve on it, please do. You can reach out to me on <a href="https://twitter.com/andrewbrownmart">Twitter</a> or <a href="https://github.com/AndrewBMartin/canadian_parliamentary_text_analysis">Github</a> to learn more.</p><p>A profusion of data, and newly developed language processing algorithms, make this kind of analysis more possible, and more useful than ever. I hope that these tools can be used to make understanding our government, and the discussions that are had in parliament more accessible to all Canadians.</p><p>— Andrew</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1baf9cf78f1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to visualize feature vectors with sprites and TensorFlow’s TensorBoard]]></title>
            <link>https://medium.com/looka-engineering/how-to-visualize-feature-vectors-with-sprites-and-tensorflows-tensorboard-3950ca1fb2c7?source=rss-e1e8bdb7b063------2</link>
            <guid isPermaLink="false">https://medium.com/p/3950ca1fb2c7</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Andrew B. Martin]]></dc:creator>
            <pubDate>Wed, 26 Jun 2019 13:34:32 GMT</pubDate>
            <atom:updated>2020-10-09T21:45:04.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MF9MCDeNE1_GdmGWLkZ9cw.png" /><figcaption>t-SNE of XO data</figcaption></figure><h3>Introduction</h3><p>This post will show you how to take a set of images and image vectors, and prepare them for visualization in TensorFlow’s <a href="https://www.tensorflow.org/guide/summaries_and_tensorboard">TensorBoard</a>.</p><p>Imagine I’ve been working with an image dataset (doesn’t require much stretch of the imagination…). Maybe using it for classification, maybe using it for training a generative model, or maybe using it predict daily rainfall in Antigonish, Nova Scotia. For this post it doesn’t matter much what I’m using the images for. For this post what matters is I’ve passed my images through a model that maps them to an embedding space and now I have an embedded (aka vector) representations of my images.</p><p>Now, with these image vectors I want to get a sense of what the embedding space looks like. There are a number of ways to go about doing this, but one quick way I go about this is to use TensorFlow’s TensorBoard. It gives me beautiful visualizations and I can run 2D/3D PCA and t-SNE algorithms on my image vectors directly in my browser. The demo version of TensorBoard even has <a href="http://projector.tensorflow.org/">UMAP</a> 😮. <em>TensorBoard comes with TensorFlow so you can install it by following the </em><a href="https://www.tensorflow.org/install/"><em>TensorFlow installation guide</em></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxZSm1Hfnt2vogXhZkvxgA.png" /><figcaption>TensorBoard example showing UMAP: <a href="http://projector.tensorflow.org/">http://projector.tensorflow.org/</a></figcaption></figure><p>When I first tried to do this, I realized there aren’t a lot of good resources to guide someone in how to prepare images for TensorBoard. There’s a <a href="https://github.com/tensorflow/tensorboard/issues/670">github issue,</a> and another github issue saying there’s <a href="https://github.com/tensorflow/tensorflow/issues/6322">no code example</a>. Even though the second link has some resources now, they’re still not easy to access. I hope this post gives a good straightforward walk through of how to visualize image feature vectors in TensorBoard.</p><p>In the spirit of straightforward you can find a <a href="https://github.com/AndrewBMartin/tensorboard_sprites/blob/master/tensorboard_sprites.ipynb">jupyter notebook here</a> with the code in case you don’t care about a walk through.</p><h3>The code</h3><p>In the next few paragraphs I’ll describe how to go from images and image vectors to a representation that can be visualized in TensorBoard. For this to work, the model I’m getting the image vectors from doesn’t have to be in <a href="https://www.tensorflow.org/">TensorFlow</a>. It can be <a href="https://pytorch.org/">PyTorch</a>, <a href="https://chainer.org/">Chainer</a>, whatever, as long as the vectors can be saved as numpy arrays. I’m going to first create a sprite image for TensorBoard, and then save my image vectors as TensorFlow variables so that TensorBoard can read them and associate them with the sprite image.</p><p>Create the sprite image with the following function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aaa6d63db7ae254e24c6b0af41d55969/href">https://medium.com/media/aaa6d63db7ae254e24c6b0af41d55969/href</a></iframe><p>Looking at the code, the first block adjusts all images to be 3 channel RGB images. The second block adds padding to the images. A sprite image should be a square so we compute the padding we need to arrange our images into a square. The third block of code tiles the individual images into the square sprite image.</p><p>Using this function in an example, it might look something like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebaaa702043c6a53494d1c7ead9ced81/href">https://medium.com/media/ebaaa702043c6a53494d1c7ead9ced81/href</a></iframe><p>Now I’ll load the feature vectors, generate metadata, and save them for loading into TensorBoard:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2dfec662a1d25b2af6cbf574363a2a6c/href">https://medium.com/media/2dfec662a1d25b2af6cbf574363a2a6c/href</a></iframe><p>The code should be easy to follow. I create a metadata file, then add an embedding to the TensorBoard config, and attach the metadata and sprite to the embedding.</p><h3>Visualizations</h3><p>Then I’ll fire up TensorBoard and watch the magic happen.</p><p>$ tensorboard --logdir my-log-dir</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtZGYnTHp3ClYcaQZxjFvw.png" /><figcaption>2D PCA</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S20grLz9zpEUDVnOZr8KBA.png" /><figcaption>3D PCA</figcaption></figure><h3>Conclusion</h3><p>Thanks for reading. I’ve shown you how to take feature vectors and associated images, and prepare them for visualization in TensorBoard. I hope you’ve enjoyed the post. You can find a working example (along with data!) on <a href="https://github.com/AndrewBMartin/tensorboard_sprites">github</a>. Don’t hesitate to reach out with any questions.</p><p><em>You can follow me for more content on Twitter @andrewbrownmart</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3950ca1fb2c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/looka-engineering/how-to-visualize-feature-vectors-with-sprites-and-tensorflows-tensorboard-3950ca1fb2c7">How to visualize feature vectors with sprites and TensorFlow’s TensorBoard</a> was originally published in <a href="https://medium.com/looka-engineering">Looka Engineering</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 use Tensorboard with PyTorch in Google Colab]]></title>
            <link>https://medium.com/looka-engineering/how-to-use-tensorboard-with-pytorch-in-google-colab-1f76a938bc34?source=rss-e1e8bdb7b063------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f76a938bc34</guid>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Andrew B. Martin]]></dc:creator>
            <pubDate>Thu, 28 Feb 2019 16:23:48 GMT</pubDate>
            <atom:updated>2020-10-09T21:46:09.188Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why you’re here</h3><p><a href="https://pytorch.org/">PyTorch</a> is the fastest growing deep learning framework. It offers several benefits over the more established <a href="https://www.tensorflow.org/">TensorFlow</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6ps0N8KYp19GtKZQDhBzw.png" /></figure><p>However, one area PyTorch falls short of TensorFlow is ecosystem support. Tensorflow has a rich ecosystem of libraries that PyTorch doesn’t have. For example, to serve models, deploy on mobile, and to visualize training. This last one is what interests me today. In particular, PyTorch doesn’t have a native training visualization tool like TensorFlow’s <a href="https://www.tensorflow.org/guide/summaries_and_tensorboard">TensorBoard</a>. This means it can be more time consuming to set up a visualization of your training with PyTorch than with TensorFlow, and you might decide to not set up visualization at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gQw9Rgr_p45alIw72GrEQ.png" /><figcaption>Cool Tensorflow visualisation from: <a href="https://stackoverflow.com/a/41370610/1514728">https://stackoverflow.com/a/41370610/1514728</a></figcaption></figure><p>In this post I’ll show you two ways you can visualize your PyTorch model training when using <a href="https://colab.research.google.com/notebooks/welcome.ipynb">Google Colab</a>. The first uses the new Jupyter TensorBoard magic command, and the second uses the library tensorboardcolab. You can find a link to an example Colab notebook at the end of each section.</p><h3>Tensorboard Colab magic</h3><p><a href="https://ipython.readthedocs.io/en/stable/interactive/magics.html">Magic commands</a> come from the IPython kernel and are meant to concisely solve common problems in data processing. Conveniently, there’s now a TensorBoard magic command (just make sure you install the latest TensorFlow build).</p><pre># Install latest Tensorflow build<br>!pip install -q tf-nightly-2.0-preview</pre><pre>from tensorflow import summary<br>%load_ext tensorboard.notebook</pre><p>Then instantiate the summary writers. In this case I have one for recording training and another for recording testing.</p><pre>current_time = str(datetime.datetime.now().timestamp())<br>train_log_dir = &#39;logs/tensorboard/train/&#39; + current_time<br>test_log_dir = &#39;logs/tensorboard/test/&#39; + current_time<br>train_summary_writer = summary.create_file_writer(train_log_dir)<br>test_summary_writer = summary.create_file_writer(test_log_dir)</pre><p>And you can write to TensorBoard just like you would in your TensorFlow code. See lines 24–26 below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d26453e388aa230057c6d3c74d51154/href">https://medium.com/media/2d26453e388aa230057c6d3c74d51154/href</a></iframe><p>Then run</p><pre>%tensorboard --logdir logs/tensorboard</pre><p>It can take 5 seconds for TensorBoard to load and start listening to the folder logs/tensorboard. Once you see TensorBoard up, run.</p><pre>train(model, train_loader, ...)</pre><p>And you’ll see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*swNxoPGn4418ggyZYVu0eQ.png" /><figcaption>Tensorboard running simultaneously with training!</figcaption></figure><p>Congratulations 🎉. You’re using PyTorch with TensorBoard in Colab. Note that this should also work in any Jupyter notebook using the IPython kernel as long as you install the latest TensorFlow.</p><p>To see how everything works together checkout this example <a href="https://colab.research.google.com/drive/1NbEqqB42VSzYt-mmb4ESc8yxL05U2TIV">Colab notebook</a>.</p><h3>The tensorboardcolab Library</h3><p>The second way to use TensorBoard with PyTorch in Colab is the <a href="https://github.com/taomanwai/tensorboardcolab">tensorboardcolab library</a>. This library works independently of the TensorBoard magic command described above.</p><p>This approach is similar to the TensorBoard magic command, except instead of running TensorBoard in your colab notebook it uses <a href="https://ngrok.com/">ngrok</a> to tunnel TensorBoard to localhost. See this <a href="https://stackoverflow.com/a/48468512/1514728">Stack Overflow Answer</a> for more details.</p><p>To use tensorboardcolab we’ll instantiate TensorBoardColab and then save values to it during training.</p><pre>!pip install tensorboardcolab</pre><pre>from tensorboardcolab import TensorBoardColab<br>tb = TensorBoardColab()</pre><p>The code to save to TensorBoardColab while training could look something like this (see line 25):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a8e55a7b521dbc5e64e8975b2d5d1f7/href">https://medium.com/media/1a8e55a7b521dbc5e64e8975b2d5d1f7/href</a></iframe><p>Then when you run</p><pre>train(model, train_loader, ...)</pre><p>You’ll see something like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*434AqQVLI7DTisRwLEr0Mw.png" /><figcaption>Tensorboard running on http://db797eee.ngrok.io</figcaption></figure><p>When you go to the link, you’ll see the TensorBoard dashboard you know and love.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*OrwcCXG3H3T2BZdxOfAynA.png" /><figcaption>Tensorboard dashboard using tensorboardcolab</figcaption></figure><p>To see how everything works together checkout this example <a href="https://colab.research.google.com/drive/1hR-DQvve8uEX2zH8h4y1XgP1atKRUl0g">Colab notebook</a>.</p><h3>Conclusion</h3><p>There you have it, two ways to visualize your PyTorch training using TensorBoard and Google Colab. I’ve made example Colab notebooks for each of the approaches.</p><p><strong>Magic Tensorboard</strong>: <a href="https://colab.research.google.com/drive/1NbEqqB42VSzYt-mmb4ESc8yxL05U2TIV">https://colab.research.google.com/drive/1NbEqqB42VSzYt-mmb4ESc8yxL05U2TIV</a></p><p><strong>tensorboardcolab</strong>: <a href="https://colab.research.google.com/drive/1hR-DQvve8uEX2zH8h4y1XgP1atKRUl0g">https://colab.research.google.com/drive/1hR-DQvve8uEX2zH8h4y1XgP1atKRUl0g</a></p><p>Good luck 😄</p><p><em>You can follow me on Twitter for more content @andrewbrownmart</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f76a938bc34" width="1" height="1" alt=""><hr><p><a href="https://medium.com/looka-engineering/how-to-use-tensorboard-with-pytorch-in-google-colab-1f76a938bc34">How to use Tensorboard with PyTorch in Google Colab</a> was originally published in <a href="https://medium.com/looka-engineering">Looka Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How we used QA and microservices for a seamless launch]]></title>
            <link>https://medium.com/looka-engineering/how-we-used-qa-and-microservices-for-a-seamless-launch-808f54cb2c15?source=rss-e1e8bdb7b063------2</link>
            <guid isPermaLink="false">https://medium.com/p/808f54cb2c15</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[logo-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Andrew B. Martin]]></dc:creator>
            <pubDate>Fri, 15 Jun 2018 13:16:21 GMT</pubDate>
            <atom:updated>2018-06-15T13:23:49.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9LzRVfcCKhvTIHxoRYfYg.jpeg" /><figcaption>Logo design the old fashioned way</figcaption></figure><h3>We wanted to accomplish three things with the launch…</h3><p>Earlier this month, Logojoy launched a major update to our infrastructure. We replaced the old rigid data structure that we used to describe logos with a new flexible data structure. We call these data structures ingredients. They contain everything Logojoy needs to know to draw a logo. To launch the new ingredients, we updated our client app, the server, and some of our microservices. Taken together, a lot of things could have gone wrong, because the ingredients are used throughout Logojoy: updating the ingredients was like doing a blood transfusion on the app. Fortunately, the launch went smoothly and we rolled out the new ingredients unbeknownst to our users.</p><p>We executed a seamless launch because we had three main goals:</p><ul><li>Maintain continuous service</li><li>Maintain a consistent experience for users</li><li>Maintain the ability to rollback smoothly</li></ul><p>We were able to achieve these goals (and thankfully did not have to rollback) due to two main factors. First, we performed deep QA with the entire product team on the new ingredients. Second, we leveraged our app’s microservice architecture to gracefully transition users to the new ingredients. Now, with the new ingredients in production, we have the foundation to accelerate product iteration and open up the throttle on growth.</p><h3>Why we outgrew the old ingredients</h3><p>Our mission with Logojoy is to make great design accessible to everyone. The old ingredients were great for getting us started, but they were getting in the way of our mission because they severely limited the variety of designs we could generate for users. We started batting around the idea of new ingredients in November 2017 after I had spent a week adding four new logo layouts to the app. It was obvious that adding new logo layouts was not scalable. Even worse, there were many layouts that were impossible to describe using the old ingredients.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*beHMmdSYfbzsflYS3QXbBQ.png" /></figure><p>When we decided to move forward with the new ingredients, we discussed what they would have to be like to give us the flexibility to achieve our growth goals. In principle, everyone on the product team was on the same page, but when it came to implementation, we had to go back and forth a few times. The most important concept was separating logo elements from their layout in the ingredients. We decided that the features property would keep all the data relating to things like text and symbols, and the layout property would describe how those features should be placed in relation to each other. This compares favorably to the old ingredients, where layouts were described only by their name, which was used to look up logo feature relationships at various points in the app. The layout property also had to be extensible so that we could represent arbitrarily complex designs with it. After weeks of prototyping, we settled on a tree structure for the layout property that satisfied these objectives. We hoped the new ingredients would make it easy to develop new logo layouts, improve training of our AI, and be more maintainable over the long term than the old ingredients.</p><h3>How we QA’d the launch</h3><p>The night we deployed the new ingredients, one of our devs and I were laughing at how we were rolling them out to all our users at the same time. With all our previous releases, we had staggered the rollout. In many ways, the new ingredients are more complicated and wind more intricately through the app than previous releases (e.g. when we updated the editor or launched our GoLang API). Further, once a user has their logo converted to the new ingredients then we don’t want to convert it back to the old ingredients. We were confident to roll out the new ingredients to everyone at once because we’d spent the last week preparing for it.</p><p>Just over a week before launch, we put the new ingredients on staging for initial testing. This was followed by three days of chipping away at obvious breaking bugs and browser issues. We tested checkout flows to make sure that users could purchase (the most important thing); we tested fulfillment to make sure that after a user makes a purchase, they receive the right assets; and, most of all, we tested the editor.</p><p>The editor is where users spend most of their time in Logojoy. It has something like 1 million interactions a day with users, and an average customer spends <a href="https://techvibes.com/2018/03/26/logojoy-has-created-over-50000-logos-and-boasts-more-than-1-5-million-users">80 minutes in the editor</a> before purchasing. Our editor also helps people get what they want quickly: 60% of our customers purchase their logo the same day. All this emphasizes not only how important the editor is to Logojoy, but also how rich it is. While this is a major boon to our users, it makes QA time consuming, to say the least.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oJ-jJSpLespAC2vr_WYvg.jpeg" /><figcaption><strong>top</strong>: editor view of logo; <strong>bottom</strong>: symbol, layout, and font variations on logo</figcaption></figure><p>While QAing the editor, we wrote a library to migrate old ingredients logos to the new ingredients so existing users could take advantage of the benefits of the new ingredients. This meant that in addition to testing the editor with the new ingredients, we tested everything with old logos migrated to the new ingredients as well. Most of our users convert same day, but about 10% of users spend more than a week working on their logos, so it’s essential we continue to give them a great experience.</p><p>After three full days of fixing the obvious bugs, we invited the rest of the product team to run through the app and give us their feedback. We opened up an Asana board for QA and waited for the tickets come in. Inevitably new bugs surfaced; as one dev said to me in a Slack message “such is life.”</p><p>One bug that comes to mind is that we had a function in one of our key libraries that caused the site to not load on older versions of some browsers. We hadn’t gone through a deep browser test yet, so hadn’t picked it up. It was funny how after months of work, as soon as we shared the staging site with the product team, the first person to log on shouted out for everyone to hear “the page doesn’t load!” Fortunately, it was a quick fix, and we had the staging site working for everyone 15 minutes later.</p><p>With the new ingredients up on staging, we worked with our designers to make the logos look amazing. We analyzed things like what symbol alignments work with what logos, how to size different elements, and what color schemes work in certain contexts. Our logo design algorithms learn from what our users like, but we also make sure our algorithms are given a sound education in the fundamentals of design from seasoned designers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6xlkt3MXiKIK2TI6_zX2w.png" /><figcaption>Breaking down a logo’s spacing and sizing</figcaption></figure><h3>The beauty of launching with microservices</h3><p>We decided to launch on a Tuesday. For me, the most important thing was that the new ingredients were working well enough and I was confident we wouldn’t crash the app. Our team spent all of Tuesday working on final tweaks and finishing tickets. By this point, we had spent the last week QAing the new ingredients, and it needed to get out the door before something silly happened, like one of us deciding some library needed another refactor before launch. I was excited to get this project in production. The logos that we could create with the new ingredients looked terrific. I wanted to get these logos out into the world.</p><p>Later that day the new ingredients went live. With our microservice architecture, we adopted the strategy to keep old and new services running simultaneously. Existing users continue to use the old services, and new users use the new services. Most users purchase their logo the same day they sign up, and almost all within a week, so we knew that by the end of the week virtually all our users would be on the new ingredients.</p><p>The Logojoy app runs on an efficient microservice architecture. We serve more than 100,000 users a week, and our AWS bill is less than $100/month (database aside). The cornerstones are our Kubernetes server cluster, our React/Redux client-side that communicates with the server using GraphQL, and a host of microservices run on AWS lambdas and ec2 instances. To update the app for the new ingredients, we had to update two microservices: the React/Redux app and, of course, the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BeNVVSz05vM0U1IoWX6cA.png" /></figure><p>The two microservices we had to update were the microservice that draws logos, and the microservice that prepares assets for purchased logos, known as fulfillments. Both run on AWS lambda functions. Fulfillments are routed server-side and logo drawing is done client-side. We employed the same strategy in both cases. Prior to the launch, we had three stages for each of the lambdas: dev, stage, and prod. We didn’t want to update the prod lambda directly because that would lead to jarring experiences for users in the app. You could imagine a user with old ingredients sending a request to the new ingredients lambda and getting an error, interrupting their session. Further, if something went wrong, it could lead to errors for all users and it would make rolling back more awkward.</p><p>To avoid updating the production lambdas directly, we created a new stage: next. Users wouldn’t interact with the ‘next’ lambdas until we updated the react app and server. This meant we could safely test the lambdas in their production environment before sending users’ requests to them. This is particularly useful because our lambdas require permissions for other AWS services, so we could test requests and make sure all our configurations were correct before putting them live.</p><p>Our strategy of running old and new services simultaneously meant that the fulfilments and drawing had similar development. For fulfilments, an updated server would route new and old ingredients to their appropriate lambda stage. We uploaded the server docker image for the new ingredients early on Tuesday with no issues. For the drawing microservice, we updated the React-app’s environment file to point to the new lambdas (stage: next) and deployed a new version of the app. We keep both the old and new lambdas running because users who are on the app will continue to interact with the old lambdas — their experience is uninterrupted. Even better, if we have to rollback for any reason, all we have to do is redeploy the last version of the react app that points to the old ingredients lambdas. Thus we’re able to achieve all our goals: No interruption of service, users have a consistent experience, and rollbacks are straightforward.</p><h3>What happened when we launched</h3><p>When it comes down to it, the launch was almost as easy as we hoped it would be. We launched the new ingredients at 9 pm and had customer success managers on hand in case anything went wrong. I opened an error log terminal window to watch the lambda functions and prepared myself to see crash logs. There were no crash logs, just errors. The errors weren’t bad either. For example, in the drawing lambda, some properties were undefined that in testing had never been undefined. Then we found there was a memory leak due to the way we were storing the users’ requests — also in the drawing lambda. After fixing that, we were still getting out of memory errors, so we doubled the memory of the lambda and that fixed those problems. By this time, it was just after 11 pm, and we were confident that everything was working well enough to call it a successful launch and get some sleep.</p><p>The next day, after some well-deserved sleeping in, we fixed the bugs that had come up overnight, then fixed the useful but not critical things we had set off to do after launch. For instance, improving the sizing of slogans, fixing a bug with the uppercase and lowercase buttons, and completing bug fixes on migrated logos.</p><p>Over the following days, we continued to refactor and refine the code. In that same period, we saw that conversions were up 6% on the week, and 7% on the prior week. Our customers liked the new logos that we were generating. On top of that we didn’t have any complaints to customer success about bugs related to the launch of the new ingredients and the performance of the lambdas improved, too. With the new ingredients, we reduced the number of times the lambdas had to be called, and we reduced the number of invocation errors on our drawing lambda by over 50%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ny1mDOUWNeAqd3_msqcNEg.png" /><figcaption>Coming soon Logojoy logo layouts</figcaption></figure><h3>The Takeaway</h3><p>Taken together, it’s easy to feel good about the launch of the new ingredients. We deployed a data structure that’s crucial to the continued growth of Logojoy, and we’re helping users make better logos than before. During the launch, we provided our users with an uninterrupted experience, and got minimal complaints from our users due to bugs from the launch. We increased conversion rate and general performance of the app, too.</p><p>Most importantly we’re laying the foundation for things to come so that we can tackle even bigger problems. Now to get on to making those new logo layouts.</p><p><em>Interested in combining AI and design? We’re looking for Software Engineers to join our product team. </em><a href="https://logojoy.com/careers/"><em>https://logojoy.com/careers/</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=808f54cb2c15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/looka-engineering/how-we-used-qa-and-microservices-for-a-seamless-launch-808f54cb2c15">How we used QA and microservices for a seamless launch</a> was originally published in <a href="https://medium.com/looka-engineering">Looka Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>