<?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 Ken L. on Medium]]></title>
        <description><![CDATA[Stories by Ken L. on Medium]]></description>
        <link>https://medium.com/@kenlam_76961?source=rss-b461d685b570------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T_yD7R9wxefLHR_WsThxqw.jpeg</url>
            <title>Stories by Ken L. on Medium</title>
            <link>https://medium.com/@kenlam_76961?source=rss-b461d685b570------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 02:26:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kenlam_76961/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[Generate BroCodes with LSTM]]></title>
            <link>https://medium.com/@kenlam_76961/generate-brocodes-with-lstm-50166156b291?source=rss-b461d685b570------2</link>
            <guid isPermaLink="false">https://medium.com/p/50166156b291</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ken L.]]></dc:creator>
            <pubDate>Fri, 21 Jun 2019 14:16:25 GMT</pubDate>
            <atom:updated>2019-06-21T14:16:25.558Z</atom:updated>
            <content:encoded><![CDATA[<h3>Generate Bro Codes with LSTM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*STacfCDRpSIC01k8vtkZUA.png" /><figcaption>Chuck Norris is always the answer.</figcaption></figure><p>Inspired by Janelle Shane’s <a href="https://aiweirdness.com/post/159302925452/the-neural-network-generated-pickup-lines-that-are">Pickup Line Generator</a>, I attempted to train a recurrent neural network that can come up with its own Bro Codes using data from the following sources:</p><ul><li><a href="https://brocode.org/the-code/">https://brocode.org/the-code/</a></li><li><a href="http://www.fanpop.com/clubs/barney-stinson/articles/162623/title/chicks-code">http://www.fanpop.com/clubs/barney-stinson/articles/162623/title/chicks-code</a></li></ul><p>The underlying idea of text generation model is essentially a language model that predicts the probability of each word given an input sequence of text. The predicted word will then be added to the previous input sequence which will be used to generate the next word again. The cycle repeats for an arbitrary number of times.</p><p>Simply put, given the sentence “<strong>Bro’s do not keep a personal diary</strong>”, the model needs to do the following:</p><ol><li>given “<strong>Bro’s</strong>”, predict “<strong>do”</strong></li><li>given “<strong>Bro’s do</strong>”, predict “<strong>not”</strong></li><li>given “<strong>Bro’s do not</strong>”, predict <strong>keep”</strong></li><li>given “<strong>Bro’s do not keep</strong>”, predict “<strong>a”</strong></li><li>given “<strong>Bro’s do not keep a</strong>”, predict “<strong>personal”</strong></li><li>given “<strong>Bro’s do not keep a personal</strong>”, predict “<strong>diary”</strong></li></ol><p>For this experiment, I trained a neural network with 3 hidden layers of bidirectional LSTM on Google Colab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*5JYvH131vvm1teghlkosgg.jpeg" /></figure><p>Despite the small amount of data, the model managed to come up with some novel Bro Codes:</p><ul><li>‘A bro is unacceptable in sandals.’</li><li>‘A bro is honor bound to drink’</li><li>‘A bro always grow a moustache of armpits’</li><li>‘A bro will not sleep in front of bros. no’</li><li>‘A bro never tickles another bro’s muscles’</li><li>‘A bro will order any type of alcoholic drink she wants’</li><li>‘A bro is honour bound to accept all style chick’</li><li>‘A bro does not choose his own wrestling challenges when a chick orders’</li><li>‘A bro never gives another bro’s toothbrush they wouldn’t try them self .’</li><li>‘A bro never willingly relinquishes possession of a bachelor party’</li><li>‘A bro never lets another bro drink with any married bros’</li><li>‘A bro will only be supportive of all decisions of his side chicks .’</li><li>‘A bro is honor bound to his wife .’</li><li>‘A bro is always completely respectful to music in a bar’</li><li>‘When a bro is in doubt , he shall consider the actions of chuck norris’</li></ul><p>These ones make no sense, but are still grammatically correct (to a certain extent):</p><ul><li>‘If a bro asks out a guitar at a party , he will leave a quarter’</li><li>‘If a bro asks , a chick may not be tolerated in another bro to toss a banana’</li><li>‘When a bro dies while lifting weights , he is required to sit him twice before she must honor the weird wait three days’</li><li>‘A bro never facetimes , skypes or uses any other guy and chair for cue .’</li><li>‘A bro never borrows or lends clothes of another bro to eating a banana”</li></ul><p>You can look at the complete code of this model at <a href="https://github.com/ckenlam/Deep-Learning-Text-Generation-Model/blob/master/text_generation.ipynb">https://github.com/ckenlam/Deep-Learning-Text-Generation-Model/blob/master/text_generation.ipynb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50166156b291" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hopper Inc.’s Puzzle]]></title>
            <link>https://medium.com/@kenlam_76961/hopper-inc-s-puzzle-2ebf04b4ae85?source=rss-b461d685b570------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ebf04b4ae85</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[hopper]]></category>
            <dc:creator><![CDATA[Ken L.]]></dc:creator>
            <pubDate>Wed, 18 Jul 2018 21:54:38 GMT</pubDate>
            <atom:updated>2018-07-18T22:17:49.444Z</atom:updated>
            <content:encoded><![CDATA[<p>I stumbled upon a data-puzzle of Hopper Inc. from their career page for their Data Scientist applicants. Challenge accepted! Let’s see what I can find. This will also be my first article on Medium.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yz0b1NiyXcpbGSbFJ1Vpdg.jpeg" /></figure><p>A little bit of backstory…</p><p>Hopper Inc. is the maker behind the flight-booking app that predicts the price of flights up to a year in advance with 95 per cent accuracy by using algorithms capable of analyzing massive amounts of data. Depending on the price of tickets when a search is made, Hopper advises users whether they should buy immediately or wait for a better price. The application will then send the user a notification when the flight is at its lowest predicted price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2Af6qETaz3y5-FJ6awT8A.png" /></figure><p>Below is my work on the dataset that Hopper provided:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/79d3f69710d992cf1b47e9573697e5cd/href">https://medium.com/media/79d3f69710d992cf1b47e9573697e5cd/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ebf04b4ae85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>